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

[General] A try for making bounty trigger

Status
Not open for further replies.
Hey everyone, here I'm trying to trigger bounty from heroes and non-heroes.

if the killed unit is hero then give level of unit x 500 gold to each player nearby and if it's not a hero give level of hero x 10 to each player nearby.

Also I don't knwo what is th path of the gold bounty animation.

I post here to see you opinion on the trigger, see if there's somethign wrong

  • Bounty
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set Bounty_Loc = (Position of (Killing unit))
      • Set Bounty_Gr = (Units within 900.00 of Bounty_Loc matching (((Picked unit) belongs to an ally of (Owner of (Killing unit))) Equal to True))
      • Unit Group - Pick every unit in Bounty_Gr and do (Actions)
        • Loop - Actions
          • Player Group - Add (Owner of (Picked unit)) to Bounty_Pl
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to True
        • Then - Actions
          • Player Group - Pick every player in Bounty_Pl and do (Actions)
            • Loop - Actions
              • Player - Add ((Level of (Triggering unit)) x 500) to (Picked player) Current gold
              • Special Effect - Create a special effect attached to the overhead of Hero[(Player number of (Picked player))] using UI\Feedback\Confirmation\Confirmation.mdl
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to False
        • Then - Actions
          • Player Group - Pick every player in Bounty_Pl and do (Actions)
            • Loop - Actions
              • Player - Add ((Level of (Triggering unit)) x 10) to (Picked player) Current gold
              • Special Effect - Create a special effect attached to the overhead of Hero[(Player number of (Picked player))] using UI\Feedback\Confirmation\Confirmation.mdl
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Bounty_Loc)
      • Custom script: call DestroyGroup(udg_Bounty_Gr)
      • Player Group - Remove all players from Bounty_Pl
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
This trigger should also display the gold received only to the players who get the money, just like how normal bounty is perceived.

  • Bounty
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Set TempUnitGroup = (Units within 1000.00 of TempPoint matching (((Matching unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to True
        • Then - Actions
          • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
            • Loop - Actions
              • Player - Add (500 x (Hero level of (Triggering unit))) to (Picked player) Current gold
              • Special Effect - Create a special effect attached to the origin of (Triggering unit) using UI\Feedback\GoldCredit\GoldCredit.mdl
              • Special Effect - Destroy (Last created special effect)
              • Set TempPlayer = (Owner of (Picked unit))
              • Custom script: if GetLocalPlayer() == udg_TempPlayer then
              • Floating Text - Create floating text that reads (|cffffcc00+ + ((String((500 x (Hero level of (Triggering unit))))) + |r)) above (Triggering unit) with Z offset 0.00, using font size 12.00, color (0.00%, 55.00%, 0.00%), and 0.00% transparency
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 3.50 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 2.50 seconds
              • Custom script: endif
        • Else - Actions
          • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
            • Loop - Actions
              • Player - Add (10 x (Level of (Triggering unit))) to (Picked player) Current gold
              • Special Effect - Create a special effect attached to the origin of (Triggering unit) using UI\Feedback\GoldCredit\GoldCredit.mdl
              • Special Effect - Destroy (Last created special effect)
              • Set TempPlayer = (Owner of (Picked unit))
              • Custom script: if GetLocalPlayer() == udg_TempPlayer then
              • Floating Text - Create floating text that reads (|cffffcc00+ + ((String((10 x (Level of (Triggering unit))))) + |r)) above (Triggering unit) with Z offset 0.00, using font size 12.00, color (0.00%, 55.00%, 0.00%), and 0.00% transparency
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 3.50 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 2.50 seconds
              • Custom script: endif
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Custom script: call DestroyGroup (udg_TempUnitGroup)
On a sidenote, remember to destroy your SPX after you use them. Also, you bounty group varaible should say:

((Matching unit) belongs to an ally of (Owner of (Killing Unit)) NOT
((Picked unit) belongs to an ally of (Owner of (Killing Unit))

  • ((Triggering unit) is A Hero) Equal to False
No need to check if they are not a hero. Just check once if the unit IS a hero, then do the code for not a hero in the else section.
 
Status
Not open for further replies.
Top