HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

WoW Charge Spell - Cooldown not working

01-26-2006, 10:30 PM#1
Kul'thran
Okay, in Blizzard's Extreme Candy Wars 2006, they had WoW-like heroes to choose from. I've been trying to make a WC3 version of charge for my warrior and I copied blizzard's stuff:

Trigger:
Warrior Charge Action
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Intercept (Triggers)
Collapse Actions
Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Human\Invisibility\InvisibilityTarget.mdl
Set SpecialFX = (Last created special effect)
Trigger - Run Special Effect Destruction <gen> (ignoring conditions)
Sound - Play WarriorHeroricLeap <gen> at 100.00% volume, located at (Position of (Triggering unit)) with Z offset 1500.00
Set Stored_Unit[(Player number of (Owner of (Triggering unit)))] = (Target unit of ability being cast)
Wait 0.15 game-time seconds
Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Real(((Level of Intercept (Triggers) for (Triggering unit)) x 30))) damage of attack type Hero and damage type Normal

Trigger:
Warrior Charge Teleport
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Intercept (Triggers)
Collapse Actions
Set TempReal = (Angle from (Position of (Triggering unit)) to (Position of (Target unit of ability being cast)))
Set TempReal = (TempReal + 180.00)
Unit - Order Dummy Caster (Frost Armor, Combo, Charge Stun) 0042 <gen> to Neutral - Firebolt (Target unit of ability being cast)
Set TempPoint = (Position of (Target unit of ability being cast))
Unit - Move (Triggering unit) instantly to (TempPoint offset by 100.00 towards TempReal degrees), facing TempPoint
Custom script: call RemoveLocation( udg_TempPoint )
Unit - Order Player_Unit_Heroes[(Player number of (Owner of (Triggering unit)))] to Attack Stored_Unit[(Player number of (Owner of (Triggering unit)))]

Intercept requires 25 mana to use, however. My version, charge is free, it also deals 0 damage and only stuns for 1 second(as opposed to the dummy unit casting the stun for intercept that is 3 seconds).

Intercept, in Blizzard's map, has a cooldown of 20 seconds and it works. I copied the triggers almost word for word, replacing them with my own abilities:

Trigger:
Warrior Charge Action
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Charge (Test)
Collapse Actions
Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Human\Invisibility\InvisibilityTarget.mdl
Set SpecialFX = (Last created special effect)
Trigger - Run Special Effect Destruction <gen> (ignoring conditions)
Sound - Play WarriorHeroricLeap <gen> at 100.00% volume, located at (Position of (Triggering unit)) with Z offset 1500.00
Set Stored_Unit[(Player number of (Owner of (Triggering unit)))] = (Target unit of ability being cast)
Wait 0.15 game-time seconds
Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Real(((Level of Charge (Test) for (Triggering unit)) x 1))) damage of attack type Hero and damage type Normal

Trigger:
Warrior Charge Teleport
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Charge (Test)
Collapse Actions
Set TempReal = (Angle from (Position of (Triggering unit)) to (Position of (Target unit of ability being cast)))
Set TempReal = (TempReal + 180.00)
Unit - Order Dummy Caster (Charge Stun) 0054 <gen> to Neutral - Firebolt (Target unit of ability being cast)
Set TempPoint = (Position of (Target unit of ability being cast))
Unit - Move (Triggering unit) instantly to (TempPoint offset by 100.00 towards TempReal degrees), facing TempPoint
Custom script: call RemoveLocation( udg_TempPoint )
Unit - Order Player_Unit_Heroes[(Player number of (Owner of (Triggering unit)))] to Attack Stored_Unit[(Player number of (Owner of (Triggering unit)))]

Everything works fine, the charge, the stun, but the cooldown, which is 15 seconds on my version of Charge does not work. :/ I tried using Firebolt as a base like Blizz did with Intercept and it still didn't work.

Also, I'm thinking there is an easier way to do this, regardless, how do I get the cooldown to activate?
01-26-2006, 10:42 PM#2
Vexorian
I guess you are storing the unit in array in the first trigger for a reason? any periodic trigger that uses Stored_Unit?
01-26-2006, 10:59 PM#3
Kul'thran
Well... I looked in the Extreme Candy Wars and the Stored Unit variable was only used in the Warrior triggers. :X

Perhaps there is an easier way to write a spell like this?

Okay, I even copied intercept in from the map. The cooldown doesn't work on mine, but it works on Blizzard's.

>_<

Edit: HO HO! I fixed it!

Change this:
Trigger:
Warrior Charge Teleport
Actions
Unit - Order Player_Unit_Heroes[(Player number of (Owner of (Triggering unit)))] to Attack Stored_Unit[(Player number of (Owner of (Triggering unit)))]

to this:
Trigger:
Actions
Unit - Order (Casting unit) to Attack Stored_Unit[(Player number of (Owner of (Triggering unit)))]

The cooldown works after that.

Well, the map was made for multiplayer(extreme candy wars), mine wasn't and didn't use that variable.

Thanks for the help. :)