- Joined
- Sep 6, 2007
- Messages
- 440
I defined some local's on a trigger. And then I wanted it to enable a trigger which would do actions of it every 1 second. But it doesn't do them because it doesn't know the variables I used for it. And when I declare the variables, it still does nothing. For those of you who read my other threads, sorry for about the same trigger but the problems never end! Any help is pretty much appreciated.
*AND*
JASS:
function Trig_Mental_Effects_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A001' ) ) then
return false
endif
return true
endfunction
function Trig_Mental_Effects_Func001C takes nothing returns boolean
if ( not ( udg_IntegerM < 1000 ) ) then
return false
endif
return true
endfunction
function Trig_Mental_Effects_Actions takes nothing returns nothing
local unit Caster = GetSpellAbilityUnit()
local unit Victim = GetSpellTargetUnit()
call UnitAddAbilityBJ( 'A003', Victim )
call UnitRemoveAbilityBJ( 'A003', Victim )
call SetUnitFlyHeightBJ( Victim, 250.00, 75.00 )
call EnableTrigger( gg_trg_Mental_Cancelled )
call EnableTrigger( gg_trg_Mental_Looping )
endfunction
//===========================================================================
function InitTrig_Mental_Effects takes nothing returns nothing
set gg_trg_Mental_Effects = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Mental_Effects, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Mental_Effects, Condition( function Trig_Mental_Effects_Conditions ) )
call TriggerAddAction( gg_trg_Mental_Effects, function Trig_Mental_Effects_Actions )
endfunction
JASS:
//===========================================================================
// Trigger: Mental Looping
//===========================================================================
function Trig_Mental_Looping_Actions takes nothing returns nothing
call UnitDamageTargetBJ( Caster, Victim, ( I2R(GetUnitAbilityLevelSwapped('A001', Caster)) * 12.00 ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MIND )
call AddSpecialEffectTargetUnitBJ( "origin", Victim, "Abilities\\Spells\\Undead\\DeathPact\\DeathPactTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call PauseUnitBJ( true, Victim )
endfunction
//===========================================================================
function InitTrig_Mental_Looping takes nothing returns nothing
set gg_trg_Mental_Looping = CreateTrigger( )
call DisableTrigger( gg_trg_Mental_Looping )
call TriggerRegisterTimerEventPeriodic( gg_trg_Mental_Looping, 1.00 )
call TriggerAddAction( gg_trg_Mental_Looping, function Trig_Mental_Looping_Actions )
endfunction