• 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.

Gamble&Events {events: a tower destroys, a tower gets a buff... / chance of 2x gold}

Status
Not open for further replies.
Level 5
Joined
Nov 14, 2008
Messages
119
I'm currently making a TD map.

But i want it to have random events e.g a random tower destroys...a random tower gets buffed up...a random tower attacks faster..

and how do i make a "Gamble trigger"?

30% chance of winning x2 gold.

Thanks in advance +rep to anyone who helped.
 
Level 5
Joined
Feb 21, 2009
Messages
136
I'm not sure what you mean, but this is what i think you mean.
  • Random
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Guard Tower
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than 30
        • Then - Actions
          • Player - Add 1000 to (Owner of (Killing unit)) Current gold
        • Else - Actions
 
Level 5
Joined
Nov 14, 2008
Messages
119
No,i want the game to have a "gamble function"e.g when you press the "Gamble"theres 30% chance you can get x2 gold of what you gambled.

And i need random events like.Every 120 seconds..A tower will be destroyed or A Tower will have faster attack speed for a period of time or A tower will have more damage for a period of time
 
Level 11
Joined
Feb 14, 2009
Messages
884
You can create array variables of the type you want and make them get a random number whenever you want. (There is an option called Math - Random number)
 
Level 5
Joined
Feb 21, 2009
Messages
136
Pff..
  • Gamble
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Gamble
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Casting unit)) Current gold) Greater than 100
        • Then - Actions
          • Player - Add -100 to (Owner of (Casting unit)) Current gold
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 100) Less than 30
            • Then - Actions
              • Player - Add 200 to (Owner of (Casting unit)) Current gold
              • Game - Display to (All players) the text: u steal my moneyz :(
            • Else - Actions
              • Game - Display to (All players) the text: u suck lulz
        • Else - Actions
          • Game - Display to (All players) the text: not enuf gold lulz
 
Level 5
Joined
Nov 14, 2008
Messages
119
I think that will work,but how about the random events?

+rep

{EDIT}
Pff..
  • Gamble
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Gamble
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Casting unit)) Current gold) Greater than 100
        • Then - Actions
          • Player - Add -100 to (Owner of (Casting unit)) Current gold
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 100) Less than 30
            • Then - Actions
              • Player - Add 200 to (Owner of (Casting unit)) Current gold
              • Game - Display to (All players) the text: u steal my moneyz :(
            • Else - Actions
              • Game - Display to (All players) the text: u suck lulz
        • Else - Actions
          • Game - Display to (All players) the text: not enuf gold lulz

Could anyone put this trigger into a map so i can download it lol.cos i got stucked at
If - Conditions
((Owner of (Casting unit)) Current gold) Greater than 100
Then - Actions
Player - Add -100 to (Owner of (Casting unit)) Current gold
If (All Conditions are True) then do (Then Actions) else do (Else
 
Last edited by a moderator:
Level 12
Joined
May 4, 2008
Messages
1,111
Could anyone put this trigger into a map so i can download it lol.cos i got stucked at
If - Conditions
((Owner of (Casting unit)) Current gold) Greater than 100
Then - Actions
Player - Add -100 to (Owner of (Casting unit)) Current gold
If (All Conditions are True) then do (Then Actions) else do (Else

lol... u know there is a "look for text --> function? search for the words and it should work (not for the variables, only the basic static words in there)
 
Level 12
Joined
Jul 27, 2008
Messages
1,181
For the random events:
  • Events
    • Time - Every 120.00 seconds of game time
  • Conditions
  • Actions
    • Set Integer = (Random integer number between 1 and 5)
    • Set Tower = (Random unit from (Units in (Playable map area) matching (((Matching unit) is A structure) Equal to True)))
    • Unit - Add Ability[Integer] to Tower
    • Wait 5.00 seconds
    • Unit - Remove Ability[Integer] from Tower
Create an ability variable with as many values as the given abilities(speed, damage etc), a unit variable and an integer variable. Change ...between 1 and 5... to 1 and as many skills as you have.
 
Status
Not open for further replies.
Top