Gtam
Lerning how to write and read!! Yeah.
- Reaction score
- 164
Why does this trigger keep going and never stops
JASS:
function Trig_Bolt_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'AHtb'
endfunction
function Trig_Bolt_Actions takes nothing returns nothing
set udg_Boolean = true
set udg_u = GetTriggerUnit()
set udg_t = GetSpellTargetUnit()
call TriggerSleepAction(2)
set udg_Boolean = false
endfunction
//===========================================================================
function InitTrig_Bolt takes nothing returns nothing
set gg_trg_Bolt = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Bolt, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Bolt, Condition( function Trig_Bolt_Conditions ) )
call TriggerAddAction( gg_trg_Bolt, function Trig_Bolt_Actions )
endfunction
JASS:
function Trig_Knock_Conditions takes nothing returns boolean
return udg_Boolean == true
endfunction
function Trig_Knock_Actions takes nothing returns nothing
local unit u = udg_u
local unit t = udg_t
local real x = GetUnitX(t)
local real y = GetUnitY(t)
local real f = GetUnitFacing(t) - 180.
local real a = 3 * Cos(f * .0175)
local real b = 3 * Sin(f * .0175)
//Now all the locals are declared time to knock back the unit
call PauseUnit(t, true)
call SetUnitPosition(t, x + a, y + b)
call UnitDamageTargetBJ(u, t, 5.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call AddSpecialEffectTarget("Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl", t, "chest")
call PauseUnit(t, false)
// Time to get those Leaks
call DestroyEffect( GetLastCreatedEffectBJ() )
set u = null
set t = null
endfunction
//===========================================================================
function InitTrig_Knock takes nothing returns nothing
set gg_trg_Knock = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Knock, 0.03 )
call TriggerAddAction( gg_trg_Knock, function Trig_Knock_Actions )
endfunction