Warcraft III resources & community, 2003–2006 · archived

Codition Help!

9 posts
#1

Codition Help!

is there a condition like this?:
if a unit dies with specific buff

or something that would work the same way, plz tell me!
#2
Event: A unit dies
Condition: Dying Unit has specific buff (Boolean, I believe)

Wouldn't that work?
#3
nope, for some reason it doesn't work.
#4
Yes there is but it will be risky. First of all, you have to know that dead units don't have buffs. Conclusion, you can't search for buffs once they are dead, only when they are attacked. Check everytime an unit is attacked, and it has your buff. Wait 1 second, check if the unit is dead and then do whatever you want to do. This is a bit risky because the buff might remove in that 1 second. But its the only method I could think of right now. If you don't use JASS atleast.

~Daelin
#5
how do you "check" if a unit is attacked or is dead?
#6
Use the event unit is attacked, then wait 1 second.

I have an idea that can supplement the idea Daelin is using right now, but it'd take a variable and 2 triggers.

First, after casting the buff, run a timer. Make sure the timer is 1(or slightly more) second less than the duration of the buff.

Once the timer runs out, disable the trigger Daelin suggested. Then, you can't run out of time and still use the buff ;P
#7
Well, that's the whole point. You can do it like this:

Have a trigger which activates when the target is affected by the spell, and of course, deactivate it when the buff disappears. Now, the trigger's event is "An Unit Dies" and "Dying Unit" is equal to Target (variable which stores the "Target Unit of Ability Being Cast"). That's Telefragged idea in a nicer way and of course, it would be fully implementable in JASS. Why don't you try my JASS tutorial?

~Daelin
#8
I dont get it. I must be stupid! xD[/i]
#9
Look out you could get caught for flaming yourself! Seriously though, depending on what you want it to do you could use doom, unit spawns a unit, spawned unit equal to <a dummy unit>, then do actions. Easy. Just remember to remove the dummy unit! JASS is not the only way. :wink: