ID:168708
 
how do i make a spell that when clicked gives you a list of mobs in view,select one,it follows the mob
I think you can look it up in the developer search center above you . Type magic icons and selecting mob code . Oh and by the way your game will not unzip. I think your runescape will be better. :)
mob/var/mob/move_to
mob/verb/move_to_spell(mob/M in oview())
set name = "Cast a spell to follow a mob on screen"
move_to=M
src << "You cast a spell! You will now follow [M.name]."
oview() << "[name] casts a spell! He will now follow [M.name]."
verbs += mob/proc/stop_following
mob/proc/stop_following()
set name = "Cancel following spell"
src << "You stop following.
move_to = null
verbs -= mob/proc/stop_following
mob/proc/follow()
if(move_to) step(src,get_dir(src,move_to))
sleep(1)
mob/New()
..()
spawn() {follow()}


Are you looking for something like that? The above snippet will make you follow the mob. Do you want the caster to follow the mob, or the spell?
In response to PirateHead
ya its something like that,but i need it to bump a mob and damage it for some hp
In response to EkstreM
obj/spell/var/mob/move_to
obj/spell/density=1
mob/verb/move_to_spell(mob/M in oview())
set name = "Cast a spell to damage another player"
var/obj/spell/s = new()
s.loc = src.loc
s.move_to=M
src << "You cast a spell! It will follow [M.name] until it hits!."
oview() << "[name] casts a spell! It will now follow [M.name] until it hits!"
obj/spell/proc/follow()
step(src,get_dir(src,move_to))
sleep(1)
obj/spell/New()
..()
spawn() {follow()}
mob/var/health = 15 //arbitrary amount
obj/spell/Bump(mob/M)
if(istype(M))
M.health -= 10 //another arbitrary amount
oview() << "You hear a wild crash as a magical spell slams into [M.name]!"
del src
else
oview() << "A macial spell slams harmlessly into [M.name]."
del src


Better? Magic missiles are a lot of fun!
In response to Master rla
can some one give my a working magic spell code that if you got 2 items you can cast it else you cant and when you cast it,it gives a list of mobs in oview and follows the selected mob,when it bums in to the mob it will blow up and hit the mob for 5 HP
In response to EkstreM
EkstreM wrote:
can some one give my a working magic spell code that if you got 2 items you can cast it else you cant and when you cast it,it gives a list of mobs in oview and follows the selected mob,when it bums in to the mob it will blow up and hit the mob for 5 HP

Thats asking for alot isnt it???
In response to Echtolion
ya its alot to ask for....... so can you give me the code for that,cuz i dono how to make it
In response to EkstreM
No, it's not a lot to ask for. In fact, it's very easy. I already gave you the tools you need (and probably working code, too!) right above this post. If you're too novice to understand that code, I'm sorry I spent five minutes writing it out.