mob/var/quests = list()
FetchQuests
var
mob/M
quest_obj
reward_XP = 0
reward_object = "No Items"
reward_gold = 0
title
desc
thanks
question
finished = 0
proc
Check()
var/obj/O
O = locate (quest_obj) in M
if(O)
Reward(M)
Del(O)
return
else if(finished)
M << "[thanks]"
else
M << "[question]"
Reward(mob/M)
if(reward_object != "No Items")
new reward_object(M)
M.gebots += reward_gold
M.HP.addXP(reward_XP)
M << "<br><i>From this quest you have gained:</i> <br><b>[reward_XP]</b> XP<br><b>[reward_object]</b><br><b>[reward_gold] Gebots</b>"
M << "[thanks]"
finished = 1
Sample
quest_obj = /obj/SampleObj
reward_XP = 10
reward_object = "Sword of Butts"
reward_gold = 50
title = "Emblem - Reges"
desc = "I must get the Reges Emblem for one of the soldiers."
thanks = "<b>Reges Soldier</b>: Thanks, you've done the Reges a great service that we won't forget."
question = "<b>Reges Soldier</b>: Have you found the emblem yet, like I asked?"
obj/SampleObj
icon = 'Reges.dmi'
icon_state = "emblem"
verb/Take()
set src in oview(1)
src.loc = usr
mob/SampleQuest
name = "Reges Soldier"
icon = 'player.dmi'
var/FetchQuests/Sample/Q
verb/Talk()
set src in oview(1)
if(/FetchQuests/Sample in usr.quests)
Q.Check()
usr << "<b>[src]:</b> Hey, [usr]. Could you help us with something? We somehow left our emblem by a tree, and for some reason, it's important. I need you to find it for me, please."
usr.quests += Q
Problem description:
I can't make the Quest datum apply to the player himself. usr doesn't work, and if I add a proc like "StartQuest", my only option is to make another variable equivalent to M, which gives me errors. I don't know what to do!
You are checking if a type value is in a list. Obviously, an initialized quest will not be equal to the type.
I think this is more what you meant to do:
if(usr.quests.Find(Q))
Other than that, though, this is a miraculously inefficient way of going about designing your quest system. Give me a few minutes to give you some pointers.