ID:145741
 
Code:
mob/proc/Death(var/mob/killer)
if(src.HP <= 0)
view(6) << "[killer] has killed [src]!"
killer.Exp+=src.Exp // Add exp
killer.Gil+=src.Gil
killer.Level_Up() // Run level checking proc
killer.Skill_Check()
src.Gil = 0
if(src.NPC == 1)
del src
if(src.Tantaum == 1)
if(src.NPC == 0)
src.loc = locate(69,13,1)
src.HP = src.Max_HP
src.MP = src.Max_MP
if(src.NPC == 0)
src.loc = locate(14,22,1)
src.HP = src.Max_HP
src.MP = src.Max_MP

That's my death check proc. I don't think it's even indented right anymore I've gotten so desperate.
obj/LMM
icon='spells.dmi'
icon_state = "LMM"
var/mob/creator
density=1
Bump(mob/M in world)
if(ismob(M))
var/damage = creator.Willpower + rand(30,50)
M.HP -= (damage)
M << "You're struck with a light magic missile for [damage]!"
creator << "You hit with Light Magic Missile for [damage]!"
del src
if(M.HP<=0)
M.Death(M)

This is my LMM.

mob/cleric/verb/Light_Magic_Missile()
if(usr.MP >= 20)
usr.MP -= 20
view() << sound("Hit2.wav")
usr.projectile(new/obj/LMM(usr.loc),usr.dir,6)
else
usr << "Not enough mana..."

And this is some more, probably irrelevant pieces to my LMM.

Problem description:
For some reason, when someone or something is attacked with a light magic missile, it will go into negative HPs. Now, this problem doesn't exist with my Attack verb. I cannot figure out why.

Thanks in advance,
Chance

If you delete the missile, the rest of the code doesn't execute. Move "del src" to the end.
In response to DarkCampainger
Okay, apperently that worked, and now it looks like this...

obj/LMM
icon='spells.dmi'
icon_state = "LMM"
var/mob/creator
density=1
Bump(mob/M in world)
if(ismob(M))
var/damage = creator.Willpower + rand(30,50)
M.HP -= (damage)
M << "You're struck with a light magic missile for [damage]!"
creator << "You hit with Light Magic Missile for [damage]!"
if(M.HP <= 0)
M.Death(creator)
del src


But now it wont display the message saying so and so killed so and so. It still works on my attack verb though. Help?

Thanks in advance,
Chance
In response to Chance777
obj/LMM
icon='spells.dmi'
icon_state = "LMM"
var/mob/creator
density=1
Bump(atom/M)
if(ismob(M))
var/damage = creator.Willpower + rand(30,50)
M.HP -= (damage)
M << "You're struck with a light magic missile for [damage]!"
creator << "You hit with Light Magic Missile for [damage]!"
if(M.HP <= 0) M.Death(creator)
del(src)

Fix'd.
In response to Sniper Joe
Er...Yeah. Thanks. I got it now. I fixed my other problem too. There were some indentation problems that weren't letting it work out how I wanted to. It's all fixed now. Thanks guys.

~~ Chance