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

Bounty Award by Ally

Status
Not open for further replies.
Level 31
Joined
Jun 27, 2008
Messages
2,557
Hello there.

I was wondering, how to enable Allied Force to gain You gold bounty award once ally, for example, kills a hostile?

To make my point more clear:

Player 1 & Player 2 attacks Hostile
Then
Player 2 kills Hostile
Then
Player 1 receives Bounty Award

Thanks for the assistance.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Sadly, Warcraft 3 Bounty system only detects the killing unit and not the units around. The best solution is trigger your own bounty system.

Something like this: Don't get scared, is not so hard. I'll explain it to you in parts:

  • Bounty System
    • Events
      • Unit - A unit Dies
    • 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)


Final trigger would be something like:


  • Bounty System
    • Events
      • Unit - A unit Dies
    • 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) and (((Matching unit) has buff Dead
      • Unit Group - Pick every unit in UnitsThatWillGetBountyReward and do (Actions)
        • Loop - Actions
          • Set CreepLVL = (Level of (Triggering unit))
          • Set int = (Number of units in UnitsInRangeForExp)
          • Player - Add ((CreepLVL x 5) / int) to (Owner of (Picked unit)) Current gold
          • 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
          • 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)
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • Custom script: call DestroyGroup(udg_UnitsThatWillGetBountyReward)


NOTE: Set all the creep Gold Reward to 0, otherwise it would display two values. If you want to give the Killing Unit a bonus, do it in the trigger.
 
Status
Not open for further replies.
Top