• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Death Pact Ability

Status
Not open for further replies.
Level 5
Joined
Jan 15, 2018
Messages
128
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)
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
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:
Level 5
Joined
Jan 15, 2018
Messages
128
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)
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
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!
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,589
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.
Top