HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Event spell question

07-25-2004, 11:56 AM#1
Arkmage
Hi,

Is there an event that tells me when a Unit's has lost the effect of a spell?

I.e. when slow/curse/silence is wearing off?

If there isn't, is there a way to tell if the unit is normal?

Cheers
Archmage
07-25-2004, 12:08 PM#2
SpadeZ
It just depends on the duration the effect lasts. Say if you needed to make the unit invunerable after the effect wears off then its just a matter of how long the effect lasts. If the effect lasts for 10 seconds then the trigger would look like this.
e.g.
Code:
    [b]Events[/b]
        Unit - A unit Finishes casting an ability
    [b]Conditions[/b]
        (Ability being cast) Equal to Slow
    [b]Actions[/b]
        Wait 10.00 seconds
        Unit - Make (Target unit of ability being cast) Invulnerable

I dont know any way other than this. Perhaps its possible through jass, but less likely through UI
Hope this helps.
07-25-2004, 04:42 PM#3
Milkman
Unfortunately Blizzard did not add the Event - Unit loses Buff.
There are ways arounds this, via JASS using locals and a specific trigger for each spell, but that's a pain, still doable.
07-25-2004, 05:02 PM#4
Anitarf
You can do an approximate detection method with a periodic trigger. First, whenever a spell like curse is cast, add the target unit of ability being cast to a unit group variable. Then, make a periodic trigger that runs a few times per second and checks all units in the unit group for the buff; the units that don't have the buff have just lost it, because otherwise they wouldn't have the buff already last time the trigger checked (unit - pick every unit in unit group and do actions : if picked unit has buff curse then do nothing else remove the unit from unit group and add your effects to it).
07-25-2004, 05:23 PM#5
Milkman
I was going to say that and then i realized it wouldn't be muliinstanceable and thus, quite worthless.
07-25-2004, 06:48 PM#6
Anitarf
what do you mean, not multi instanceable? That's why I'm using a unit group variable instead of a unit variable; so I can add as many units as I want to it; the spell can be cast any number of times, and this method will detect for all of them when the buff runs out (keep in mind that the buff can run out because it's timer runs out, it is dispelled, or if the unit dies; if you don't want to get effects on all three occasions, you may need additional conditions in the periodic trigger). The method is fully multi instanceable.
07-25-2004, 07:15 PM#7
Milkman
Sorry, my misstake, when i was posting my first post i was going to post your solution, only i used a unit variable and then it hit me it wouldnd't work. So when i saw that you suggested basically the same thing i didn't look that deep into it.
The method you gave him will work and once again, I'm sorry.
07-25-2004, 07:28 PM#8
Anitarf
Hey, it's ok, no need to say sorry so many times. :)
I'm glad things got cleared out, because untill they do, you can never be comepletely sure that you're not the one who's wrong. :)
07-25-2004, 07:34 PM#9
Milkman
It's better to say sorry, it wont cost me nothing being humble is never something bad. When you can be nice, why not be it? It's harder IRL so some practice is always welcome =)
07-26-2004, 04:15 AM#10
Arkmage
The event "Unit - A unit Finishes casting an ability" does not work, tried it. The reason is that i can't get the targeted unit of spell. It keeps on giving me a null vaule for targeted unit.

Rather i had to use "Unit - A unit starts the effects of an abilty" so i can get the targeted unit to work. Thus i have two triggers that run at the same time when the spell is casted. One trigger runs, while the second trigger waits 10 seconds to then runs (to reverse the the stuff trigger 1 did).

Blizzard should really add a "Event - Unit loses Buff". Even though i doing the spell in JASS, i would like this part done already so i can just convert it to Custom Text/JASS. Actually might post on the blizzard fourms to as them for the next update to have this event.

Well since the spell is done, i might as well look at the other methods that you guys described above.

Cheers
Archmage