• 🏆 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!

Sometimes you don't get correct gold for killing an enemy hero, pls help!

Level 14
Joined
Jul 19, 2007
Messages
772
I have triggers in my map that should give the killing unit gold for killing an enemy hero and give them 300 gold for that but it seems like it doesn't always work and doesn't give you the correct amount of gold and sometimes it doesn't even give kill credit for the killing hero when it kills an enemy hero. It also seems that if enemy hero dies by spell then its count as assist kill and no one gets main kill. What could be wrong? I didn't make these triggers myself btw...
  • Pwning Notice CHANGED
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • ((Triggering unit) is An Ancient) Not equal to True
      • ((Triggering unit) is an illusion) Not equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Killing unit)) Equal to Neutral Hostile
        • Then - Actions
          • Game - Display to (All players) the text: (|cFF000000Neutral Creeps|r + ( has just killed + ((ColorCodes[TempInt1] + ((Name of (Owner of (Triggering unit))) + |r)) + .)))
          • Set VariableSet unit = (Triggering unit)
          • Set VariableSet unit2 = (Killing unit)
          • Custom script: set udg_integer = GetHandleIdBJ( udg_unit )
          • Hashtable - Clear all child hashtables of child integer in HASHASSIST.
        • Else - Actions
          • Set VariableSet TempInt1 = (Player number of (Owner of (Triggering unit)))
          • Set VariableSet TempInt2 = (Player number of (Owner of (Killing unit)))
          • Set VariableSet PlayerConcecutiveDeath[TempInt1] = (PlayerConcecutiveDeath[TempInt1] + 1)
          • Set VariableSet PlayerConcecutiveDeath[TempInt2] = 0
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PlayerConcecutiveDeath[TempInt1] Less than or equal to 2
            • Then - Actions
              • Set VariableSet Reward = 300
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerConcecutiveDeath[TempInt1] Equal to 3
                • Then - Actions
                  • Set VariableSet Reward = 200
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • PlayerConcecutiveDeath[TempInt1] Equal to 4
                    • Then - Actions
                      • Set VariableSet Reward = 150
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • PlayerConcecutiveDeath[TempInt1] Greater than or equal to 5
                        • Then - Actions
                          • Set VariableSet Reward = 100
                        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Owner of (Killing unit)) Equal to Player 10 (Light Blue)
                  • (Owner of (Killing unit)) Equal to Player 12 (Brown)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Killing unit)) Equal to Player 12 (Brown)
                • Then - Actions
                  • Game - Display to (All players) the text: ((The |cffFF0000 + (Evil + |r)) + ( forces has just killed + ((ColorCodes[TempInt1] + ((Name of (Owner of (Triggering unit))) + |r)) + .)))
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Killing unit)) Equal to Player 10 (Light Blue)
                • Then - Actions
                  • Game - Display to (All players) the text: ((The |cff0080FF + (Good + |r)) + ( forces has just killed + ((ColorCodes[TempInt1] + ((Name of (Owner of (Triggering unit))) + |r)) + .)))
                • Else - Actions
            • Else - Actions
              • Game - Display to (All players) the text: ((ColorCodes[TempInt2] + ((Name of (Owner of (Killing unit))) + |r)) + ( has just killed + ((ColorCodes[TempInt1] + ((Name of (Owner of (Triggering unit))) + |r)) + ( and gains + ((String(Reward)) + gold.)))))
          • Set VariableSet unit = (Triggering unit)
          • Set VariableSet unit2 = (Killing unit)
          • Custom script: set udg_integer = GetHandleIdBJ( udg_unit )
          • Custom script: set udg_integer2 = GetHandleIdBJ( udg_unit2 )
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (unit belongs to an enemy of (Owner of unit2).) Equal to True
            • Then - Actions
              • Set VariableSet player = (Owner of unit2)
              • Set VariableSet integer3 = 0
              • Trigger - Run REWARD FOR KILL <gen> (checking conditions)
              • Set VariableSet string2 = Assist:
              • For each (Integer LOOP) from 1 to 12, do (Actions)
                • Loop - Actions
                  • Set VariableSet player = (Player(LOOP))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (player is in player_force.) Not equal to True
                      • player Not equal to (Owner of unit)
                      • player Not equal to (Owner of (Killing unit))
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (unit belongs to an enemy of player.) Equal to True
                          • (Load LOOP of integer from HASHASSIST.) Greater than 0
                        • Then - Actions
                          • Set VariableSet integer3 = (integer3 + 1)
                          • Player Group - Add player to player_force
                          • Set VariableSet string2 = (string2 + ColorCodes[(Player number of player)])
                          • Set VariableSet string2 = (string2 + ((Name of player) + |r, ))
                        • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (unit2 belongs to an enemy of player.) Not equal to True
                          • (Load LOOP of integer2 from HASHASSIST.) Greater than 0
                        • Then - Actions
                          • Set VariableSet integer3 = (integer3 + 1)
                          • Player Group - Add player to player_force
                          • Set VariableSet string2 = (string2 + ColorCodes[(Player number of player)])
                          • Set VariableSet string2 = (string2 + ((Name of player) + |r, ))
                        • Else - Actions
                    • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • integer3 Greater than 0
                • Then - Actions
                  • Game - Display to (All players) the text: string2
                  • Trigger - Run REWARD FOR ASSIST <gen> (checking conditions)
                • Else - Actions
            • Else - Actions
          • Hashtable - Clear all child hashtables of child integer in HASHASSIST.
          • Set VariableSet unit = No unit
          • Set VariableSet unit2 = No unit
 
Last edited:
Top