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

Setting up Bounty

Status
Not open for further replies.
Level 6
Joined
Oct 25, 2010
Messages
203
So Im a bit of a newb around here :( anybody mind helping me setup bounty? I know how to enable bounty, but it doesn't work how I want it to.

If I enabled bounty for player2, that means all other players (p1 p3 p4) will collect bounty when killing p2 units

How do I set it so that player3 collects bounty from p4 p5 p6... and player6 collects bounty from p1 p2 and p3

Or maybe an easier way to do it, can I make it so that only heroes collect bounty?
 
Try this native:

native GetUnitGoldCost takes integer unitid returns integer

Place that on the Custom Script Code section of your map in order to make it work.

After that, you create a trigger that catches when a unit dies, and filter out if the triggering unit belongs to either Player 4, 5, or 6 and the killing unit belonging to Player 3 or (1, 2, 3 - trigger unit; 6 - killing unit) and if it fulfills the condition, copy the following custom code into the custom script action.

call SetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD) + GetUnitGoldCost(GetTriggerUnit()))

If you already have the variables for the killing and dying unit, replace GetTriggerUnit() with it.
 
Level 6
Joined
Oct 25, 2010
Messages
203
I tried a similar code but found out those custom script codes cause gitches so I need to use SharpEditor... maybe tomorrow

thanks! :)
 
Level 12
Joined
Jun 20, 2017
Messages
959
Wait you can enable bounty to be collected when a player other than a neutral hostile is eliminated? How do you accomplish this?
 
Level 6
Joined
Oct 25, 2010
Messages
203
Actions:
- For each (Integer A) from 1 - #, (do Actions)
+ Loop Actions:
+ - Player - Turn Gives Bounty On for (Player((Integer A)))

# = however many players your map has
 
Status
Not open for further replies.
Top