ID:179635
 
I want to know how would i make it so when you attack something it sleeps for about a few seconds before the monster can attack
and vice versa for the player
before the line where npcattack() is called, put sleep(20) to make it wait 2 seconds before letting the npc attack, then do that for the other stuff as well... simple really
In response to Nebathemonk
Thanx
But i have one more question
when i put the battle area down on my map(The one where the person is supposed to appear on)It doesnt work but it says click on the monster to fight and its not y+2 ahead of me
and i was wondering if it is something i am doing or if it is a glith in the code/map and if you need to see the code just say so
thanx
In response to Greg
mob/proc
randomencounter1(mob/M)
var/turf/battlearea/T
for(T in world)
if(!T.occupied)
usr << sound('ff3batl2.mid',1)
T.occupied = 1
usr.oldlocx = usr.x
usr.oldlocy = usr.y
usr.oldlocz = usr.z
usr.battlearea = T
spawn(1)M.loc=(M.battlearea)
M.oldbattlefield = M.onbattlefield
M.onbattlefield = null
M << "Fight!"
M << "Click on the unit you wish to attack to start"
spawn(1) new/mob/Monster3 (locate(M.battlearea.x+1,M.battlearea.y,M.battlearea.z))

return 1
else
..()

that's what i have, and it works fine. I had to mess around with mine, it was a little jacked. I don't know if that's the problem, please post again if i didn't answer your question. (look at the code, make sure it's pretty much the same).
In response to Nebathemonk
well thanx again
Yet one more problem
when i get out of the battle it put me in the middle of the map wich i wasnt there before so could you plese tell me what else is worng(if there is any thing worng)
In response to Greg
Forget what i said
It happened becuase i died
lol stupid me
In response to Greg
Now hopefully my last question today
how can i change the chance of fighting
like how could ai lower it alot
In response to Greg
i'm not sure how you have the battle code defined, but I have it sorta like this.

mob/var/battlechance = "1d6"


mob
Move()
switch(onbattlefield)
if ("battlearea1")
var/chance = roll(battlechance)
switch(chance)
if(1,2)
randomencounter1(src)
return ..()
else
return ..()