ID:145252
 
Code:
mob/verb/Fire(mob/M as mob in oview(6))
set category = "Magic"
var/dmg = usr.str - M.def
usr<<"You did [dmg] damage to [M]."
usr.Mp -= 5
if(M.Hp <= 0)
usr.Exp += M.ExpG
usr.Gold += M.GoldG
usr<<"<b>You gained [M.ExpG] exp and [M.GoldG] gil.</b>"
usr.LevelUp()
del(M)
return ..()


Problem description:I tried murging an attack verb with magic. It works fine except I don't know how to make it so you see the spell get shot to the enemy, and the enemy never dies. Also how it takes away 5 Mp every time, how to I make it if I have 0 Mp I get a message saying I'm out of Mp? Thanks.

mob/verb/Fire(mob/M as mob in oview(6))
set category = "Magic"
var/dmg = usr.str - M.def
if(usr.Mp >= 5)
usr.Mp -= 5
usr<<"You did [dmg] damage to [M]."
missle('fire.dmi',usr.loc,M.loc)
M.Hp -= dmg
if(M.Hp <= 0)
usr.Exp += M.ExpG
usr.Gold += M.GoldG
usr<<"<b>You gained [M.ExpG] exp and [M.GoldG] gil.</b>"
usr.LevelUp()
del(M)
return ..()
else
usr<<"Message of no mp"


I don't know if this will work but it looks like it.

In response to Rage the Dark
That works except that you can't see the attack moving and hitting the enemy. Any idea why?