Setting up Bounty

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?
 

MyPad

Spell Reviewer
Level 25
Joined
May 9, 2014
Messages
1,741
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
 
Top