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

How to make Death Pact work on non-undead?

Status
Not open for further replies.
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

I can't test it up to now because I need to reinstall Warcraft III but what about this trigger:
  • Death Pact
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Death Pact [New]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of (Casting unit)) Greater than or equal to (Max life of (Casting unit))
        • Then - Actions
          • Set RestoreMana = ((Real((Level of (Ability being cast) for (Casting unit)))) x 40.00)
          • Set AbilityLevel = (Level of (Ability being cast) for (Casting unit))
          • Unit - Remove Death Pact [New] from (Casting unit)
          • Unit - Add Death Pact [New] to (Casting unit)
          • Unit - Set level of Death Pact [New] for (Casting unit) to AbilityLevel
          • Game - Display to (Player group((Owner of (Casting unit)))) for 3.00 seconds the text: You cant cast the a...
          • Unit - Set mana of (Casting unit) to RestoreMana
          • Skip remaining actions
        • Else - Actions
          • Set RestoreLife = (Life of (Target unit of ability being cast))
          • Unit - Explode (Target unit of ability being cast)
          • Unit - Set life of (Casting unit) to ((Life of (Casting unit)) + RestoreLife)
          • Special Effect - Create a special effect at (Position of (Casting unit)) using Abilities\Spells\Undead\DeathPact\DeathPactCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at (Position of (Target unit of ability being cast)) using Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
          • Special Effect - Destroy (Last created special effect)
Death Pact is unable to cast if the caster has full life ( get a error massage if casting ). I solve this problem with the "then-action" - maybe there's a better way in Jass .... but I remove this ability and re-add it to the caster.

Also I restore the mana of the casting unit because it has no effect ( Example mana cost for the ability here is 40/80/120 )

I still don't know what better here (casting unit) or (triggerunit)
 
Status
Not open for further replies.
Top