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

Life Power Spell v.1.2

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
This is a spell I made, inspired by wyrmlord's hashtable tutorial! (Thank you, for the great tut!)
[Though I must say I haven't 'stolen' anything, just made a spell, similar to the examples.]

This is a fairly simple, 3 level spell.
If cast on allies it heals for 10 secs. (Formula: [(Level of ability) x 10] + 30)
If cast on enemies it damages for 10 secs. (Formula: [(Level of ability) x 10] + 3)

Update v1.1: It slows the unit by 30%. If an enemy dies with this effect it will damage all enemies around him. If an ally dies with this effect - it will heal all allies.
Update v1.2: Fixed leaky positions.


  • Init Copy
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- --> Creates the hashtable for the spell. --------
      • Hashtable - Create a hashtable
      • Set Hasttable_LP = (Last created hashtable)



  • LP Start
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Life Power
    • Actions
      • -------- --> Checks whether unit is already under the effect of Life Power. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is in LifePower_units) Equal to False
        • Then - Actions
          • -------- --> This is the special effect and Slow effect. --------
          • Set Slow_Posit = (Position of (Target unit of ability being cast))
          • Unit - Create 1 Slow_Dummy for (Owner of (Casting unit)) at Slow_Posit facing Default building facing degrees
          • Unit - Order (Last created unit) to Human Sorceress - Slow (Target unit of ability being cast)
          • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
          • Special Effect - Create a special effect attached to the overhead of (Target unit of ability being cast) using Abilities\Spells\Orc\Voodoo\VoodooAuraTarget.mdl
          • -------- -->Sets all the data we need for later use. --------
          • Hashtable - Save 10.00 as 0 of (Key (Target unit of ability being cast)) in Hasttable_LP
          • Hashtable - Save Handle Of(Last created special effect) as 1 of (Key (Target unit of ability being cast)) in Hasttable_LP
          • Hashtable - Save Handle Of(Casting unit) as 2 of (Key (Target unit of ability being cast)) in Hasttable_LP
          • Unit Group - Add (Target unit of ability being cast) to LifePower_units
          • Custom script: call RemoveLocation( udg_Slow_Posit )
        • Else - Actions
          • -------- --> Orders caster to stop if unit already has the effect of Life Power. --------
          • Unit - Order (Casting unit) to Stop
          • Game - Display to (Player group((Owner of (Casting unit)))) the text: That unit ais alrea...



  • Life Power Spell
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in LifePower_units and do (Actions)
        • Loop - Actions
          • -------- --> Setting all we saved in the previous trigger. --------
          • Set LP_Remaining_Time = (Load 0 of (Key (Picked unit)) from Hasttable_LP)
          • Set Effect_LP = (Load 1 of (Key (Picked unit)) in Hasttable_LP)
          • Set LP_Caster = (Load 2 of (Key (Picked unit)) in Hasttable_LP)
          • -------- --> Checks how many seconds are left. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LP_Remaining_Time Greater than 0.00
            • Then - Actions
              • -------- --> Checks whether the target is allied or enemy. --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) is an enemy of (Owner of LP_Caster)) Equal to True
                • Then - Actions
                  • -------- --> Damages the unit. Formula: ([Level of Life Power] x 10) + 20 {You can always change that to suit your needs.} --------
                  • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (((Real((Level of Life Power for LP_Caster))) x 10.00) + 30.00))
                  • Hashtable - Save (LP_Remaining_Time - 1.00) as 0 of (Key (Picked unit)) in Hasttable_LP
                • Else - Actions
                  • -------- --> Heals the unit. Formula: ([Level of Life Power] x 10) + 20 {You can always change that to suit your needs.} --------
                  • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (((Real((Level of Life Power for LP_Caster))) x 10.00) + 30.00))
                  • Hashtable - Save (LP_Remaining_Time - 1.00) as 0 of (Key (Picked unit)) in Hasttable_LP
            • Else - Actions
              • -------- Clears the unit from the unit group. --------
              • Special Effect - Destroy Effect_LP
              • Unit Group - Remove (Picked unit) from LifePower_units
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Hasttable_LP



  • LP OnDeath Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is in LifePower_units) Equal to True
    • Actions
      • Set Dying_Posit = (Position of (Dying unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) belongs to an enemy of (Owner of (Load 2 of (Key (Dying unit)) in Hasttable_LP))) Equal to True
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 350.00 of Dying_Posit matching ((((Matching unit) belongs to an enemy of (Owner of (Load 2 of (Key (Dying unit)) in Hasttable_LP))) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is dead) Equal to Fal and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
              • Unit - Cause (Load 2 of (Key (Dying unit)) in Hasttable_LP) to damage (Picked unit), dealing ((Real((Level of Life Power for (Load 2 of (Key (Dying unit)) in Hasttable_LP)))) x 25.00) damage of attack type Chaos and damage type Divine
        • Else - Actions
          • Unit Group - Pick every unit in (Units within 350.00 of Dying_Posit matching ((((Matching unit) belongs to an ally of (Owner of (Load 2 of (Key (Dying unit)) in Hasttable_LP))) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is dead) Equal to Fals and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Items\AIre\AIreTarget.mdl
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + ((Real((Level of Life Power for (Load 2 of (Key (Dying unit)) in Hasttable_LP)))) x 25.00))
      • Custom script: call RemoveLocation( udg_Dying_Posit )
      • Special Effect - Destroy (Load 1 of (Key (Dying unit)) in Hasttable_LP)
      • Unit Group - Remove (Dying unit) from LifePower_units


Keywords:
Life, Power, dota, shadow, wold, word, warlock, wizard, spell, heal, damage, over, time
Contents

Life Power Spell v1.2 (Map)

Reviews
00:19, 1st Dec 2009 TriggerHappy: This spell is far to simple. It looks really cheap and could have definitely been done a lot easier. It also leaks. But that doesn't matter since the simplicity of this spell is just too much.

Moderator

M

Moderator

00:19, 1st Dec 2009
TriggerHappy:

This spell is far to simple. It looks really cheap and could have definitely been done a lot easier.

It also leaks. But that doesn't matter since the simplicity of this spell is just too much.
 
Level 15
Joined
Nov 26, 2005
Messages
1,151
first Change Casting Unit by Triggering UNit & Thx for brining this MUI but i think when some1 make hashtable he should add GUI MUI version for poeple that are not using 1.23 more chance from seeing people using ur spell :p

So,
1. Can you please explain what the is difference between casting unit and triggering unit in this case?

2. I didn't understand that very well... Hashtables are avaliable in 1.24+, right ? But what can I do... I made this spell, because I saw how hashtables are used ...
 
Top