• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Some issues with checking buffs on dead units

Status
Not open for further replies.
Level 2
Joined
Apr 20, 2006
Messages
22
Asking for help.. again, as usual. Ok so, I was thinking of a spell, which just adds a buff to a unit. If that unit dies, it will explode with a nova like animation (yes the nova is pure animation), and do some base damage + damage based of a % of it's max hit points.

Code:
NightmareFear Explosion Animation
    Events
        Unit - A unit Dies
    Conditions
        Or - Any (Conditions) are true
            Conditions
                ((Dying unit) has buff Fear (level 1)) Equal to True
                ((Dying unit) has buff Fear (level 2)) Equal to True
                ((Dying unit) has buff Fear (level 3)) Equal to True
                ((Dying unit) has buff Fear (level 4)) Equal to True
                ((Dying unit) has buff Fear (level 5)) Equal to True
    Actions
        For each (Integer A) from 1 to 9, do (Actions)
            Loop - Actions
                Unit - Create 1 Casting Dummy for (Owner of Nightmare) at (Position of (Dying unit)) facing Default building facing degrees
                Unit - Remove Nova Missiles  from (Last created unit)
                Unit - Add Fear Explosion  to (Last created unit)
                Unit - Hide (Last created unit)
                Unit - Add a 0.70 second Generic expiration timer to (Last created unit)
                Unit - Order (Last created unit) to Neutral - Breath Of Frost ((Position of (Dying unit)) offset by 100.00 towards NovaRotationTargetVar degrees)
                Set NovaRotationTargetVar = (NovaRotationTargetVar + 40.00)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Dying unit) has buff Fear (level 1)) Equal to True
            Then - Actions
                Unit Group - Pick every unit in (Units within 250.00 of (Position of (Dying unit)) matching ((Owner of (Matching unit)) Equal to Player 12 (Brown))) and do (Actions)
                    Loop - Actions
                        Unit - Cause Nightmare to damage (Picked unit), dealing (100.00 + ((Max life of (Dying unit)) / 50.00)) damage of attack type Spells and damage type Normal
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Dying unit) has buff Fear (level 2)) Equal to True
            Then - Actions
                Unit Group - Pick every unit in (Units within 250.00 of (Position of (Dying unit)) matching ((Owner of (Matching unit)) Equal to Player 12 (Brown))) and do (Actions)
                    Loop - Actions
                        Unit - Cause Nightmare to damage (Picked unit), dealing (150.00 + ((Max life of (Dying unit)) / 25.00)) damage of attack type Spells and damage type Normal
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Dying unit) has buff Fear (level 3)) Equal to True
            Then - Actions
                Unit Group - Pick every unit in (Units within 250.00 of (Position of (Dying unit)) matching ((Owner of (Matching unit)) Equal to Player 12 (Brown))) and do (Actions)
                    Loop - Actions
                        Unit - Cause Nightmare to damage (Picked unit), dealing (200.00 + ((Max life of (Dying unit)) / 16.66)) damage of attack type Spells and damage type Normal
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Dying unit) has buff Fear (level 4)) Equal to True
            Then - Actions
                Unit Group - Pick every unit in (Units within 250.00 of (Position of (Dying unit)) matching ((Owner of (Matching unit)) Equal to Player 12 (Brown))) and do (Actions)
                    Loop - Actions
                        Unit - Cause Nightmare to damage (Picked unit), dealing (250.00 + ((Max life of (Dying unit)) / 12.50)) damage of attack type Spells and damage type Normal
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Dying unit) has buff Fear (level 5)) Equal to True
            Then - Actions
                Unit Group - Pick every unit in (Units within 250.00 of (Position of (Dying unit)) matching ((Owner of (Matching unit)) Equal to Player 12 (Brown))) and do (Actions)
                    Loop - Actions
                        Unit - Cause Nightmare to damage (Picked unit), dealing (300.00 + ((Max life of (Dying unit)) / 10.00)) damage of attack type Spells and damage type Normal
            Else - Actions
                Do nothing

Thats about it, and ofcourse, it does nothing when the unit with the fear buff dies, because nothing I create ever works lol. I came to the obvious conclusion that dead units don't have buffs, which causes my trigger to get stuck somewhere... I think.

P.S.: The search function is so rigged. Half of the topics is called "need help with my spell" or something in that direction, and all that just leads to things I don't need :s .
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
allright.....

Or - Any (Conditions) are true
Conditions
((Dying unit) has buff Fear (level 1)) Equal to True
((Dying unit) has buff Fear (level 2)) Equal to True
((Dying unit) has buff Fear (level 3)) Equal to True
((Dying unit) has buff Fear (level 4)) Equal to True
((Dying unit) has buff Fear (level 5)) Equal to True

should be

Triggering Unit has Buff Fear equal to true - you dont need 5 buffs...

next, find every Dying Unit, and replace it with Triggering Unit.

your actual problem is this - if you hide a unit, it is not on the map, and cannot do anything.

instead, give the unit a model of .mdl, and the ability locust.
 
Status
Not open for further replies.
Top