- Joined
- Sep 28, 2004
- Messages
- 365
I made the below spell. It is a spell that moves the unit instantly to the back of targeted enemy unit and do damage. I base this spell on chain lightning. The problem now is weird.
Problem:
Cooldown is not triggered (I set the cooldown to 10seconds).
Mana is used << Note, Mana is used.
If mana is used, that means it has already started the effect of the spell. But why didn't it trigger the cooldown?
Here is my code. I am very sure i have the cooldown set to 10. Because if i remove the move unit instantly. It will trigger the cooldown. Is there anyway to solve this?
Problem:
Cooldown is not triggered (I set the cooldown to 10seconds).
Mana is used << Note, Mana is used.
If mana is used, that means it has already started the effect of the spell. But why didn't it trigger the cooldown?
Here is my code. I am very sure i have the cooldown set to 10. Because if i remove the move unit instantly. It will trigger the cooldown. Is there anyway to solve this?
-
Ambush
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Ambush (Scout)
-
Actions
- Set ambush_critChance = 30
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 100) Less than or equal to ambush_critChance
-
Then - Actions
- Set ambush_Bonus = 2
-
Else - Actions
- Set ambush_Bonus = 1
-
If - Conditions
- Set ambush_VictimPos = (Position of (Target unit of ability being cast))
- Set ambush_Pos = (ambush_VictimPos offset by -100.00 towards (Facing of (Target unit of ability being cast)) degrees)
- Set ambush_dmg = (((Agility of (Triggering unit) (Exclude bonuses)) x 10) x ambush_Bonus)
- Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Real(ambush_dmg)) damage of attack type Chaos and damage type Universal
- Animation - Play (Triggering unit)'s attack animation
- Animation - Queue (Triggering unit)'s stand animation
- Special Effect - Create a special effect attached to the chest of (Target unit of ability being cast) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
- Special Effect - Destroy (Last created special effect)
- Unit - Move (Triggering unit) instantly to ambush_Pos, facing (Facing of (Target unit of ability being cast)) degrees
- Special Effect - Create a special effect attached to the chest of (Triggering unit) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
- Special Effect - Destroy (Last created special effect)
- -------- Dmg Text --------
- Floating Text - Create floating text that reads (((Name of (Ability being cast)) + (: + (String(ambush_dmg)))) + !) at ambush_VictimPos with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
- Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
- Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
- -------- Clear Leaks --------
- Custom script: call RemoveLocation(udg_ambush_Pos)
- Custom script: call RemoveLocation(udg_ambush_VictimPos)
-
Events