So first we need to keep track of each Player's Hero. We can do this by using a Unit variable with an
Array enabled (it's a checkbox that you can turn on when creating the Variable). Variable Arrays allow you to use 1 Variable to store multiple things by giving each Variable it's own unique Index --> [the Index is an Integer that goes inside these brackets].
In this case we're going to use our Hero variable to store the Player's Hero after it's purchased from a Tavern. If you don't purchase your Heroes through a Tavern-like structure then then you will need to adjust the trigger accordingly.
Now each Player in Warcraft 3 has a Player Number, Player 1's number is 1, P2's is 2, P3's is 3, etc... We can use this Player Number as the Index [] in our Hero variable. The result: Hero[1] = Player 1's hero, Hero[2] = Player 2's hero, Hero[3] = Player 3's hero, etc...
-
Setup Heroes
-

Events
-


Unit - A unit Sells a unit
-

Conditions
-


((Sold unit) is A Hero) Equal to True
-

Actions
-


Set Variable Hero[(Player number of (Owner of (Sold unit)))] = (Sold unit)
Now that we're keeping track of each Player's Hero, we can reference them whenever and wherever. In the case of our Str Max trigger, we can reference the Hero that belongs to the Player that the typed chat message like so:
-
Str Max
-

Events
-


Player - Player 1 (Red) types a chat message containing -str max as An exact match
-


Player - Player 2 (Blue) types a chat message containing -str max as An exact match
-


Player - Player 3 (Teal) types a chat message containing -str max as An exact match
-


Player - Player 4 (Purple) types a chat message containing -str max as An exact match
-

Conditions
-

Actions
-


Set Variable PN = (Player number of (Triggering player))
-


Set Variable Before = (Strength of Hero[PN] (Include bonuses))
-


Hero - Modify Strength of Hero[PN]: Add (((Triggering player) Current gold) / 100).
-


Set Variable After = (Strength of Hero[PN] (Include bonuses))
-


Set Variable GoldMultiplier = (After - Before)
-


Player - Add (-100 x GoldMultiplier) to (Triggering player).Current gold
You'll see that I added some extra variables (Before/After/GoldMultiplier), these help guarantee that the Player only spends 100 Gold for each Point of Strength gained.
Using your original setup, if the Player had 160 gold for example: 160/100 = 1.6, which will be rounded down to 1. The Hero will only gain 1 Strength, but the Player will lose 159 gold (160 - 159 = 1).
Variables:
Hero = Unit (
Array)
PN = Integer
Before = Integer
After = Integer
GoldMultiplier = Integer