| 02-25-2004, 08:13 AM | #1 |
I have a type of hero that when it dies with a particular buff on it, its permanatly dead. To do this I have a unit variable for the hero(only one on the map) and a boolean that says wether he is vulnerable or not. I want to setup it up such that when the unit get the buff placed on him his status as vulnerable is put on. I also want this to be timed with the buff so if the buff wears off he isn't permakillable anymore. Now at first I set it up that when the unit dies if he has the buff on him then he will be permantly dead. It wasn't detecting that however, as the unit was already dead so how can I check the buffs on him.... Is that right or did I screw something up? Should I be able to check on its death? My solution is kind of crappy.. whenever the unit takes damage and is below 301 health(max single damage hit on my map) then he checks to see if its status should be changed to vulnerable. Any ideas better then this? Or once again did I screw something up with checking for the buff on the units death? |
| 02-25-2004, 08:42 AM | #2 |
Another option, have a trigger set a variable, for ex. HeroVulnerable(number_of_your_hero) = true whenever that buff is cast on the hero, and after the duration of the buff, set it back to false. Then you also need triggers that check for dispell spells and if the buff is dispelled, you again set that variable to false. In the end, when a hero dies, all you have to do is check your variable to see if you will have to destroy the hero. So, everything is done by triggers and variables and you only have the buff there to graphically show the player that he better watch out. |
| 02-25-2004, 08:45 AM | #3 |
Erhm, you're supposed to be able to sense buffs at death, atleast i'm almost sure of it. As the unit holds all information about it after death. So i don't see why it doesn't work. Ofcourse there's a chance that WC3 removes all buff when a unit dies. Alternative is just to have a periodic trigger setting his custom-value (or some variable) to something if he has the buff. 0.2 should be enough per second. Cubasis |
| 02-25-2004, 09:35 AM | #4 |
Hmm how do you detect if a buff is actually cast on a character? What event is that under? Can it be done from the targets perspective? Aka if specific unit has buff cast on it as opposed to generic event- a character begins casting a spell? One of the ways of getting the buff in my map is a weapon so not sure how that would play in if it can't be done from the targets perspective. |
| 02-26-2004, 01:23 AM | #5 |
I know checking if a unit has a buff is under conditions but thats not what I mean. To check when a unit has an abilit cast on it, what event should I use? I can't think of a way to do it from the target's persepective(aka when unit has ability cast on himself). Also I retested it defintely resets buffs on death. I had a simple trigger that detected a unit's death and the condition was if he had the buff. The actions would only run in the trigger if the condition wasn't there. |
| 02-26-2004, 01:32 AM | #6 |
Event: Generic event - unit finishes casting an ability Conditions: Boolean comparison - so-and-so unit has buff X equal to true Actions: Actions |
