Matemeo
New Member
- Reaction score
- 20
I have this here code.
I placed BJDebugMsg's to check how far it gets. I get a, "inside of actions, condition passed" message, but nothing else after that. I'm almost positive I did this right, and I've never had this happen before. Any thoughts? It's really bugging me.
Thanks in advance.
JASS:
scope ImpaleMadness
globals
private constant integer SPELL_ID = 039;A003039;
private constant integer DUMMY_ID = 039;n001039;
private constant integer IMPALE_ID = 039;A004039;
unit caster
integer ticks
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == SPELL_ID
endfunction
private function callback takes nothing returns nothing
local timer t = GetExpiredTimer()
local real Cx = GetUnitX(caster)
local real Cy = GetUnitY(caster)
local real Rx = Cx + GetRandomReal(1.0,400.0) * Cos(GetRandomReal(0,360.0))
local real Ry = Cy + GetRandomReal(1.0,400.0) * Sin(GetRandomReal(0,360.0))
local unit dummy = CreateUnit(GetOwningPlayer(caster),DUMMY_ID,Cx,Cy,270.0)
call BJDebugMsg("inside of callback")
call UnitAddAbility(dummy,IMPALE_ID)
call UnitApplyTimedLife(dummy,039;BTLF039;,1.0)
call IssuePointOrder(dummy,"impale",Rx,Ry)
set ticks = ticks - 1
if ticks <= 0 then
call BJDebugMsg("ticks <= 0, destroying timer")
call PauseTimer(t)
call DestroyTimer(t)
endif
set t = null
set dummy = null
endfunction
private function Actions takes nothing returns nothing
local timer t = CreateTimer()
call BJDebugMsg("Inside of actions, condition was passed")
set ticks = 10
call TimerStart(t, .5, true, function callback)
endfunction
//===========================================================================
public function InitTrig takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(t, Condition( function Conditions ) )
call TriggerAddAction(t, function Actions )
endfunction
endscope
I placed BJDebugMsg's to check how far it gets. I get a, "inside of actions, condition passed" message, but nothing else after that. I'm almost positive I did this right, and I've never had this happen before. Any thoughts? It's really bugging me.
Thanks in advance.