ID:262523
 
Code:
mob/Monster/wolf
icon = 'monsters.dmi'
icon_state = "Wolf"
HP = 25
Power = 7
expplus = 7
mob/Monster/Dwarf
icon = 'monsters.dmi'
icon_state = "Dwarf"
HP = 27
Power = 9
expplus = 9
var/tmp/GetItems
var/mob/player/P
New()
. = ..()
spawn()
Wander()
proc/Wander()
while(src)
var/Found = FALSE
for(P in oview(5,src))
step_towards(src,P)
Found = TRUE
break
if(Found != TRUE)
step_rand(src)
sleep(10)
sleep(5)
Bump(mob/M)
if(istype(M,/mob/player))
Attack2(M)

proc/Attack2(mob/M)
flick("attack",src)
sleep(2)
var/damage = rand(1,Power)
M.HP -= damage
view(src) << "[src] attacks [M]!"
view(src) << "[damage] damage!"
M.Death()


mob
proc
Death(mob/Monster/Dwarf,mob/Monster/Wolf)
if(src.type == /mob/player)
PlayerDie()
else
if(src.HP <= 0)
range() << "[src] has been killed by [usr]!!"
src.overlays -= 'Etc.dmi'
del(src)
PlayerDie(mob/player)
if(src.HP <= 0)
view() << "[src] died!"
src.loc = locate(2,5,1)
src.HP = MaxHP
src.MP = MaxMP


mob
proc
Check(mob/player/M)
if(usr.Exp>=usr.ExpNeed)
usr.LevelUp()

mob/player
verb// Verbs are like the players commands, like say, attack, etc.
Attack()//The Attack verb. Attacks a mob in view.
for(var/mob/M in get_step(src,src.dir))//If anybody is right next to them...
var/damage = rand(1,Power)// The Damage is between 1 and the players power.
src << "You attack [M] for [damage] damage!!"// Tell you how much damage you did.
M << "[src] attack you for [damage]!!!"// Tell the person who you attacked how much damage they got.
M.HP -= damage// Takes Hp away.
M.Death()//Calls the Death Proc, which checks if the player is dead.
src.Check()


Problem description:can some one help me with this for some reason even with the adice alot of ppl gave me or what thay said fix wich i did im still geting the monsters death proc with mobs

I see nothing wrong with this segment of code, and tried using it. You said that you were getting the monster death proc for mobs, which would mean it's deleting the usr. When I tried it, it didn't delete the mob, it just sent it back where it was supposed to. Perhaps there is something else in your game that is causing it. With that said, if anything, I would try


mob
proc
Death(mob/Monster/Dwarf,mob/Monster/Wolf)
if(src==usr)//this is the part i would suggest, seeing if the src is a usr
PlayerDie()
else
if(src.HP <= 0)
range() << "[src] has been killed by [usr]!!"
src.overlays -= 'Etc.dmi'
del(src)
In response to BrokenSouI
k ill try it