• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Help with a Random-Spawn trigger

Status
Not open for further replies.
Level 4
Joined
Aug 2, 2004
Messages
26
I am making a map that i geuss you could call like pokemon. But I plan for it to be much better than anything pokemon out there. Anyway, i have been triggering for a long time, but I mostly use simple triggers, cuz all that "from integer A do 1-10" stuff because it confuses me :). Anyway, there are 6 areas on the map, desert, ice, fire, mountain, water, and forest. How do i make a trigger spawn a random unit from a selection of units? I can't do the "random creep" function because then it would be spawning fire monsters in the ice area and so on and so forth. How do I do this?
 
Level 5
Joined
Jul 31, 2004
Messages
108
I took this from FF ORPG becuase I didn't want to make the trigger but here is the spawning

Planes
Events
Time - Every 10.00 seconds of game time
Conditions
(Number of units in (Units in Plains <gen> matching (((Matching unit) belongs to an enemy of Neutral Hostile) Equal to True))) Greater than 0
Actions
Set DiceRoll = (Random integer number between 1 and 10)
If (DiceRoll Equal to 1) then do (Unit - Create 1 Goblin for Neutral Hostile at (Random point in Plains <gen>) facing (Position of (Triggering unit))) else do (Do nothing)
If (DiceRoll Equal to 2) then do (Unit - Create 2 Goblin for Neutral Hostile at (Random point in Plains <gen>) facing (Position of (Triggering unit))) else do (Do nothing)
If (DiceRoll Equal to 3) then do (Unit - Create 3 Goblin for Neutral Hostile at (Random point in Plains <gen>) facing (Position of (Triggering unit))) else do (Do nothing)
If (DiceRoll Equal to 4) then do (Unit - Create 3 Rat for Neutral Hostile at (Random point in Plains <gen>) facing (Position of (Triggering unit))) else do (Do nothing)
If (DiceRoll Equal to 5) then do (Unit - Create 5 Sahagin for Neutral Hostile at (Random point in Plains <gen>) facing (Position of (Triggering unit))) else do (Do nothing)
If (DiceRoll Equal to 6) then do (Unit - Create 2 Sahagin for Neutral Hostile at (Random point in Plains <gen>) facing (Position of (Triggering unit))) else do (Do nothing)
If (DiceRoll Equal to 7) then do (Unit - Create 5 Rat for Neutral Hostile at (Random point in Plains <gen>) facing (Position of (Triggering unit))) else do (Do nothing)
If (DiceRoll Equal to 8) then do (Unit - Create 1 Rat for Neutral Hostile at (Random point in Plains <gen>) facing (Position of (Triggering unit))) else do (Do nothing)
If (DiceRoll Equal to 9) then do (Unit - Create 1 Sahagin for Neutral Hostile at (Random point in Plains <gen>) facing (Position of (Triggering unit))) else do (Do nothing)
If (DiceRoll Equal to 10) then do (Unit - Create 2 Rat for Neutral Hostile at (Random point in Plains <gen>) facing (Position of (Triggering unit))) else do (Do nothing)
Unit Group - Pick every unit in (Units in Plains <gen> owned by Neutral Hostile) and do (Unit - Order (Picked unit) to Patrol To (Position of (Random unit from (Units in Plains <gen> matching (((Matching unit) belongs to an enemy of Neutral Hostile) Equal to True)))))
Unit Group - Pick every unit in (Units in Plains <gen> owned by Neutral Hostile) and do (Unit - Make (Picked unit) Explode on death)

To Clear

Planes Clear
Events
Time - Every 10.00 seconds of game time
Conditions
(Number of units in (Units in Plains <gen> matching (((Matching unit) belongs to an enemy of Neutral Hostile) Equal to True))) Equal to 0
Actions
Unit Group - Pick every unit in (Units in Plains <gen> owned by Neutral Hostile) and do (Unit - Remove (Picked unit) from the game)

There you go.
 
Status
Not open for further replies.
Top