| 07-25-2004, 04:19 PM | #1 |
1st Question: How can I make a spell like immolation or mana shield to -When it is activated it give an ability (Like critical Strike) -Remove the ability from it when desactivated -(This is the part I dont know how to do it) If the ability stop because he dont have enought mana, remove the ability. 2nd Question: How can I dectect that a units has a specific buff on him then do action Thx for help in advance |
| 07-25-2004, 05:14 PM | #2 |
2nd question first: There is no event that would say "unit gains buff/unit looses buff", but most spells add the event the moment they are cast (event - unit starts the effect of an ability). If the spell doesn't have a target (such as howl of terror), you can still get the units affected by checking, when the spell is cast, all units in an area around the caster that have the buff (condition: boolean comparison - unit - unit has specific buff). As far as the first question goes, the DH gets a buff when he activates immolation: you can use that buff to detect when immolation is turned off due to lack of mana. as I said, there is no "unit looses a buff" event, but you can get a close approximation of the moment when the mana runs out, by using a periodic trigger that runs a few times per second and checks if your unit still has the buff your custom immolation uses. When it doesn't, you know it is time to remove the critical strike (at the same time, you can turn off the periodic trigger, and turn it back on when immolation is again activated.) |
