ID:272087
 
Here's what I got:

mob/Spell
verb
Vado_Calx()
set category = "Spells"
if(wandout == 1)
if(usr.pertr==0)
if(confound == 1)
usr.random=rand(1,2)
if(random == 1)
view(usr) << "<font color = teal><b><u>[usr]</b></u><font color = teal>:<i><font color = green> Vado Calx!"
new /obj/projectile/Calx(get_step(src, src.dir), src.dir, src, 3)
if(random == 2)
usr << "You raise your wand, only to find the spell leave your grasp"
return
else
view(usr) << "<font color = teal><b><u>[usr]</b></u><font color = teal>:<i><font color = green> Vado Calx!"
new /obj/projectile/Calx(get_step(src, src.dir), src.dir, src, 3)
else
usr<<"You cannot cast spells"
else
usr << "You must have your wand out!"

obj/projectile // Using a projectile subtype so
// similar objects like bullets,
// arrows, or darts can be added easily.

Calx
icon='attacks.dmi'
icon_state="calx"


density=1


New(start_loc, direction, shooter, delay)
src.shooter=shooter
if(!Move(start_loc, direction)) del src // The initial move is here in case someone is on the first tile.
spawn(delay)
while(step(src, direction))
sleep(delay)
del src

Bump(atom/A)
if(ismob(A))
var/mob/victim=A
view(A)<<"[shooter] hit [victim]!"
victim.hp -= 15
else
view(A)<<"[shooter]'s spell missed their intended target and hit [A]!"


How can I make it os the object will stop where it is after hitting the victim?
... delete it after it hit something? Duh!
Also, you should use if(prob(50)) instead of defining a variable called 'random' like that.

-- Data
In response to Android Data
Yes, I realise that. But I feel more comfortable with rand() since it's a 1-in-2 chance. Plus I've got millions of things like that. And if I delete it, I delete it. It wont stop which is what I want... But thanks, you made me realise somehing.
To stop a moveing obj simply
walk(src,0<dm> with src being what is to be stoped
In response to Lt. Pain
That does not apply here.
In response to Garthor
Yea it does, he puts it in the bump proc of his obj, for example
        Bump(A)
if(ismob(A))
view(M) << "[M] was hit by the [src]!!"
walk(src,0)

That makes it so if they get bumped it will say they where bumped and stop the object in its tracks
In response to Lt. Pain
This does not apply here as he is not using walk(). Please do not try to provide advice if you don't know what you're talking about.
In response to Garthor
Ok then lets see you give some advice on how to stop the thing o.O
In response to Lt. Pain
The "del src" after the movement loop has to be removed.
In response to Garthor
Don't worry. Just discovered a DM bug which wont let me put this into use without stuffing up my other spells.
In response to Demon_F0rce
A DM bug? Don't worry. I'm sure it's probably just your code.