I want to set the damage of my unit that was created, like is there a function for that? (in vjass)
That's what i wrote, but I also want to set the damage of my wolf that I made, any suggestions will be appreciated.
JASS:
scope Wolf initializer Init
globals
private constant integer ABI_ID = 'A00K'
private constant integer WOLF = 'h00C'
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00K'
endfunction
private function Actions takes nothing returns nothing
local unit hero = GetTriggerUnit()
local player owner = GetOwningPlayer(hero)
local integer pid = GetPlayerId(owner) + 1
local real str = GetHeroStr(hero,true)
local unit wolf
call CreateUnit(pid, WOLF, GetUnitX(hero), GetUnitY(hero), 0)
set wolf = GetLastCreatedUnit()
call SetUnitState(wolf, UNIT_STATE_MAX_LIFE, (str * 2) + (str * 0.75)
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local trigger WolfTrg = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( WolfTrg, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( WolfTrg, Condition( function Conditions ) )
call TriggerAddAction( WolfTrg, function Actions )
endfunction
endscope
That's what i wrote, but I also want to set the damage of my wolf that I made, any suggestions will be appreciated.