I want to create fear effect like World of Warcraft, but the target doesn't even move.
It's seem to be work without exitwhen.
Please Solve this.
Thanks
It's seem to be work without exitwhen.
Please Solve this.
JASS:
function Trig_Death_Coil_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 039;A00R039;
endfunction
function Trig_Death_Coil_Actions takes nothing returns nothing
local unit a = GetSpellTargetUnit()
local location r = GetUnitLoc(a)
local rect t = RectFromCenterSizeBJ(r, 1000, 1000)
local location l
call TriggerRegisterUnitEvent( gg_trg_Break_Fear, a, EVENT_UNIT_DAMAGED )
loop
exitwhen UnitHasBuffBJ(a, 039;B00J039;) == false
set l = GetRandomLocInRect(t)
call QuestMessageBJ( GetPlayersAll(), bj_QUESTMESSAGE_UPDATED, "TRIGSTR_9345" )
call IssuePointOrderLoc(a, "move", l)
call TriggerSleepAction(0.5)
set l = null
endloop
call RemoveLocation(l)
endfunction
//===========================================================================
function InitTrig_Death_Coil takes nothing returns nothing
set gg_trg_Death_Coil = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Death_Coil, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Death_Coil, Condition( function Trig_Death_Coil_Conditions ) )
call TriggerAddAction( gg_trg_Death_Coil, function Trig_Death_Coil_Actions )
endfunction
Thanks