ID:166088
 
Ok i have made a quest but it didnt work i cant give u the code because I deleted iti have a story i just dont know how to code it, this is the quest:

1) GO and see Kelmen he will tell you to kill 5 people and collect their souls then he will reward you by making you a deamon.

2)Kill 10 more people to recive the energy ball skill

3) He thanks you and he will sell u a pass to a place but you must pay him with soules
Variables is the key answer ... and maybe an array list as well to help reduce the clusters of variables scattered around (atleast, that's what I do but each their own)

List variable method (For non-list, simply make individual variables...)
mob/var/quest=list("quest1"=0,"quest2")//2 is not set =0 for a reason I will show.
mob/Quest_Giver
verb/Talk()//Setting up the verb
set src in oview(1)//See above, shows verb 1 step away from the mob
if(usr.quest["quest1"]==1)//I know you guys will say I should use if(var) ... but see a bit below, ==1 is neccesary here. This checks if the "quest1" in the quest var list is == 1
usr<<"Thanks"
usr.quest["quest1"]=2 //This is the reason why I did not use if(var)... keeping track I finished this quest
else if(!usr.quest["quest1"])//Note that I am not using ==0, that's because I want this to look for ALL false values.
usr<<"Talk to me again"
usr.quest["quest1"]=1
else
if(!usr.quest["quest2"])//if I used ==0 here, it wouldn't work... why not? Go here to find out: http://bwicki.byond.com/ByondBwicki.dmb?TrueFalse
usr<<"What? Ya like me or something?"
usr.quest["quest2"]=1
if(usr.quest["quest2"])//This, by all means, should be an 'else' because we already know if the if() above it didn't happen, than the value must be true... since I am not looking for a particular variable, I did NOT use ==1 here
usr<<"Eww, get away!"


- GhostAnime - Got confusious?
In response to GhostAnime
I dont get it..... can u make the quest for me
In response to Miran94
I will not make it for you, and I forgot to add some stuff in it as well >_>.

What you have to do is make a (few) variable(s) keeping track of what you want, in this case, the quest step the person is on and the soul count.

The quest step example is found in my last post, basically you just change the value for each step they complete.

For your soul part, it can go ATLEAST two ways, chose/make whatever you need:

1) The 'soul' is counted when you kill a person. You can do this by adding a soul count in the death proc, eg:
mob/proc/death(mob/Killer)//Short sweet example, not much safety checks used though you should.
if(src.hp>0)return
world<<"[src.name] has been killed by [Killer.name]"
Killer.soul_counter++//adds 1 to the soul_counter variable in the killer's mob.

mob/verb/Attack(mob/M in oview(1)) if(M)
M.hp-=873287
M.death(src)//showing how the deathproc will work



2) You can make the souls a "collectable item"... basically in the death proc, drop the soul item and ...well, I think it would be easier for you to do #1 >_> if this one isn't obvious as that one <_<


Now for the person checking, here's an example:
mob/NPC/SomeGuy
verb/Mehsag()
set src in oview(1)
if(!soulquest)
if(soul_counter>=5)
usr<<"Thank you for the souls!"
usr.soul_counter=min(0,soul_counter-5)//safety check.. don't get it? http://bwicki.byond.com/ByondBwicki.dmb?MinMax
soulquest=1
else usr<<"I need more souls!"
else if(soulquest==1)
if(soul_counter>=10)
usr<<"Thank you for the souls!"
usr.soul_counter=min(0,soul_counter-10)
soulquest=2
else usr<<"I need more souls!"
else if(soulquest==2)
if(soul_counter>=50)
usr<<"Thank you for the souls!"
usr.soul_counter=min(0,soul_counter-50)
soulquest=3
else usr<<"I need more souls!"
else
if(soul_counter>=100)
usr<<"Thank you for the souls!"
usr.soul_counter=min(0,soul_counter-100)
else
usr<<"I had enough of your insolence! Your soul is mine!"
usr.soul_counter=0
usr.hp=0
usr.death(src)

For the second method (soul item), you would have to see how many items there is... and it depends on how you set the item.. such as the counter is stored in an amount variable (stackable item) or loop through and see how many souls you have in the inventories... it all depends on how this is made, if you did this method, that is.

Don't get something? Ask specifically what you do not get about it

- GhostAnime - Don't forget to read the comments too - I think I forgot something...
In response to GhostAnime
I never really thought death was the nice kinda person...(grin)

mob
proc/DeathCheck(killer = killer ? killer : "unknown", addsoul = 1) // it's actually important not to put 'killer' in here, if you want a custom death or something.
if(addsoul) if(ismob(killer))
var/mob/k = killer
++ k.soulcount
world << "[src] has been killed by [killer]!"
// Death()

death
verb/Quest()
while(soulcount > soulneed)
soulneed *= 2
soulcount = max(soulcounter-soulneed, 0)
if(prob(50))
src << "Wha-- What!? You did it!?"
src << "Uh, I mean... Well, I lied. I actually need [soulneed] souls!"
else
src << "I'm sorry, something terrible has occured!"
src << "You see, well uh, an evil wizard has stole your reward! I need atleast [max(soulneed-soulcount,0)] more souls to renew your reward!" "