• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Cooldown Bug

Status
Not open for further replies.
Level 12
Joined
Aug 12, 2008
Messages
349
This spell is Aqua Burst by -Berz-
I decided to use it for a hero in map. However, the trigger seems to be problematic after I alter it a bit. I search for ups and downs and yet I can't find out why did the cooldown for only Aqua Burst spell reset after casting. The other spells did not reset. At first, I thought I forgot to put the cooldown but somehow after I disabled the following trigger, the cooldown works (did not reset).
Here goes the trigger:
[trigger=Aqua Burst]

Aqua Burst
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Aqua Burst
Actions
Set AB_caster = (Triggering unit)
Set tempPoint = (Target point of ability being cast)
Set AB_level = (Level of (Ability being cast) for AB_caster)
Set AB_AoE = (185.00 + (15.00 x (Real(AB_level))))
Set AB_damage = (50.00 + (50.00 x (Real(AB_level))))
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units within AB_AoE of tempPoint matching (((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and (((Matching unit) is Magic Immune) Equal to False))) and ((((Matching unit) is alive) Equal to True) and ( and do (Actions)
Loop - Actions
Set tempPoint2 = (Position of (Picked unit))
Unit - Cause AB_caster to damage (Picked unit), dealing AB_damage damage of attack type Spells and damage type Normal
Special Effect - Create a special effect at tempPoint2 using Abilities\Spells\Other\CrushingWave\CrushingWaveDamage.mdl
Special Effect - Destroy (Last created special effect)
Unit - Move AB_caster instantly to tempPoint
Special Effect - Create a special effect attached to the origin of AB_caster using Objects\Spawnmodels\Naga\NagaDeath\NagaDeath.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation (udg_tempPoint)
Custom script: call RemoveLocation (udg_tempPoint2)
[/trigger]


EDIT: All fixed just by adding Pause the unit and Unpause unit before and after the "Unit - Move AB_caster instantly to tempPoint" though I don't why. Here are the new triggers that works:
[trigger=Aqua Burst]Aqua Burst
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Aqua Burst
Actions
Set tempUnit = (Triggering unit)
Set tempPoint = (Target point of ability being cast)
Set AB_level = (Level of (Ability being cast) for tempUnit)
Set AB_AoE = (185.00 + (15.00 x (Real(AB_level))))
Set AB_damage = (50.00 + (50.00 x (Real(AB_level))))
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units within AB_AoE of tempPoint matching (((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and (((Matching unit) is Magic Immune) Equal to False))) and ((((Matching unit) is alive) Equal to True) and ( and do (Actions)
Loop - Actions
Set tempPoint2 = (Position of (Picked unit))
Unit - Cause tempUnit to damage (Picked unit), dealing AB_damage damage of attack type Spells and damage type Normal
Special Effect - Create a special effect at tempPoint2 using Abilities\Spells\Other\CrushingWave\CrushingWaveDamage.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation (udg_tempPoint2)
Unit - Pause tempUnit
Unit - Move tempUnit instantly to tempPoint
Unit - Unpause tempUnit
Animation - Play tempUnit's birth animation
Special Effect - Create a special effect attached to the origin of tempUnit using Objects\Spawnmodels\Naga\NagaDeath\NagaDeath.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation (udg_tempPoint)

[/trigger]
 
Last edited:
Level 11
Joined
Nov 15, 2007
Messages
781
Moving the unit instantly was probably interrupting the cast; even though it had already started the effect I guess it still canceled the cast while causing the effect to happen.

That ability leaks by the way. You need to remove tempPoint2 at the end of the unit group loop rather than the end of the trigger itself.
 
Level 10
Joined
Oct 5, 2008
Messages
355
I think it is this way, because a knockback trigger most of the time works with a timer. A timer does not fire directly when the effect of the spell is executed, so it does not interrupt the order when the spell is executed and with this it does not bug with the cooldown. You can use SetUnitX and SetUnitY to move a unit without interrupting the cast and with this without resetting the cooldown.
 
Status
Not open for further replies.
Top