• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Gold problem!!

Status
Not open for further replies.
Level 4
Joined
Oct 28, 2007
Messages
72
I start 3 maps and all are in 95-98% complete!But i stuck one problems!
So please help me!
I use dummy unit for wining gold (there life points),its another beting map!
So this triger work for me prety good
  • Actions
    • Unit - Pause all units
    • Wait 1.00 seconds
    • Player - Add ((Integer((Life of (Triggering unit)))) x 2) to (Owner of (Triggering unit)) Current gold
    • Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( he win 2x and now he got + (String(((Owner of (Triggering unit)) Current gold)))))
    • Unit - Kill (Triggering unit)
    • Unit - Unpause all units
My problem is in next triggers is maybe in integer?
This first is for lost bet..(set unit hit points to value of player gold and then set to 50% and return back in this case set.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (Triggering unit)) Equal to Sapphiron (living) (living)
    • Then - Actions
      • Unit - Pause all units
      • Unit - Set life of (Triggering unit) to (Real(((Owner of (Triggering unit)) Current gold)))
      • Unit - Set life of (Triggering unit) to 50.00%
      • Player - Set (Owner of (Triggering unit)) Current gold to (Integer((Life of (Triggering unit))))
      • Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( he lost 50% of his gold and now he got + (String(((Owner of (Triggering unit)) Current gold)))))
      • Wait 1.00 seconds
      • Unit - Kill (Triggering unit)
      • Unit - Unpause all units
    • Else - Actions
Second is like this.(if player win)
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Unit-type of (Triggering unit)) Equal to Sapphiron (living) (living)
      • Then - Actions
        • Unit - Pause all units
        • Unit - Set life of (Triggering unit) to (Real(((Owner of (Triggering unit)) Current gold)))
        • Unit - Set life of (Triggering unit) to 50.00%
        • Player - Add (Integer((Life of (Triggering unit)))) to (Owner of (Triggering unit)) Current gold
        • Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( he win 50% of his gold and now he got + (String(((Owner of (Triggering unit)) Current gold)))))
        • Wait 1.00 seconds
        • Unit - Kill (Triggering unit)
        • Unit - Unpause all units
      • Else - Actions
Any idea how to fix it to work ??
For this 50% lost ok i can make player gold / 2 = x right?
but how to do for 30% >lost&win< if i will use ( / )??
 
Status
Not open for further replies.
Top