• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Spell] Make Devour restore 50% Max HP

Status
Not open for further replies.
A rough idea that might work.

First trigger detects when a unit is devoured. This is possibly a cast ability. Both devourer and devoured unit are tracked in variables.

Second trigger detects when a unit dies. This tests if the dying unit was the devoured unit. If it was, then restore the health of the devourer appropriately. I do not think killing unit may always be correct, as the devoured unit might die from other sources while being digested, hence the need for tracking the devourer.
 
  • Devour
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Devour (Custom)
    • Actions
      • Unit Group - Add (Triggering unit) to DevourCaster_Group
      • Unit Group - Add (Target unit of ability being cast) to DevourTarget_Group
  • Devour Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in DevourTarget_Group.) Equal to True
      • ((Killing unit) is in DevourCaster_Group.) Equal to True
    • Actions
      • Unit - Set life of (Killing unit) to ((Life of (Killing unit)) + ((Max life of (Triggering unit)) x 0.50))
This is rough idea, we could also use custom values as index or hashtables. Might also be a good idea to add an Boolean "UnitIsDevoured".
Noticed that the devoured units have a buff by default on the ability, so that might also help with removing units from the group when needed.
 
This is rough idea, we could also use custom values as index or hashtables. Might also be a good idea to add an Boolean "UnitIsDevoured".
Noticed that the devoured units have a buff by default on the ability, so that might also help with removing units from the group when needed.
You need to remove the unit from the group after it dies. Otherwise this causes a leak. Removed units are not automatically removed from groups.
 
I think I got it.
  • Devour Init
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Devour
    • Actions
      • Set Devoured_Unit = (Target unit of ability being cast)
  • Devour Hero Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Blood Death Knight
    • Actions
      • Custom script: set udg_Devoured_Unit = null
  • Devour Ends
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to Devoured_Unit
    • Actions
      • Unit - Set life of (Killing unit) to ((Life of (Killing unit)) + ((Max life of Devoured_Unit) / 2.00))
@DoomBlade, I'm using this ability for a single unit so I don't think unit groups or index are necessary but thanks anyway.
 
Yes, forgot to put that in. Pretty sure Warseeker knew this thought :D
Since most people do not know it, I do have to mention it a lot.
@DoomBlade, I'm using this ability for a single unit so I don't think unit groups or index are necessary but thanks anyway.
Why the separate trigger to null the unit? Also I thought GUI lets you set unit variables to "no unit" which is null.
 
I think I got it.
  • Devour Init
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Devour
    • Actions
      • Set Devoured_Unit = (Target unit of ability being cast)
  • Devour Hero Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Blood Death Knight
    • Actions
      • Custom script: set udg_Devoured_Unit = null
  • Devour Ends
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to Devoured_Unit
    • Actions
      • Unit - Set life of (Killing unit) to ((Life of (Killing unit)) + ((Max life of Devoured_Unit) / 2.00))
@DoomBlade, I'm using this ability for a single unit so I don't think unit groups or index are necessary but thanks anyway.
isn't it better to use it as groups? I mean like @DoomBlade has said.
to me, this seems to only work for one unit (not multi unit instance: i.e. not MUI)
 
Status
Not open for further replies.
Back
Top