ID:149481
 
Can anyone help me? I'm looking for a code that makes sure that players cannot attack or kill NCPs. Thanks.
Thanks, I really needed that help. I owe you one.
I usually make atoms responsible for their own damage with a damage() proc. When any attack hits, just call target.damage(amount). Mobs that can be hurt will apply the amount against their hp, other mobs won't.

mob
proc
damage(amount as num)

pc
damage(amount)
hp -= amount
if(hp<0) die()

verb/attack(mob/target in oview(1))
target.damage(3)