how do you write a trigger that does something only when Divine Shield is active?
i'm trying to make an ability that's duration or toggle based like divine shield can be. i want this ability bound to a trigger that fires off an action, only when the ability is active/toggled/on. so far, i've only found that 'Unit - A unit is issued an order with no target' fires my trigger, but i might/probably will want to use this type of triggering in another way of my map with a different ability. so, i need to be able to know what is going on... not just that it's going on, because it fires when you learn the ability that way.
I didnt check this in the editor, but woulndt it go like this:
Event Unit starts casting a spell Conditions Casting spell equal to manaspell Actions Set variable "Caster" = Casting unit Turn on trigger "ThisgivesMana"
Trigger "ThisgivesMana":
Event Every 1 second of game time Conditions None Actions Add 1 mana to "Caster" mana pool
Third trigger:
Event "Caster" finishes casting a spell Condition Casted spell equal to Manaspell Actions Turn of trigger "ThisgivesMana"
Try that, i just wrote this while trying to remember some triggers, as said havent checked if it works, try it and say did it work.
Event Unit starts casting a spell Conditions Casting spell equal to manaspell Actions Set variable "Caster" = Casting unit Turn on trigger "ThisgivesMana"
no, this don't work... seems the only one i have gotten to respond is the 'single player only' warned 'hero clicked ability button', something like that... not sure of the exact name right now..
imported_Bort
#6
This is an 'air drain' trigger which i use to take air (mana) from submerged submarines. I've modified it slightly for your purposes. The unit that is regaining mana needs a spell based off 'Divine Shield' which gives them the custom buff 'ManaSpell'.
Mana Gain. Events Time - Every 1.00 seconds of game time Conditions Actions Unit Group - Pick every unit in (Units in (Playable map area) matching (((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 - Order (Picked unit) to Human Paladin - Deactivate Divine Shield Else - Actions Do nothing
That should work like diddly. . Have fun. =][= Bort
ok, so if i base this off of divine shield and use:
Unit - Order (Picked unit) to Human Paladin - Deactivate Divine Shield
how would i go about making another ability that does the same thing, but for health.
it seems i can use this:
Unit - Remove ManaSpell buff from (Picked unit)
that would work with multiple spells, i think at least... going to try it. what would be the difference between using that and using yours? are there any cons or side affects?
ok, got it working... but i made the 2nd ability based on immolation..... i need another ability to base the 2nd off of that has a Data - Can Deactivate property, so i can set that to false.