cleeezzz
The Undead Ranger.
- Reaction score
- 268
i tried the demo and i got kinda lost (especially the actions)
JASS:
scope StealLife
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == 039;A000039;
endfunction
private function Actions takes nothing returns nothing
set udg_LifeStolen = ( 500.00 * I2R(GetUnitAbilityLevelSwapped(039;A000039;, GetTriggerUnit())) )
call SetUnitLifeBJ( GetTriggerUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetTriggerUnit()) + udg_LifeStolen ) )
call UnitDamageTargetBJ( GetTriggerUnit(), GetSpellTargetUnit(), udg_LifeStolen, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endfunction
//===========================================================================
public function InitTrig_StealLife takes nothing returns nothing
local trigger StealLife = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( StealLife, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( StealLife, Condition( function Conditions ) )
call TriggerAddAction( StealLife, function Actions )
endfunction
endscope