Skip to content
User Avatar
#3811
Auto-translated
Shiroyasha2910

I'm almost finished creating the map, but I've run into a problem: I don't know how to create a custom bonus for a set of artifacts. Specifically, I have no idea how to implement this. The idea is that if a hero has the following artifacts: Necromancer's Helmet, Cursed Ring, Ring of the Broken Spirit, and Necromancer's Amulet, then:

The hero guarantees that at the start of the battle, all creatures in the enemy army will be affected by the spells "Slow," "Misfortune," "Weakness," and "Curse." The effect lasts for 10 turns.

Please help.


If you understand how to link the execution of a combat script to heroes wearing specific artifacts, then the rest is quite simple:
function Start()
  for side=0,1 do
    if GetHero(side) then
      if GetHeroName(GetHeroSide()) then --Your in-battle check for the hero. I recommend creating a global variable in the adventure map script, such as "hero".."_NecArtSet," and setting it to 1 if the set is present (and 0 if it's not), and then writing a check like if GetGameVar(GetHeroName(GetHeroSide()).."_NecArtSet")+0==1 then
        startThread(function(side)
        combatSetPause(1)
        SummonCreature(side, CREATURE_YETI, 1)
        for n, unit in GetCreatures(side) do if GetCreatureType(unit)==CREATURE_YETI then local _helper = unit break; end; end
        while not exist(_helper) do sleep() end
        for n, spell in {SPELL_MASS_SLOW, ...} --List of mass-cast spells
          UnitCastGlobalSpell(_helper, spell)
        end
        removeUnit(_helper)
        combatSetPause(nil)
        )
      end
    end
  end
end

I wrote the script without testing, so please adapt and test it. You will also need to replace the mana cost in the Neutrals/Yeti creature's characteristics with ~200 and the skill in the school so that it lasts 10 turns. Or play around with the number of summoned creatures.

С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________