romanandre
New Member
- Reaction score
- 2
I want to cast a dummy spell whenever I attacked when I have a buff , can anyone help? its lagging a lot.
I belive its the condition on if/then/else, should I make a function or a variable for this condition?.
idk how to post with jass code window if anyone can help.
Thanks for the help.
here is the code
//================================
edit: added jass tag
I belive its the condition on if/then/else, should I make a function or a variable for this condition?.
idk how to post with jass code window if anyone can help.
Thanks for the help.
here is the code
//================================
JASS:
function Trig_Dot_Conditions takes nothing returns boolean
return GetUnitAbilityLevel(GetAttacker(), 039;B000039;) > 0
endfunction
function Trig_Dot_Actions takes nothing returns nothing
local unit attacker = GetAttacker()
local unit attacked = GetTriggerUnit()
if GetUnitAbilityLevel(attacked, 039;B001039;) == 0 and GetUnitAbilityLevel(attacked, 039;B002039;) == 0 and GetUnitAbilityLevel(attacked, 039;B003039;) == 0 and GetUnitAbilityLevel(attacked, 039;B004039;) == 0 and GetUnitAbilityLevel(attacked, 039;B005039;) == 0 then
call UnitAddAbility(DUMMY, 039;A003039;)
call IssueTargetOrder(DUMMY, "acidbomb", attacked)
call UnitRemoveAbility(DUMMY, 039;A003039;)
else
endif
endfunction
//===========================================================================
function InitTrig_Dot takes nothing returns nothing
set gg_trg_Dot = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(gg_trg_Dot, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddAction( gg_trg_Dot, function Trig_Dot_Actions )
call TriggerAddCondition( gg_trg_Dot, Condition( function Trig_Dot_Conditions) )
endfunction
edit: added jass tag