| 05-05-2007, 05:21 PM | #1 |
I've been looking at this for hours now but can't seem to get it quite right. I have modified Defend so that it reduces all attacks by 6% and increases movement and attack speed by 6%. It can be activated/deactivated at will. Problem 1: it doesn't drain mana per second while active. Problem 2: it doesn't show a buff on the unit using the ability. I'm stumped as to how to address these problems. Any ideas? |
| 05-05-2007, 05:43 PM | #2 |
You'll want to trigger the ability, probably with Immolation as the base. I'll move you to the right forum for that. Remember, even though all the abilities have a lot of standard fields, it doesn't mean that any given ability actually uses any given field, and if they do it may not be the way you want them to. |
| 05-05-2007, 06:42 PM | #3 |
I would say use standard defend, with a trigger for draining mana. Every 1 seconds of game time Pick every unit in YOURUNITGROUP and do --If Then Else ----If mana of picked unit is less than 5 then do Order picked unit to dedefend Else Set mana of picked unit to mana of picked unit - 5 |
| 05-05-2007, 07:38 PM | #4 |
Problem is the unit already has an immolation ability as well! With Defend I'm not sure how to detect if Defend is active - because it doesn't give a buff. If it had a buff then I could trigger the mana drain and stop the spell if needed. What I really could do with is an event for 'unit activates spell' and 'unit deactivates spell'. |
| 05-05-2007, 08:08 PM | #5 |
In case of defend you should catch the orders since it isn't considered as a spell for events (at least it didn't work for me), so you'll have to use Trigger: JASS:call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ISSUED_ORDER ) |
| 05-05-2007, 09:51 PM | #6 |
1: Add an invisible spellbook with a no-damage-minus-mana Permanent Immolation when order issued equal to defendon. Remove when ordered to defendoff. Check every second to see how much mana triggering unit has and remove spellbook and order to defendoff. 2: To check which unit it is, you could get a dummy to cast a buff on the triggering unit that lasts forever. That way, you could (for a condition) do "Unit has buff (YOURDEFEND)". |
| 05-06-2007, 12:07 AM | #7 |
Thanks for all the help guys. This is how I have implemented it: Defend ability as dummy activate/deactivate interface. Spell book to contain two hidden passive spells: Endurance Aura (AOE=1.0) in spell book for movement speed, attack speed, buff and spell effects Spiked Carapace in spell book for damage reduction and reflecting melee damage Trigger to detect defend: add spell book and set level of Endurance Aura and Spiked Carapace to level of Defend ability. Trigger to detect undefend: remove spell book Trigger every 1 second: reduce mana if unit has endurance aura buff, order undefend if run out of mana Now I just need to find the right spell effect. I wanted to use Purge birth as the Target Art for the Endurance Aura, but that clearly isn't working. I'll go have a look see if anyone has made anything suitable... Many thanks again! PS. Note that my experiments showed that Defend's 'Damage Taken' property doesn't appear to do anything. |
