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

Trigger "Devour Magic" Ability

Status
Not open for further replies.
Level 8
Joined
Jun 13, 2010
Messages
344
Hi,
I am making a Hero, who can learn the Phoenix Fire ability. As you know, you cannot select or see the spell when learned. So I thought of adding a new spell to it - Devour Magic from the undead Destroyers.
I triggered it to add the ability level equel to the learned ability level.

  • Learn Mystic Essence
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Learning Hero)) Equal to Murloc
          • (Learned Hero Skill) Equal to Murloc (Mystic Essence Passive)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Murloc (Mystic Essence Passive) for (Learning Hero)) Equal to 1
        • Then - Actions
          • Unit - Add Murloc (Mystic Essence Activate) to (Learning Hero)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Murloc (Mystic Essence Passive) for (Learning Hero)) Equal to 2
        • Then - Actions
          • Unit - Set level of Murloc (Mystic Essence Activate) for (Learning Hero) to 2
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Murloc (Mystic Essence Passive) for (Learning Hero)) Equal to 3
        • Then - Actions
          • Unit - Set level of Murloc (Mystic Essence Activate) for (Learning Hero) to 3
        • Else - Actions
The two abilities are Mystic Essence Activate (Devour Magic)/Passive (Phoenix Fire).
Now, since the Devour Magic does not affect passive buffs, it seemed kinda lame. So I wanted to trigger it, so it would dispell the buffs and grant health.

I started here:
  • Consume Mystic Essence
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Murloc (Mystic Essence Activate)
    • Actions
      • Set MysticEssencePoint = (Target point of ability being cast)
      • Set MysticEssenceGroup = (Units within 150.00 of MysticEssencePoint)
      • Unit Group - Pick every unit in MysticEssenceGroup and do (Actions)
        • Loop - Actions
          • Unit - Remove All buffs from (Picked unit)
...But got lost.
I think I have to make an Integer = units in MysticEssenceGroup and deal -50 damage for each unit.
But how? ^^
And ofc, I should add a condition, making it impossible to remove buffs from the caster, since it would be a hardcore dispell power and free health farm. How would you recommend that as well?
 
Level 21
Joined
Nov 4, 2013
Messages
2,017
There's no need for condition. When you pick the units, you simply exclude your own hero. You pick units matching condition such that "(Matching Unit) Not equal to (Casting Unit)" so your hero isn't included.
For the healing, you can add negative damage as well as using "Set Life" which, in my opinion, is a safer and better way.
 
Level 9
Joined
Apr 23, 2011
Messages
527
just simply add the negative damage and health buff actions to the unit group action in the 2nd trigger.
  • Unit Group - Pick every unit in MysticEssenceGroup and do (Actions)
    • Loop - Actions
      • Unit - Remove All buffs from (Picked unit)
      • Unit - Cause (Casting unit) to damage (Picked unit), dealing 10.00 damage of attack type Spells and damage type Magic
      • Unit - Set life of (Casting unit) to ((Life of (Casting unit)) + 1.00)
 
Level 8
Joined
Jun 13, 2010
Messages
344
  • Consume Mystic Essence
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Murloc (Mystic Essence Activate)
    • Actions
      • Set MysticEssencePoint = (Target point of ability being cast)
      • Set MysticEssenceGroup = (Units within 150.00 of MysticEssencePoint)
      • Unit Group - Pick every unit in MysticEssenceGroup and do (Actions)
        • Loop - Actions
          • Unit - Remove All buffs from (Picked unit)
          • Unit - Set life of (Casting unit) to (((Real(MysticEssenceInt)) x 50.00) + (Life of (Casting unit)))
So I have made it this far. How do I set the variable MysticEssenceInteger = MysticEssenceGroup (number of units in group)?
 
Level 8
Joined
Jun 13, 2010
Messages
344
Nevermind, gosh. Found it. xD
Is this leak-free so far?
Except the fact that I do not want the casting unit to be able to use it on itself, gaining 50 hp for nothing. It can only be used on self and gain health, if it has a buff. How do I do that?

  • Consume Mystic Essence
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Murloc (Mystic Essence Activate)
    • Actions
      • Set MysticEssencePoint = (Target point of ability being cast)
      • Set MysticEssenceGroup = (Units within 150.00 of MysticEssencePoint)
      • Set MysticEssenceInt = (Number of units in MysticEssenceGroup)
      • Unit Group - Pick every unit in MysticEssenceGroup and do (Actions)
        • Loop - Actions
          • Unit - Remove All buffs from (Picked unit)
          • Unit - Set life of (Casting unit) to (((Real(MysticEssenceInt)) x 50.00) + (Life of (Casting unit)))
      • Unit Group - Remove all units of MysticEssenceGroup from MysticEssenceGroup
      • Set MysticEssenceInt = 0
      • Custom script: call RemoveLocation(udg_MysticEssencePoint)
 
Level 9
Joined
Apr 23, 2011
Messages
527
you don't have to set MysticEssenceInt to 0.
and yes, it does not leak.

to make the ability unable to heal by using the caster, use this
  • Set MysticEssenceGroup = (Units within 150.00 of MysticEssencePoint matching (your conditions here))
 
Status
Not open for further replies.
Top