mob/var
Quests[] = list()
EndQuests[] = list()
mob/proc/AddQuest(var/Quest)
for(var/Quest/Q)
usr<<"[Q]"
if(Q in usr.EndQuests)
usr<<"Quest End."
else if(Q in usr.Quests)
usr.QuestEnd(Quest)
usr<<"Finish Quest."
else
usr.quest.Add(Quest)
PlaySE(usr,'FX_Qst_Start.wav')
usr<<"Start QuestStart"
return
obj/NPCs
QuestMan
icon='NPCs.dmi'
icon_state = "Blader"
verb/Newquest()
set src in oview(1)
usr.AddQuest(new/Quest/Quest_1)
Problem description:
Welcome. I have a problem, how to fix the code to work. Because as I add the quest, and will use the procedure a second time, then instead of a check to me this quest adds the same again.
Sorry for English, I used transylator.
http://www.byond.com/docs/ref/info.html#/list
Alternatively, lists may be declared by using brackets, '[]'. Empty brackets indicate a list reference, exactly as /list does, so list/L is equivalent to L[]. Setting an initial size within the brackets, for instance, L[10], creates a list of that initial size.
Example:
__________________
Also, you're using the wrong variable for adding the quest into the list. You have usr.quest.Add(Quest), but you defined the variable Quests[]