ID:149501
 
Well, couldn't think of a better topic name, lol, but here goes:

I'm trying to make a magic system, and I need to know how to make an obj (the spell) that, when it hits a mob, will take reduce the target's hp by the caster's intelligence(let's just call it int). I would really appriciate some help =)

-Ashing
Having a var for the spells damage and using the Bump() proc should do the trick. When the player casts the spell set the spells damage var according to the casters stats. Then when it hits (Bumps) the target subtract he appropriate damage from the targets health.

obj/spell
var/damage = 0
Bump(var/mob/M)
if(ismob(M))
M.health -= damage

mob/verb
Cast()
var/obj/spell/S = new(loc)
S.damage = intelligence
//shoot spell

It won't fit your system exactly but you should get the idea.
In response to English
Thanks. That did help me out a lot!