HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Gold Loss Equation Problem

04-26-2006, 07:08 PM#1
ixmike88
I wrote an equation for the amount of gold you lose, equation is based on level, for some reason it is always returning 0 and I don't know why this happens, any help please?

Trigger:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Hero level of (Dying unit)) Greater than or equal to 80
Collapse Then - Actions
Set GoldLoss = (((Owner of (Dying unit)) Current gold) x ((((Hero level of (Dying unit)) / 2) + 12) / 100))
Player - Add (-1 x GoldLoss) to (Owner of (Dying unit)) Current gold
Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) + ( has lost + ((String(GoldLoss)) + for dying! That newb!)))
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
(Hero level of (Dying unit)) Less than or equal to 79
(Hero level of (Dying unit)) Greater than or equal to 40
Collapse Then - Actions
Set GoldLoss = (((Owner of (Dying unit)) Current gold) x ((((Hero level of (Dying unit)) / 4) + 6) / 100))
Player - Add (-1 x GoldLoss) to (Owner of (Dying unit)) Current gold
Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) + ( has lost + ((String(GoldLoss)) + for dying! That newb!)))
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Hero level of (Dying unit)) Less than or equal to 39
Collapse Then - Actions
Set GoldLoss = (((Owner of (Dying unit)) Current gold) x ((((Hero level of (Dying unit)) / 8) + 3) / 100))
Player - Add (-1 x GoldLoss) to (Owner of (Dying unit)) Current gold
Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) + ( has lost + ((String(GoldLoss)) + for dying! That newb!)))
Collapse Else - Actions
Do nothing

EDIT: The equation is supposed to multiply your gold by a decimal number/percentage, for instance: Level 80, 300,000 gold.
(300,000)*((80/2+12)/100)
(300,000)*((52)/100)
(300,000)*(.52)=156,000
Add (-1)(156,000) gold to dying player.
04-26-2006, 08:02 PM#2
Captain Griffen
Use reals rather than integers, then convert the FINAL value to an integer to display/reduce it. Integers cannot work in decimals.
04-26-2006, 08:25 PM#3
ixmike88
Works, thanks.