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

Death Pact Ability

Status
Not open for further replies.
Level 5
Joined
Jan 15, 2018
Messages
130
Trying to a make a Death Pact Abiltiy using channel but its not restoring any health. anything you see wrong?

  • MorgothMercyTrial
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Morgoth's Mercy (1,2 test)
    • Actions
      • Set VariableSet MorgothMercy_picked = (Target unit of ability being cast)
      • Unit - Explode MorgothMercy_picked.
      • Set VariableSet MercyLife = (Life of (Target unit of ability being cast))
      • Set VariableSet MorgothMecry_Caster = (Life of (Casting unit))
      • Set VariableSet MogothMercy_Level = (Level of Morgoth's Mercy (1,2 test) for (Casting unit))
      • Unit - Set life of (Casting unit) to (MorgothMecry_Caster + (MercyLife x (Real(MogothMercy_Level))))
      • Special Effect - Create a special effect attached to the overhead of MorgothMercy_picked using Abilities\Spells\Undead\DeathPact\DeathPactCaster.mdl
      • Special Effect - Destroy (Last created special effect)
 
moving the exploding of the unit to the end of the trigger and setting the life first.
Sorry I'm still waking up let me look into this.

EDIT:
Okay so the problem is that explode removes (Target Unit of ability being cast) resulting in the variable "MercyLife" equating to 0.00.
The fix is to move "Set VariableSet MercyLife = (Life of (Target unit of ability being cast))" to the start of the trigger.

Lastly you have some pretty useless variables taking up space, you could trim it down to:
  • Triggered Death pact.
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to necromancer's insurance policy
    • Actions
      • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Undead\DeathPact\DeathPactCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + ((Life of (Target unit of ability being cast)) x (Real((Level of (Ability being cast) for (Triggering unit))))))
      • Special Effect - Create a special effect attached to the overhead of (Target unit of ability being cast) using Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Explode (Target unit of ability being cast).
 
Last edited:
Word. thanks man, is the extra variables a big deal? I just got this one to work.

  • MorgothMercyTrial
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Morgoth's Mercy (1,2 test)
    • Actions
      • Set VariableSet MorgothMercy_picked = (Target unit of ability being cast)
      • Set VariableSet MercyLife = (Life of (Target unit of ability being cast))
      • Set VariableSet MorgothMecry_Caster = (Life of (Triggering unit))
      • Set VariableSet MogothMercy_Level = (Level of Morgoth's Mercy (1,2 test) for (Triggering unit))
      • Unit - Set life of (Triggering unit) to (MorgothMecry_Caster + (MercyLife x (Real(MogothMercy_Level))))
      • Unit - Explode MorgothMercy_picked.
      • Special Effect - Create a special effect attached to the overhead of MorgothMercy_picked using Abilities\Spells\Undead\DeathPact\DeathPactCaster.mdl
      • Special Effect - Destroy (Last created special effect)
 
Word. thanks man, is the extra variables a big deal? I just got this one to work.

  • MorgothMercyTrial
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Morgoth's Mercy (1,2 test)
    • Actions
      • Set VariableSet MorgothMercy_picked = (Target unit of ability being cast)
      • Set VariableSet MercyLife = (Life of (Target unit of ability being cast))
      • Set VariableSet MorgothMecry_Caster = (Life of (Triggering unit))
      • Set VariableSet MogothMercy_Level = (Level of Morgoth's Mercy (1,2 test) for (Triggering unit))
      • Unit - Set life of (Triggering unit) to (MorgothMecry_Caster + (MercyLife x (Real(MogothMercy_Level))))
      • Unit - Explode MorgothMercy_picked.
      • Special Effect - Create a special effect attached to the overhead of MorgothMercy_picked using Abilities\Spells\Undead\DeathPact\DeathPactCaster.mdl
      • Special Effect - Destroy (Last created special effect)
It makes you're variable list slimmer but it is entirely up to you.
Also, another nick pick, you should add the death pact caster effect too!
 
Word. thanks man, is the extra variables a big deal? I just got this one to work.

  • MorgothMercyTrial
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Morgoth's Mercy (1,2 test)
    • Actions
      • Set VariableSet MorgothMercy_picked = (Target unit of ability being cast)
      • Set VariableSet MercyLife = (Life of (Target unit of ability being cast))
      • Set VariableSet MorgothMecry_Caster = (Life of (Triggering unit))
      • Set VariableSet MogothMercy_Level = (Level of Morgoth's Mercy (1,2 test) for (Triggering unit))
      • Unit - Set life of (Triggering unit) to (MorgothMecry_Caster + (MercyLife x (Real(MogothMercy_Level))))
      • Unit - Explode MorgothMercy_picked.
      • Special Effect - Create a special effect attached to the overhead of MorgothMercy_picked using Abilities\Spells\Undead\DeathPact\DeathPactCaster.mdl
      • Special Effect - Destroy (Last created special effect)
Always explode/remove/kill units at the end of your trigger when possible. You want to interact with the unit while it's still alive or still exists.

Also, those variables are technically optimizations but it's nothing you'd ever notice in-game. You need to make a judgement call as to when variables will greatly improve the efficiency of your trigger and when they're even necessary-the latter being more noticeable since your trigger would bug out otherwise.

Lastly, you aren't taking full advantage of your variables. You shouldn't be getting the (Target unit of ability being cast) more than once if it's stored in a variable. You want to reference MorgothMercy_picked throughout the entire trigger after it's Set. Same goes for MorgothMecry_Caster and (Triggering unit). There could be exceptions if you had Waits in your trigger since (Triggering unit) acts like a local variable.
 
Last edited:
Status
Not open for further replies.
Back
Top