To be honest, I don't really understand battle scripts. Half of them aren't even in the official manual. Can anyone help me with the following:
a) How do I determine if my hero is defending or attacking? (IsAttacker works very strangely)
b) What UnitName should I specify? Is it the name of the unit as it appears on the map, or the script name?
c) How do I make a hero cast a spell at the beginning of the battle or in sync with another action (like Frida's Divine Retribution or Leto's Plague)?
I would appreciate it if you could provide some small examples, as I won't be able to figure it out otherwise.
Thank you in advance.
if GetHeroName('defender-hero') == 'hero name' then
--hero is defending
elseif GetHeroName('attacker-hero') == 'hero name' then
--hero is attacking
else
--not participating
endb) If unitName is in the arguments, then the unit names are determined by the GetAttackerCreatures or GetDefenderCreatures functions, which return an array. 'attacker-hero' and 'defender-hero' can also be unit names.c) UnitCastAimedSpell, UnitCastGlobalSpell, UnitCastAreaSpell.
The arguments are described in sufficient detail in the manual (HOMM5_Script_Functions.pdf).
Одиночные: Завеса срывается, Посол, Последний рывок, Эхо Пустоты
Кампания: Империя Единорога
Существа NCF
Орден Порядка: 1
Нейтралы: 1 2 3 4