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

Tracking Gold Pooling

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,516
You can use something like this: Player Resource Monitoring v1.01

Then you might be able to do something like this:
  • Events:
  • A player loses/gains gold
  • Actions:
  • Set Variable PN = Player number of Event player
  • Set Variable GoldAmount[PN] = The amount of gold (make this a negative number if it was gold loss)
  • Add Event player to "Gold Player Group"
  • IF number of players in Gold Player Group > 1 THEN -> Pick every player in Gold Player Group -> Set PN = Player number of picked player -> If GoldAmount[PN] less than 0 -> We know this player lost gold, ELSE, we know this player received gold
  • // With the above information you can then add GoldAmount[PN], PN being the player number of the "pooling" player, to a "Pool" Integer. You can use the mathematical function Absolute to convert the negative gold amount to a positive number when adding it to the Pool integer (or just multiply it by -1)
  • Clear "Gold Player Group" // Make sure to do this AFTER you pick every player in Gold Player Group. This needs to be inside the If Then Else so it only gets cleared if there is 2+ players in the group.
  • Start a 0.00 second one-shot timer which Clears "Gold Player Group" (this is to make sure that the Group is cleared regardless, but after a delay giving us enough time to catch both players inside the Group at once)
The idea is that if this Event fires twice at the same time (one player loses gold, the other gains gold), the 2nd execution of the trigger will catch the two players whose resources changed, and will calculate what's needed from there.

Alternatively, there's plenty of ways to share gold without using Blizzard's gold sharing interface. Abilities, chat commands, custom UI, these all give you far greater control.
 
Last edited:
Status
Not open for further replies.
Top