• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] AoE, dealing damage

Status
Not open for further replies.
Level 7
Joined
Feb 27, 2010
Messages
184
well, this may seem as a nooby question, but i cant make my AoE spells do damage only to enemies.
for example, i wanted to create a spell, which heals a target, then deals damage around it for some amount of target's hp. please help me, i dont know what to do.

Voodoo Heal
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Voodoo Heal
Actions
Set VHCasterLoc = (Position of (Targeted unit))
Set VHDmgGroup = (Units within 512.00 of VHCasterLoc matching (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit))) Equal to True))
Unit Group - Pick every unit in VHDmgGroup and do (Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((100.00 - (Percentage life of (Target unit of ability being cast))) + (5.00 x (Real((Level of Voodoo Heal for (Triggering unit)))))) damage of attack type Spells and damage type Normal)
Custom script: call RemoveLocation(udg_VHCasterLoc)
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
your trigger must work like this (anyway u can store the damage in outside the unit group loop because it is faster when u calculae 1x instead many times)

  • Aoe dmg
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Holy Light
    • Actions
      • Set p = (Target point of ability being cast)
      • Set hp_perc = (100.00 - (Percentage life of (Target unit of ability being cast)))
      • Set dmg = (hp_perc + (Real(((Level of Holy Light for (Triggering unit)) x 5))))
      • Set UnitGroup = (Units within 512.00 of p matching (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True))
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing dmg damage of attack type Spells and damage type Normal
          • Game - Display to (All players) the text: (((Name of (Picked unit)) + (( owned by + ((Name of (Owner of (Picked unit))) + )))) + ( reicived + ((String(dmg)) + damage)))
      • Custom script: call RemoveLocation(udg_p)
 

Attachments

  • demo_aoe.w3x
    17.3 KB · Views: 223
Status
Not open for further replies.
Top