mob
var
owner
command = 2
itemn
item
grow
nhealth
npc
bear
icon = 'npc.dmi'
icon_state = "bear"
density = 1
nhealth = 50
New()
if(command == 2)
spawn(20)
step_rand(src)
New()
if(command == 4)
spawn(10)
for(var/mob/M in oview(6))
if(M in oview(6))
step_towards(src,M)
sleep(20)
New()
if(M in oview(5))
step_towards(src,M)
sleep(20)
New()
if(M in oview(4))
step_towards(src,M)
sleep(20)
New()
if(M in oview(3))
step_towards(src,M)
sleep(20)
New()
if(M in oview(2))
step_towards(src,M)
sleep(20)
New()
if(M in oview(1))
Attack()
sleep(20)
New()
Click()
if(src in oview(5))
if(usr.job == 10)
if(usr.hold == 11)
var/ran2 = rand(0,100)
if(ran2 < 3)
for(var/obj/O in usr)
if(O.suffix == "Equiped")
O.damage += 1
if(O.damage >= 100)
alert("You're tool got destroyed")
usr.hold = 0
usr.weight -= O.weight
usr.takeitem(O,usr.contents)
var/ran = rand(0,70)
if(ran <30)
missile(/obj/arrow, usr, src)
sleep(10)
var/dam = rand(1,15)
src.nhealth -= dam
src.command = 4
usr << "You did the bear [dam] damage"
else
usr << "You tried to shoot but where to nervous"
proc
Attack(mob/M in oview(1))
if(M.client)
var/dam=rand(1,14)
M.health -= dam
M << "You lost [dam]"
M.Deathcheck()
mob
proc
Deathcheck()
if(src.client)
if(src.health < 1)
for(var/obj/O in src)
del(O)
if(usr.gender == MALE)
usr.icon = 'dead.dmi'
usr.job = 9
usr.Move(locate(6,9,2))
usr.maxweight = 100
usr.density = 1
usr << "You died"
world <<"<center><font color=green>[usr] has died."
else
usr.icon = 'Fdead.dmi'
usr.job = 9
usr.Move(locate(6,9,2))
usr.maxweight = 100
usr.density = 1
usr << "You died."
world <<"<center><font color=green>[usr] has died."
else
if(src.nhealth <1)
new /obj/food/meat(src.loc)
del(src)
sleep(1200)
var/lo1 = rand(20,160)
var/lo2 = rand(20,200)
new/mob/npc/bear(lo1,lo2)
Problem description:
runtime error: Cannot read null.client
proc name: Attack (/mob/npc/bear/proc/Attack)
usr: the bear (/mob/npc/bear)
src: the bear (/mob/npc/bear)
call stack:
the bear (/mob/npc/bear): Attack(null)
the bear (/mob/npc/bear): New()
I get that error and the bear sometimes jumps 3 spots ahead while i gave it sleep
if(M) <-- So if there's an M..
Also, don't use usr in procs...
And, about the jumping tiles ahead, Be sure you don't have any loops running..