Hi,
I just can't figure out how to fix this.
When an hero dies, the owner of that hero gets a 25% reduction of his current gold.
This is the trigger that puts the amount of gold immediately to 0, regardless of your current gold amount. Which is false...
The reason why I use 1/4 (as for 0.25 = 25%) is because I can't insert 0.25 into the value. My first thought was to do is set Current Gold x 0.75.
Player 9 = The Enemy
GoldAmount (Variable) = Amount of gold that you lose.
I just can't figure out how to fix this.
When an hero dies, the owner of that hero gets a 25% reduction of his current gold.
This is the trigger that puts the amount of gold immediately to 0, regardless of your current gold amount. Which is false...
The reason why I use 1/4 (as for 0.25 = 25%) is because I can't insert 0.25 into the value. My first thought was to do is set Current Gold x 0.75.
Trigger:
- Gold Reduction
- Events
- Unit - A unit Dies
- Conditions
- ((Dying unit) is A Hero) Equal to True
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Owner of (Dying unit)) Not equal to Player 9 (Gray)
- Then - Actions
- Set GoldAmount = (((Owner of (Dying unit)) Current gold) x (1 / 4))
- Player - Set (Owner of (Dying unit)) Current gold to (((Owner of (Dying unit)) Current gold) - GoldAmount)
- Set PlayerGroup = (All players matching ((Owner of (Dying unit)) Equal to (Matching player)))
- Game - Display to PlayerGroup for 8.00 seconds the text: (You lost |cffeac11e + ((String(GoldAmount)) + |r gold.))
- Custom script: call DestroyForce(udg_PlayerGroup)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
Player 9 = The Enemy
GoldAmount (Variable) = Amount of gold that you lose.