Spawning main heroes
Yeah, that can be done. You need to write a special combat script for your hero. Take a look at my map Mercenaries, the main hero there can get an ability to cast various spells in the beginning of the battle (like the armor of the damned in Homm3). Look for key words SetHeroCombatScript and SetGameVar. The combat scripts are in separate files called holy and unholy.
what about the combat script name? GetAttackerHero(); may point to opposing hero too...
and i guess the GetPlayerHeroes(PLAYER_1); only works on non-combat scripts...
and i tried to add it, it just says as error: "Maps\Multiplayer\...\cscript1.lua" doesn't exist...i uset GetMapDataPath().."cscript1.lua"
and i guess the GetPlayerHeroes(PLAYER_1); only works on non-combat scripts...
and i tried to add it, it just says as error: "Maps\Multiplayer\...\cscript1.lua" doesn't exist...i uset GetMapDataPath().."cscript1.lua"
ok i made a function that was supposed to learn heroes every spell they are able, but seems it doesn't work as i mean it to:
wait...it seems there is no spell with id 16...to exclude a single number i should do what?
ok nevermind solved that too...what is wrong with combat script here?
but it doesn't. the first spell that hero can't learn because of requirement makes the script fail. how could i fix that?function spell()
for i=1,295 do
TeachHeroSpell(a[0], i);
end;
end;
wait...it seems there is no spell with id 16...to exclude a single number i should do what?
ok nevermind solved that too...what is wrong with combat script here?
wrong type of argument 1 when calling function GetHost...function Start(h)
g=GetAttackerHero()
if IsHuman(g) then
x=GetUnitManaPoints(g) + 6;
SetUnitManaPoints(g,x);
UnitCastGlobalSpell(g,SPELL_MASS_PLAGUE);
else
h=GetDefenderHero()
x=GetUnitManaPoints(h) + 6;
SetUnitManaPoints(h,x);
UnitCastGlobalSpell(h,SPELL_MASS_PLAGUE);
end;
end;
Who is online
Users browsing this forum: No registered users and 0 guests