- Joined
- Oct 11, 2012
- Messages
- 711
Hey guys, I want to make a war stomp type ability. When the hero cast warstomp, there will be dummies randomly casting warstomp within a certain range of the hero. I used the following Jass codes, but did not work and I don't know why. Please help, thanks a lot.
Is it something wrong with the dummies locations?
Is it something wrong with the dummies locations?
JASS:
function Trig_tianbengdl_Conditions takes nothing returns boolean
return(GetSpellAbilityId()=='A233')
endfunction
function Trig_tianbengdl_Actions takes nothing returns nothing
local integer tbdl=0
set udg_LsJndian=GetUnitLoc(GetTriggerUnit())
set udg_JSDian=PolarProjectionBJ(udg_LsJndian,400.,GetRandomReal(0,360))
set tbdl=0
loop
exitwhen (tbdl>8)
call CreateNUnitsAtLoc(1,'n01J',GetOwningPlayer(GetTriggerUnit()),udg_JSDian,bj_UNIT_FACING)
call IssueImmediateOrderById (bj_lastCreatedUnit,852127)
call RemoveLocation(udg_JSDian)
call RemoveLocation(udg_LsJndian)
set tbdl=tbdl+1
endloop
endfunction
function InitTrig_tianbengdl takes nothing returns nothing
set gg_trg_tianbengdl=CreateTrigger()
call DisableTrigger(gg_trg_tianbengdl)
call TriggerRegisterPlayerUnitEventSimple(gg_trg_tianbengdl,gg_unit_ABCD_0247,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_tianbengdl,Condition(function Trig_tianbengdl_Conditions))
call TriggerAddAction(gg_trg_tianbengdl,function Trig_tianbengdl_Actions)
endfunction