- Joined
- Apr 28, 2006
- Messages
- 187
hey folks i have a triggered power based off acid bomb that swaps a casters position with target. All has seemed fine for ages with it, but now for some reason when casted by an AI player it causes a huge lag spike, any help with this?
-
function Trig_DiabloicDisplacement_Copy_Conditions takes nothing returns boolean
-
if ( not ( GetSpellAbilityId() == 'A00N' ) ) then
-
return false
-
-
endif
-
return true
-
-
endfunction
-
function Trig_DiabloicDisplacement_Copy_Func007Func005C takes nothing returns boolean
-
if ( not ( IsUnitAliveBJ(udg_Spell_DisplaceCaster) == true ) ) then
-
return false
-
-
endif
-
if ( not ( IsUnitAliveBJ(udg_Spell_DisplaceTarget) == true ) ) then
-
return false
-
-
endif
-
return true
-
-
endfunction
-
function Trig_DiabloicDisplacement_Copy_Func007C takes nothing returns boolean
-
if ( not Trig_DiabloicDisplacement_Copy_Func007Func005C() ) then
-
return false
-
-
endif
-
return true
-
-
endfunction
-
function Trig_DiabloicDisplacement_Copy_Func009Func003C takes nothing returns boolean
-
if ( not ( IsUnitAliveBJ(udg_Spell_DisplaceCaster) == true ) ) then
-
return false
-
-
endif
-
if ( not ( IsUnitAliveBJ(udg_Spell_DisplaceTarget) == true ) ) then
-
return false
-
-
endif
-
return true
-
-
endfunction
-
function Trig_DiabloicDisplacement_Copy_Func009C takes nothing returns boolean
-
if ( not Trig_DiabloicDisplacement_Copy_Func009Func003C() ) then
-
return false
-
-
endif
-
return true
-
-
endfunction
-
function Trig_DiabloicDisplacement_Copy_Actions takes nothing returns nothing
-
set udg_Spell_DisplaceCaster = GetTriggerUnit()
-
set udg_Spell_DisplaceTarget = GetSpellTargetUnit()
-
set udg_Spell_DisplacePoint = GetUnitLoc(udg_Spell_DisplaceCaster)
-
set udg_Spell_DisplaceTargetPoint = GetUnitLoc(udg_Spell_DisplaceTarget)
-
set udg_Spell_DisplacementAngle = AngleBetweenPoints(udg_Spell_DisplacePoint, udg_Spell_DisplaceTargetPoint)
-
call PolledWait( 0.50 )
-
if ( Trig_DiabloicDisplacement_Copy_Func007C() ) then
-
call AddSpecialEffectLocBJ( udg_Spell_DisplacePoint, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
-
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
-
call AddSpecialEffectLocBJ( udg_Spell_DisplaceTargetPoint, "Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl" )
-
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
-
-
else
-
endif
-
call PolledWait( 0.10 )
-
if ( Trig_DiabloicDisplacement_Copy_Func009C() ) then
-
call SetUnitPositionLocFacingBJ( udg_Spell_DisplaceCaster, udg_Spell_DisplaceTargetPoint, ( udg_Spell_DisplacementAngle - 180.00 ) )
-
call SetUnitPositionLocFacingBJ( udg_Spell_DisplaceTarget, udg_Spell_DisplacePoint, udg_Spell_DisplacementAngle )
-
-
else
-
endif
-
call RemoveLocation( udg_Spell_DisplacePoint )
-
call RemoveLocation( udg_Spell_DisplaceTargetPoint )
-
-
endfunction
-
//===========================================================================
-
function InitTrig_DiabloicDisplacement_Copy takes nothing returns nothing
-
set gg_trg_DiabloicDisplacement_Copy = CreateTrigger( )
-
call TriggerRegisterAnyUnitEventBJ( gg_trg_DiabloicDisplacement_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
-
call TriggerAddCondition( gg_trg_DiabloicDisplacement_Copy, Condition( function Trig_DiabloicDisplacement_Copy_Conditions ) )
-
call TriggerAddAction( gg_trg_DiabloicDisplacement_Copy, function Trig_DiabloicDisplacement_Copy_Actions )
-
-
endfunction