-
Bounty System
-
Events
-
Conditions
-
((Triggering unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
-
Actions
-
Set Temp_Point = (Position of (Triggering unit))
-
Set UnitsThatWillGetBountyReward = (Units within 500.00 of Temp_Point matching ((((Matching unit) is A Hero) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an ally of (Owner of (Killing unit))) Equal to True)
Temp_Point is a Point Variable.
UnitsThatWillGetBountyReward is a Unit Group Variable, doesn't have to be that name though. These units doesn't have to have these conditions, pick those you want.
Now we pick the units in the group:
-
Unit Group - Pick every unit in UnitsThatWillGetBountyReward and do (Actions)
-
Loop - Actions
Now you have to create the variables for your bounty formula. What's the bounty based on?: Creep custom value? Creep hp? Creep level? Hero level? Str/Int/Agi/Hp of the hero? Hero/Unit ability? a Timer? Whatever you want, just add it to the formula. The following is based on the creep level.
The bounty is Level of the Creep x 5, divided by the number of units (picked in the group). If there creep is level 10, it will give 50 if there's only 1 hero in the group, 25 if there's 2, 13.3 if there's 3... etc.
-
Set CreepLVL = (Level of (Triggering unit))
-
Set int = (Number of units in UnitsThatWillGetBountyReward)
-
Player - Add ((CreepLVL x 5) / int) to (Owner of (Picked unit)) Current gold
We can create also the text of the bounty. Notice that YOU HAVE TO set the FLOATING TEXT LIFESPAN... otherwise it would leak. Edit it as you like
-
Floating Text - Create floating text that reads (|cffffd700+ + ((String(((CreepLVL x 5) / int))) + |r )) above (Picked unit) with Z offset 0.00, using font size 12.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
-
Floating Text - Set the velocity of (Last created floating text) to 70.00 towards 110.00 degrees
-
Floating Text - Change (Last created floating text): Disable permanence
-
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
-
Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
We can also create the special effect of the coins. This effect MUST BE DESTROYED, otherwise it would leak.
-
Special Effect - Create a special effect attached to the origin of (Picked unit) using UI\Feedback\GoldCredit\GoldCredit.mdl
-
Special Effect - Destroy (Last created special effect)
Finally, we remove the Temp_Point and the UnitsThatWillGetBountyReward Group.
-
Custom script: call RemoveLocation(udg_Temp_Point)
-
Custom script: call DestroyGroup(udg_UnitsThatWillGetBountyReward)