HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Cooldown Disappears

11-26-2004, 02:39 PM#1
oNdizZ
Code:
Psi Wave
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Psi Wave 
    Actions
        Set PsiWave_TempPoint[(Player number of (Owner of (Triggering unit)))] = (Position of (Target unit of ability being cast))
        Special Effect - Create a special effect at (Target point of ability being cast) using Abilities\Spells\Items\AIil\AIilTarget.mdl
        Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Items\AIre\AIreTarget.mdl
        Unit - Order (Triggering unit) to damage (Target unit of ability being cast) for (100.00 + ((Real((Level of Psi Wave  for (Triggering unit)))) x 50.00)) using attack type Magic and damage type Fire.
        For each (Integer A) from 1 to 8, do (Actions)
            Loop - Actions
                Set PsiWave_TempPointDmg[(((Player number of (Owner of (Triggering unit))) x 10) + (Integer A))] = (PsiWave_TempPoint[(Player number of (Owner of (Triggering unit)))] offset by (Random real number between 100.00 and 300.00) towards (Random angle) degrees)
                Special Effect - Create a special effect at PsiWave_TempPointDmg[(((Player number of (Owner of (Triggering unit))) x 10) + (Integer A))] using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
                Unit - Order (Triggering unit) to damage area in 0.20 seconds of size 200.00 at PsiWave_TempPointDmg[(((Player number of (Owner of (Triggering unit))) x 10) + (Integer A))] for (10.00 + ((Real((Level of Psi Wave  for (Triggering unit)))) x 20.00)) using attack type Magic and damage type Cold.
                Wait 0.25 seconds
        Unit - Order (Target unit of ability being cast) to damage (Triggering unit) for (50.00 + ((Real((Level of Psi Wave  for (Triggering unit)))) x 25.00)) using attack type Chaos and damage type Lightning.
        For each (Integer B) from 1 to 8, do (Actions)
            Loop - Actions
                Custom script: call RemoveLocation( udg_PsiWave_TempPointDmg[( ( GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit())) * 10 ) + GetForLoopIndexB() )] )
        Custom script: call RemoveLocation( udg_PsiWave_TempPoint[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] )

now, this trigger works except one thing, if the target unit dies before the whole trigger has been run through the cooldown on the ability will disappear, it is as if it didn't have any...

somebody knows of any way to prevent this?
11-26-2004, 02:58 PM#2
Vexorian
Use a Unit Starts the effect of an ability as event