ID:160201
 
Code:
mob/powers/verb/Make_Charge(mob/M in oview(1))
if(M.race == "Witch") if(usr.race == "Whitelighter") M.whitelighter = "[usr.name]"
if(M.race == "Witch") if(usr.race == "Half Whitelighter") M.whitelighter = "[usr.name]"
if(M.race == "Witch") if(usr.race == "Half Whitelighter") usr.charge="[M.name]"
if(M.race == "Witch") if(usr.race == "Whitelighter") usr.charge="[M.name]"


What I Need:Ok i need if the charge ever says the whitelighter's name in any text like say or world say the whitelighter will automatically teleport to the charge's location
The code for picking a random whitelighter each time:
mob/var/list/wlighter = list()
mob/var/chosen_whitelighter = ""
mob/powers
verb
Call_WhiteLighter()
set category = "Commands"
for(var/mob/M in world)
if(M.race == "Whitelighter"||M.race == "Half Whitelighter")
wlighter.Add(M)
for(var/mob/B in wlighter)
chosen_whitelighter = Pick(B)
if(B == chosen_whitelighter)
B.loc = locate(usr.x,usr.y-1,usr.z)
B << "You've been chosen to help this witch out."
usr << "The whitelighter that has come is [B.name]"


I can't figure out how to do the way you're talking about because the whitelighter the witch might have might not be online at the time, which could cause runtime errors... But I hope this random call White Lighter code works for you if you can't get any other help.
this should handle it all

mob/var/whitelighter
mob/var/charge
mob/powers
verb
Say(msg as text)
if(findtext(msg,"[whitelighter]")
src.Call_Whiteligher()
oview()<<"[src]:[msg]"

mob
proc
Call_Whitelighter()
var/N = locate("[whitelighter]") in world
if(N)
N.loc = locate(src.x,src.y-1,src.z)
mob/powers/verb/Make_Charge(mob/M in oview(1))
if(M.race == "Witch")
if(usr.race == "Whitelighter"||usr.race == "Half Whitelighter")
M.whitelighter = "[usr.name]"
usr.charge="[M.name]"

In response to Eien_Chikara
in the second code i get an error src.Call_Whitelighter is missing a comma but idk where 2 put it 2 fix it
...wow. The logic in that code is mind-bogglingly bad. Simplify it:
mob/powers/verb/Make_Charge(mob/m in oview(1))
if(m.race == "Witch")
if(race == "Whitelighter" || race == "Half Whitelighter")
m.whitelighter = name
charge = m.name