turf
randombattles
forest
Enter()
usr << "test"
spawn()usr.battlearea = "ba1"
mob/var/battlearea
mob
var
lastx
lasty
lastz
newbie = 1
mob
verb
test()
usr.random1()
var/mob/monster/M = new/mob/monster()
M.npcrandom1(usr)
mob
proc
random1()
var/x = rand(1,world.maxx-1)
var/y = rand(1,world.maxy-1)
usr.lastx = usr.x
usr.lasty = usr.y
usr.lastz = usr.z
if(forest1 == 0)
src.loc = locate(1,1,2)
src.battlearea = null
sleep(1)
src.x = x
src.y = y
src.inbattle = 1
forest1 = 1
src.turns = 4
npcrandom1(mob/M)
var/x = rand(1,world.maxx)
var/y = rand(1,world.maxy)
src.loc = locate(1,1,2)
sleep(1)
src.owner = M
src.x = x
src.y = y
src.turns = 4
ka_AI()
var/mob/M
for(M in world)
sleep(10)
if(src.owner == M)
if(M.in oview(1))
spawn() ka_AIattack(M)
else
if(src.turns > 0)
src.turns --
step_towards(src,M)
if(src.turns == 0)
M.turns = 4
M << "Your turn"
M.moveable = 1
src.moveable = 0
else
sleep(10)
src.ka_AI()
ka_AIattack(mob/M)
var/dmg = src.str - M.def+3
if(dmg > 0)
M.hp -= dmg
M << "[src] hit you for [dmg] damage"
death(M,src)
death(mob/M,mob/killer)
if(M.hp <= M.mhp)
M << "You died!!!"
M.loc = locate(M.lastx,M.lasty,M.lastz)
if(usr.newbie == 1)
M << "Since this is your first death you wont be charged any health, but next time you will lose half! be warned"
M.newbie = 0
else
M.hp = M.mhp*2.5
del(killer)
please help =)
--thanks in advance
Lummox JR