• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Hashtable issue

Status
Not open for further replies.
Level 17
Joined
Jun 17, 2010
Messages
2,275
Well what happens is, it works the first time, it goes all the way up to 10 charges, blasts the unit, but then the second time around it doesn't even create another unit
  • HS Init
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Holy Strike for (Attacking unit)) Greater than or equal to 0
    • Actions
      • Set HS_Index = (HS_Index + 1)
      • Set HS_Caster[HS_Index] = (Attacking unit)
      • Set HS_Point1[HS_Index] = (Position of HS_Caster[HS_Index])
      • Set NumbOfStacks[HS_Index] = (Real((Level of Holy Strike Dummy for (Load (Key dummy) of (Key (Triggering unit)) in HashTable_HS))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Key dummy) is stored as a Handle of (Key (Attacking unit)) in HashTable_HS) Equal to False
        • Then - Actions
          • Unit - Create 1 HS Dummy for (Owner of (Attacking unit)) at HS_Point1[HS_Index] facing Default building facing degrees
          • Unit - Hide (Last created unit)
          • Hashtable - Save Handle Of(Last created unit) as (Key dummy) of (Key (Attacking unit)) in HashTable_HS
        • Else - Actions
  • HS Heal and Charge
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Holy Strike for (Attacking unit)) Greater than or equal to 0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer(NumbOfStacks[HS_Index])) Equal to 10
          • (Attacking unit) Equal to HS_Caster[HS_Index]
        • Then - Actions
          • Unit - Cause (Triggering unit) to damage (Attacking unit), dealing ((10.00 x NumbOfStacks[HS_Index]) + ((Real((Strength of (Triggering unit) (Include bonuses)))) x NumbOfStacks[HS_Index])) damage of attack type Spells and damage type Normal
          • Set HS_SFXPoint[HS_Index] = (Position of (Triggering unit))
          • Unit - Remove (Load (Key dummy) of (Key (Triggering unit)) in HashTable_HS) from the game
          • Hashtable - Clear all child hashtables of child (Key (Load (Key dummy) of (Key (Triggering unit)) in HashTable_HS)) in HashTable_HS
        • Else - Actions
          • Unit - Increase level of Holy Strike Dummy for (Load (Key dummy) of (Key (Triggering unit)) in HashTable_HS)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to HS_Caster[HS_Index]
        • Then - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (NumbOfStacks[HS_Index] x 25.00))
        • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Holy Strike
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Holy Light for (Attacking unit)) Greater than 0
    • Actions
      • Set u1 = (Attacking unit)
      • Custom script: set udg_i1 = GetHandleId(udg_u1)
      • Custom script: set udg_i2 = LoadInteger( udg_hash , udg_i1 , StringHash("hits") ) + 1
      • Special Effect - Create a special effect attached to the origin of u1 using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Set life of u1 to ((Life of u1) + ((Real(i2)) x 25.00))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • i2 Less than 10
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • i2 Equal to 1
            • Then - Actions
              • Unit - Add Holy Strike SB to u1
            • Else - Actions
          • Custom script: call SaveInteger( udg_hash , udg_i1 , StringHash("hits") , udg_i2 )
          • Unit - Set level of Holy Strike 2 for u1 to i2
        • Else - Actions
          • Unit - Cause u1 to damage (Triggering unit), dealing 100.00 damage of attack type Spells and damage type Normal
          • Custom script: call SaveInteger( udg_hash , udg_i1 , StringHash("hits") , 0 )
          • Unit - Remove Holy Strike SB from u1
          • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIam\AIamTarget.mdl
          • Special Effect - Destroy (Last created special effect)
Something like this. You can use a dummy to apply the buff or something else than Devotion Aura in hidden spellbook.
 

Attachments

  • HolyStrike.w3x
    18.5 KB · Views: 24
Status
Not open for further replies.
Top