ID:179600
 
Here's a small part of my "randomencounter" code:
(I am using zagreus battle system)

//this was in the mob/proc/randomencounter
spawn(1)new /mob/monster/Thief(locate(M.battlearea.x,M.battlearea.y-3,M.battlearea.z))


//rest of code here

I was wondering how i could make it choose between diferent types of monsters randomly. Could a rand() work here ?

Also, is there a way to add a second monster inside the same battlearea? I was thinking of adding a "||" after the first mob spawned.
Look up pick in the reference for help on random mobs. Yes, you could put multiple mobs in there by using some sort of loop.

-James
In response to Jmurph
Jmurph wrote:
Look up pick in the reference for help on random mobs. Yes, you could put multiple mobs in there by using some sort of loop.

-James

Thx, except for the "loop" i'll have to check more for that.

1 last thing...
In this code :

mob
Move()
switch(onbattlefield)
if ("area1")
var/chance = roll(battlechance)
switch(chance)
if(1,3,5,7,9,11)
randomencounter1(src)
return ..()

If I have more than 1 area, will it work if I add:

if("area1" || "area2" || "..." )

Thx in advance.