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

Need help with tax function

Status
Not open for further replies.
Level 9
Joined
Oct 15, 2006
Messages
339
Let's say i have a TD and when a unit is killed a trigger gives X amount of gold to triggering player. Well that doesn't work with the tax function. My problem is when i set the units to GIVE this X amount of gold from death (without triggers) they do not give it unless they are neutral units. So can i make units give gold upon death without triggers in order to use the tax function?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Why no triggers? This could work:

  • Untitled Trigger 012
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Killing unit)) Food used) Greater than or equal to 80
        • Then - Actions
          • Player - Set (Owner of (Killing unit)) Current gold to (((Owner of (Killing unit)) Current gold) + (Integer((100.00 x 0.40))))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Killing unit)) Food used) Greater than or equal to 40
            • Then - Actions
              • Player - Set (Owner of (Killing unit)) Current gold to (((Owner of (Killing unit)) Current gold) + (Integer((100.00 x 0.70))))
            • Else - Actions
Detect the unit type and set the +gold amount accordingly.
 
Level 9
Joined
Oct 15, 2006
Messages
339
Thank you Maker but Warhunter had the more simplistic approach, although i would have used your method had he not contributed. They both work, so thank you both.

Quick note: If "gives bounty" also adds the gold coin cinematic and/or +gold value to a unit upon death i will be using Maker's method... UNLESS there is a way to turn that off?? :D
 
Status
Not open for further replies.
Top