i'm trying to make an ability that can be turned on and off like Divine Shield can. I want the ability to give 1 mana per second to the user while the ability is activated.
I have tried basing a new custom ability off of divine shield, but i am unable to properly bind a trigger to it and distinguish the difference when i am using this method to accomplish several things. for instance, one ability of the hero which gives 1 mana per second.. then a whole different one that gives 1 health per second.. ie. i want to be able to use this method many times.
So, you wanna make a toggleable spell? well, in order to acquire it, you must compare the order string.
Event: Unit ordered with no target Condition : Oredered string equal to "divineshieldon" Action: bla..bla..bla..
Since it compare the order string, you must create another spell based on another toggleable ability (not divine shield).
In this case, if you wanna make mana-gain spell and health-gain spell, you must make those abilities based on different toggleable spell (e.g immolation and mana shield)
ps: instead of divine shield, you should make it based on mana shield, since divine shield cannot be deactivated, i guess <without gameplay constant changes>.
In general, Leopard is right. However, I'd want to fix some stuff as well, such as the EXACT code, since you might not know. Ok, you will need two triggers, a toggable ability (dummy ability, read the FAQ to find out more), preferrable Mana Shield, an item ability which increases mana regeneration rate by 1 (search for it under Neutral Passive -> Items) and lots of patience.
Now, let's say that your dummy ability is called ManaMana and the other one is called ManaInc. And here are the triggers you will need:
Trigger 1 Event - An Unit is issued an order with no target Condition - Issued Order equal to "manashieldon" Action - Add ManaInc to (Ordered Unit)
Trigger 2 Event - An Unit is issued an order with no target Condition - Issued order equal to "manashieldoff" Actions - Remove ManaInc from (Ordered Unit)
That should do it, hopefully. Any other questions? Post here.
ManaSpell Trigger
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area)(((Matching unit) has buff ManaSpell ) Equal to True)) and do (Actions)
Loop - Actions
Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + 1.00)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Mana of (Picked unit)) Equal to (Max mana of (Picked unit))
Then - Actions
Unit - Remove ManaSpell buff from (Picked unit)
Else - Actions
Do nothing
this is what i've got now... based it off Divine Shield and added a custom buff (ManaSpell). i like how this works... graphically and all... problem is, i need another ability just like this one that responds to a different trigger. so, i'm thinking i need another ability that has the Data - Can Deactivate property and i can set that to false.
I think Wind Walk still has this property of deactivation but I'm not sure. I think all such abilities were made so you cannot deactive them. But I don't understand why you would want the unit to deactivate the ability if it wants. After all, who would want to get rid of mana bonus? You could base your ability off Berserk cuz if you based it off Divine Shield the unit might get invulnerable as well.