• 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.

AOE % damage on death

Status
Not open for further replies.
Level 5
Joined
Apr 22, 2008
Messages
139
im trying to make a corpse explosion spell where the summoned dummies deal 6% damage to everything in an area on death. any ideas how?
 
Level 5
Joined
Apr 22, 2008
Messages
139
6% of the affected units health like Death and Decay
im basing the spell off one i found online and it summons dummies from corpses then destroys them to deal damage, kinda like goblin land mine
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
I doubt the destroyed dummies deal the damage.
Make a Dummy spell from something with AoE targeting or point targeting.
Make a trigger with A Unit Begins the Effect of a Spell
Condition Casted spell is equal to Your spell
And then depending on whether you want it to destroy all corpses, some of them or just one, make a group set it to all units in range of the targeted point or in the targeted area.
Pick every unit in the group and do multiple actions.
You need to create an effect like an explosion with dummies for each blown corpse.
Make an action Unit Damage area
pick every unit in the area and do multiple actions
Make the caster to damage the targeted area or area around the targeted point, or the blown corpse. The damage should be a function the 6% of targets max health.
Remove the corpse.

I am sorry I have no time to make the trigger. Be sure to abuse the local variables bug(make globals and then declare locals with the same name(with udg_ at the begging).

P.s. Aaah Ahmed the dead terrorist. JIngle Bombs
 
Level 4
Joined
Jul 23, 2007
Messages
129
Try this:

  • Events:
  • Unit - A unit begins the effect of an ability
  • Conditions:
  • Ability being cast equal to Corpse Explosion Spell
  • Actions:
  • Unit Group - Pick every unit (within 300 of(target point of ability being cast)) matching condition (Matching unit is dead equal to true) and do actions:
    • Actions:
      • Special Effect - Create (explosion effect) at position of (picked unit)
      • Unit Group - Pick every unit (within 100 of(picked unit) matching condition (matching unit belongs to an enemy of (owner of(casting unit) and do actions:
      • Actions:
        • Unit - Cause (casting unit) to deal (life of(picked unit) x .06) damage to (picked unit) of attack type (spells) and damage type (spirit-link).
      • Unit - Remove (picked unit) from the game
Using spirit-link as the damage type will make sure that the damage is exactly 6% of the target's max hp (meaning it is not reduced by armor/spell resistance).

EDIT: I changed the above trigger because I was having it do static damage, not % damage. Sorry about that.

This should cause the corpses to explode, reducing the life of nearby enemy units by 6% of their maximum hp.

EDIT 2: I have noticed like 5 different mistakes I made over the past 30 minutes. If you read this post within the past 30 mins or so, you may need to re-read it. Sorry again.
 
Last edited:
Level 4
Joined
Jul 23, 2007
Messages
129
Mostly. You didn't say anyting about removing the units so that you can't blow the corpse up multiple times. Also, you told him to pick all units in the area, not to pick all units matching condition that the picked units are dead (which means living units would be blowing up). This is not necessarily obvious, since not everyone knows that the "pick every unit in region" can be used to pick dead units.

Also, you didn't tell him to use spirit-link damage so that the damage wouldn't be reduced by armor.

Plus, I actually took the time to write out the trigger. :p
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Remove the corpse.
Reread.
Or not.
But for the other stuff you are right.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Yeap.
This should work better.
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Corpse Explosion
    • Actions
      • Custom script: local unit udg_temp_unit
      • Custom script: local group udg_temp_group
      • Custom script: local group udg_temp_group2
      • Custom script: local integer udg_index
      • For each (Integer index) from 0 to 2, do (Actions)
        • Loop - Actions
          • Set index = 0
          • Set temp_group = (Units within 400.00 of (Target point of ability being cast) matching (((Matching unit) is dead) Equal to True))
          • Set temp_unit = (Random unit from temp_group)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • temp_unit Equal to No unit
            • Then - Actions
              • Set index = 2
            • Else - Actions
              • Special Effect - Create a special effect attached to the origin of temp_unit using SOME_SPECIAL_EFFECT
              • Set temp_group2 = (Units within 150.00 of (Position of temp_unit) matching ((((Triggering unit) is alive) Equal to True) and (((Triggering unit) has buff Liquid Fire) Equal to False)))
              • Unit Group - Pick every unit in temp_group2 and do (Actions)
                • Loop - Actions
                  • Unit - Cause (Casting unit) to damage (Picked unit), dealing ((Max life of (Picked unit)) x 0.06) damage of attack type Chaos and damage type Spirit Link
              • Special Effect - Destroy (Last created special effect)
              • Unit - Remove temp_unit from the game
              • Wait 0.10 seconds
      • set udg_temp_unit = null
      • set udg_temp_group = null
      • set udg_temp_group2 = null
Of course those variables have to be declared as globals.
Whether you wish that the spell will make all the corpses in the area explode(that means if new corpses appear after a unit casts the ability they will explode too) or you want to make only the corpses that are in the area when you cast the spell you should just move the action
  • Set temp_group = (Units within 400.00 of (Target point of ability being cast) matching (((Matching unit) is dead) Equal to True))
before the first loop
 
Level 4
Joined
Jul 23, 2007
Messages
129
Thanks for that. I am still at the stage where leaks (and fixing them) intimidate me. I will study your trigger and (hopefully) finally get the nack for stopping leaks and using local variables in GUI.

I guess you did end up owning me in the end, eh spiwn?
 
Level 4
Joined
Jul 23, 2007
Messages
129
So, any trigger that uses unit groups (without storing them in a variable) needs to have...
  • Actions:
  • Custom script: Set bj_wantDestroyGroup = true
...exactly as is at the beginning of the actions? Can this be used on other leaks like locations?
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
@EricDaRed
Not really, just trying to help out, and besides i am a newbie in map making myself.

@PurplePoot
Please explain this a little bit more or give a link to a thread where it is explained.
Thank you.
 
Level 5
Joined
Apr 22, 2008
Messages
139
any way to make each corpse deal 6%? im planning to blow up alll corpses in an area dealing 6% each with each corpse exploding in a smaller area
EDIT
wo these jsut keep getting more complicated! XD
 
Level 4
Joined
Jul 23, 2007
Messages
129
My trigger does the same thing too (6% of current hp lost for each enemy unit within 100 of a corpse explosion. If a unit is nearby two explosions, it will loose 6% twice). My trigger is easier to understand, but is not leak free so it will add some lag to your game.
 
Status
Not open for further replies.
Top