Hi, i've got a problem with a triggers and timers created effects.
The trigger is a custom spell based on abitily: ANcl. It simply creates a signal-effect and a chaos-comet effect, starts a non-periodic timer for 3 secs. After that, the comet hits and another effect is created and damage is dealt.
Here the JASS:
Now, the problem is that some of the created effects won't display! The ChaosCometIndicator-Effect:
works, and the others won't show up...
I have to mention, that it worked! I'm using newgen and just switched my wc3 to 1.26a.
Does anybod has an idea, what caused the error??? i'm totaly confused...
The trigger is a custom spell based on abitily: ANcl. It simply creates a signal-effect and a chaos-comet effect, starts a non-periodic timer for 3 secs. After that, the comet hits and another effect is created and damage is dealt.
Here the JASS:
JASS:
function Trig_ChaosComet_IsEnemy takes nothing returns boolean
return (( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_ChaosCometCaster)) == true ) )
endfunction
function Trig_ChaosComet_Damage takes nothing returns nothing
local integer level = GetUnitAbilityLevelSwapped('A0DJ', udg_ChaosCometCaster)
local real damage = (level * 75.00)
call UnitDamageTargetBJ( udg_ChaosCometCaster, GetEnumUnit(), damage, ATTACK_TYPE_HERO, DAMAGE_TYPE_UNIVERSAL )
call AddSpecialEffectTargetUnitBJ( "chest", GetEnumUnit(), "Abilities\\Spells\\Other\\FrostDamage\\FrostDamage.mdl" )
call DestroyEffect( bj_lastCreatedEffect )
endfunction
function Trig_ChaosComet_Wait takes nothing returns nothing
local timer t = GetExpiredTimer()
local group damageGroup
local effect tempEffect
set damageGroup = GetUnitsInRangeOfLocMatching( 200, udg_ChaosCometTarget, Condition(function Trig_ChaosComet_IsEnemy) )
call ForGroup(damageGroup, function Trig_ChaosComet_Damage)
set tempEffect = AddSpecialEffectLoc( "Units\\NightElf\\Wisp\\WispExplode.mdl", udg_ChaosCometTarget )
call DestroyEffect( tempEffect )
set tempEffect = AddSpecialEffectLoc( "Objects\\Spawnmodels\\NightElf\\NEDeathMedium\\NEDeath.mdl", udg_ChaosCometTarget )
call DestroyEffect( tempEffect )
set tempEffect = null
call DestroyEffect(udg_ChaosCometIndicator)
set udg_ChaosCometIndicator = null
set udg_ChaosCometCaster = null
call RemoveLocation(udg_ChaosCometTarget)
set udg_ChaosCometTarget = null
call DestroyGroup(damageGroup)
set damageGroup = null
call PauseTimer(t)
call DestroyTimer(t)
set t = null
endfunction
function Trig_ChaosComet_Actions takes nothing returns nothing
local timer t = CreateTimer()
local effect tempEffect
set udg_ChaosCometCaster = GetTriggerUnit()
set udg_ChaosCometTarget = GetSpellTargetLoc()
set tempEffect = AddSpecialEffectLoc( "Objects\\Spawnmodels\\Demon\\InfernalMeteor\\InfernalMeteor3.mdl", udg_ChaosCometTarget )
call DestroyEffect( tempEffect )
set tempEffect = null
set udg_ChaosCometIndicator = AddSpecialEffectLoc( "Abilities\\Spells\\Other\\Drain\\ManaDrainTarget.mdl", udg_ChaosCometTarget )
call TimerStart(t, 2.7, false, function Trig_ChaosComet_Wait)
set t = null
endfunction
function Trig_ChaosComet_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0DJ' ) ) then
return false
endif
return true
endfunction
//===========================================================================
function InitTrig_ChaosComet takes nothing returns nothing
set gg_trg_ChaosComet = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_ChaosComet, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_ChaosComet, Condition( function Trig_ChaosComet_Conditions ) )
call TriggerAddAction( gg_trg_ChaosComet, function Trig_ChaosComet_Actions )
endfunction
Now, the problem is that some of the created effects won't display! The ChaosCometIndicator-Effect:
JASS:
set udg_ChaosCometIndicator = AddSpecialEffectLoc( "Abilities\\Spells\\Other\\Drain\\ManaDrainTarget.mdl", udg_ChaosCometTarget )
I have to mention, that it worked! I'm using newgen and just switched my wc3 to 1.26a.
Does anybod has an idea, what caused the error??? i'm totaly confused...