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

Need help with Hashtable trigger!

Status
Not open for further replies.
Level 2
Joined
Jun 7, 2009
Messages
5
Ok, so i made these triggers to have a chance to deal damage and knock back enemies. Everything up to the damage dealing works but it seems that I did something wrong with the hashtable to make that part not work.
  • Counter Rotation Cast
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) has buff Counter Rotation ) Equal to True
      • (Random integer number between 1 and 100) Less than or equal to 13
    • Actions
      • Set CR_Caster = (Attacked unit)
      • Set CR_CastLoc = (Position of CR_Caster)
      • Animation - Play CR_Caster's spin animation
      • Unit Group - Pick every unit in (Units within 300.00 of CR_CastLoc matching (((Matching unit) belongs to an enemy of (Owner of CR_Caster)) Equal to True)) and do (Actions)
        • Loop - Actions
          • Set CR_TempLoc = (Position of (Picked unit))
          • Unit - Cause CR_Caster to damage (Picked unit), dealing (75.00 x (Real((Level of Counter Rotation for CR_Caster)))) damage of attack type Chaos and damage type Shadow Strike
          • -------- The set life amount is 20% of the damage done to each enemy. (75*level)/50 is also1.5*level --------
          • Unit - Set life of CR_Caster to ((Life of CR_Caster) + (1.50 x (Real((Level of Counter Rotation for CR_Caster)))))
          • Unit Group - Add (Picked unit) to CR_Group
          • Set CR_Angle = (Angle from CR_CastLoc to CR_TempLoc)
          • Hashtable - Save CR_Dist as 0 of (Key (Picked unit)) in CR_Hashtable
          • Hashtable - Save CR_Angle as 1 of (Key (Picked unit)) in CR_Hashtable
          • Hashtable - Save CR_TimeRemaining as 2 of (Key (Picked unit)) in CR_Hashtable
      • Set CR_Dist = 16.00
      • Set CR_TimeRemaining = 2.00
      • Custom script: set udg_CR_Caster = null
      • Custom script: call RemoveLocation(udg_CR_CastLoc)
  • Counter Rotation Loop
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in CR_Group and do (Actions)
        • Loop - Actions
          • Set CR_TempLoc2 = (Position of (Picked unit))
          • Set CR_Dist = (Load 0 of (Key (Picked unit)) from CR_Hashtable)
          • Set CR_Angle = (Load 1 of (Key (Picked unit)) from CR_Hashtable)
          • Set CR_TimeRemaining = (Load 2 of (Key (Picked unit)) from CR_Hashtable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CR_TimeRemaining Greater than 0.00
            • Then - Actions
              • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by CR_Dist towards CR_Angle degrees)
              • Hashtable - Save (CR_TimeRemaining - 0.04) as 2 of (Key (Picked unit)) in CR_Hashtable
            • Else - Actions
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in CR_Hashtable
              • Unit Group - Remove (Picked unit) from CR_Group
              • Custom script: call RemoveLocation (udg_CR_TempLoc2)
 
Status
Not open for further replies.
Top