• 🏆 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!

Not healing correctly and damaging allies

Status
Not open for further replies.
Level 4
Joined
Jan 8, 2012
Messages
66
Hello, I'll cut right to the point - my trigger is meant to deal damage in an area around the caster while healing himself. My problems are that

a) it won't play the sound I've triggered
b) won't play the unit's animation I've triggered
c) Deals damage to allies as well as enemies, thought I triggered it to only damage enemies.
d) Where it's supposed to heal for 85 health - it only heals the caster for about 20.

Note: Player 1 (Red) will always be the owner of casting unit.

So here's my trigger:

  • DivineStormAnimation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Divine Storm
    • Actions
      • Animation - Play (Casting unit)'s stand victory animation
      • Sound - Play HolyBolt <gen>
  • DivineStormDamage
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Divine Storm
    • Actions
      • Unit Group - Pick every unit in (Units within 225.00 of (Position of (Casting unit)) matching (((Picked unit) belongs to an enemy of Player 1 (Red)) Equal to True)) and do (If ((Level of Divine Storm for (Casting unit)) Equal to 1) then do (Unit - Cause (Casting unit) to damage (Picked unit), dealing 85.00 damage of attack type Spells and damage type Divine) else do (Do nothing))
      • Unit Group - Pick every unit in (Units within 225.00 of (Position of (Casting unit)) matching (((Picked unit) belongs to an enemy of Player 1 (Red)) Equal to True)) and do (If ((Level of Divine Storm for (Casting unit)) Equal to 2) then do (Unit - Cause (Casting unit) to damage (Picked unit), dealing 130.00 damage of attack type Spells and damage type Divine) else do (Do nothing))
      • Unit Group - Pick every unit in (Units within 225.00 of (Position of (Casting unit)) matching (((Picked unit) belongs to an enemy of Player 1 (Red)) Equal to True)) and do (If ((Level of Divine Storm for (Casting unit)) Equal to 3) then do (Unit - Cause (Casting unit) to damage (Picked unit), dealing 175.00 damage of attack type Spells and damage type Divine) else do (Do nothing))
      • Unit Group - Pick every unit in (Units within 225.00 of (Position of (Casting unit)) matching (((Picked unit) belongs to an enemy of Player 1 (Red)) Equal to True)) and do (If ((Level of Divine Storm for (Casting unit)) Equal to 4) then do (Unit - Cause (Casting unit) to damage (Picked unit), dealing 220.00 damage of attack type Spells and damage type Divine) else do (Do nothing))
      • Unit Group - Pick every unit in (Units within 225.00 of (Position of (Casting unit)) matching (((Picked unit) belongs to an enemy of Player 1 (Red)) Equal to True)) and do (If ((Level of Divine Storm for (Casting unit)) Equal to 5) then do (Unit - Cause (Casting unit) to damage (Picked unit), dealing 270.00 damage of attack type Spells and damage type Divine) else do (Do nothing))
      • If ((Level of Divine Storm for (Casting unit)) Equal to 1) then do (Unit - Set life of (Casting unit) to ((Life of (Casting unit)) + 85.00)) else do (Do nothing)
      • If ((Level of Divine Storm for (Casting unit)) Equal to 2) then do (Unit - Set life of (Casting unit) to ((Life of (Casting unit)) + 130.00)) else do (Do nothing)
      • If ((Level of Divine Storm for (Casting unit)) Equal to 3) then do (Unit - Set life of (Casting unit) to ((Life of (Casting unit)) + 175.00)) else do (Do nothing)
      • If ((Level of Divine Storm for (Casting unit)) Equal to 4) then do (Unit - Set life of (Casting unit) to ((Life of (Casting unit)) + 220.00)) else do (Do nothing)
      • If ((Level of Divine Storm for (Casting unit)) Equal to 5) then do (Unit - Set life of (Casting unit) to ((Life of (Casting unit)) + 270.00)) else do (Do nothing)
Thanks in advance.
 
Level 5
Joined
Jan 17, 2014
Messages
131
Can't help you with the animation or the sound, but as you explained it, the spell itself is easy. I made an example trigger + attached test map.

  • Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to :P (ivofena)
    • Actions
      • Set Spell_Caster_Temp_Loc = (Position of (Triggering unit))
      • Set Spell_Target_Temp_Group = (Units within 500.00 of Spell_Caster_Temp_Loc matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)))
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 100.00)
      • Unit Group - Pick every unit in Spell_Target_Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 100.00 damage of attack type Magic and damage type Lightning
      • Custom script: call RemoveLocation(udg_Spell_Caster_Temp_Loc)
      • Custom script: call DestroyGroup(udg_Spell_Target_Temp_Group)
P.S. You don't really need 2 triggers for the animation+sound and the dmg+heal. Combine them instead.
 

Attachments

  • Test Map for Limitless.w3x
    13.1 KB · Views: 37
Level 5
Joined
May 6, 2013
Messages
125
As for the concrete errors:

a) it won't play the sound I've triggered

Holy Bolt is probably a 3D-Sound, which means it has a position it is played at, so that only people with their camera near that position can hear it. As you dont give a position, it will probably be played at the middle of the map instead. Try "Play Sound At Point" instead

b) won't play the unit's animation I've triggered

Playing animations is usually a harder thing to accomplish; the animation from the object editor will typically overwrite the animation you give it via triggers, and letting a unit play an animation WHILE casting is a whole different story (and the solution is not really nice either). Try setting the animation in the object editor instead and see if it does the trick for you, else you are in for a tough ride.

c) Deals damage to allies as well as enemies, thought I triggered it to only damage enemies.

  • Unit Group - Pick every unit in (Units within 225.00 of (Position of (Casting unit)) matching (((Picked unit) belongs to an enemy of Player 1 (Red)) Equal to True)) ...
You used (Picked unit) in your filter condition. (Picked unit) is only valid inside the "then do" conditions; you need to use (Matching Unit) instead.

d) Where it's supposed to heal for 85 health - it only heals the caster for about 20.

Since your spell did damage to allies, it likely also did damage to the caster himself, which was reduced by armor (by about 20 health) and then healed against, leaving you with a net gain of about 20 health in the end.
 
Status
Not open for further replies.
Top