Welcome to the Builder Academy

Question Quick Question

More
06 Sep 2014 03:24 #5040 by Liko
Quick Question was created by Liko
Can we use triggers to check if a player has completed certain quests or not that would determine dialog or if a mob would let them pass or not?

Randian(0.0.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

More
06 Sep 2014 15:38 #5041 by Parnassus
Replied by Parnassus on topic Quick Question
This is odd. I was sure this was here but I can't find it. I hope it's what you're looking for.
Code:
Name: 'Tutorial Quest 1317 - Starter', VNum: [ 9], RNum: [ 9] Trigger Intended Assignment: Mobiles Trigger Type: Greet , Numeric Arg: 100, Arg list: None Commands: * By Rumble of The Builder Academy tbamud.com 9091 * Quest Trigs 9-12. If the player comes from the south and has not done the quest. if %direction% == south && %actor.varexists(solved_tutorial_quest_zone_0)% wait 1 sec say you have already completed this quest. wait 2 sec say but you can try it again if you so desire. Would you like to find the magic eight ball again? rdelete solved_tutorial_quest_zone_0 %actor.id% else wait 1 sec say Hello, %actor.name%. Could you find me the magic eight ball? say Please say yes, %actor.name%. end
Code:
Name: 'Tutorial Quest 1317 - Accept', VNum: [ 10], RNum: [ 10] Trigger Intended Assignment: Mobiles Trigger Type: Speech , Numeric Arg: 1, Arg list: yes Commands: * By Rumble of The Builder Academy tbamud.com 9091 * Quest Trigs 9-12. If the player has not done the quest give them a hint. if !%actor.varexists(solved_tutorial_quest_zone_0)% wait 1 sec say Perfect, %actor.name%. I'll make this easy. It is to the east. wait 3 sec say I'd go get it myself, but I'm lazy and you need the exercise. wait 1 sec end
Code:
Name: 'Tutorial Quest 1317 - Completion', VNum: [ 11], RNum: [ 11] Trigger Intended Assignment: Mobiles Trigger Type: Receive , Numeric Arg: 100, Arg list: None Commands: * By Rumble of The Builder Academy tbamud.com 9091 * Quest Trigs 9-12. If the player returns the right object reward them. if !%actor.varexists(solved_tutorial_quest_zone_0)% && %object.vnum% == 47 set solved_tutorial_quest_zone_0 1 remote solved_tutorial_quest_zone_0 %actor.id% %purge% %object% dance wait 1 sec say Thank you, %actor.name%. nop %actor.exp(50)% nop %actor.gold(50)% say finally, now I can get some answers. wait 1 sec emote shakes the magic eight ball vigorously. wait 1 sec emote does not seem too pleased with his answer. else say I don't want that! junk %object.name% end

Please Log in or Create an account to join the conversation.

More
08 Sep 2014 00:40 #5043 by WhiskyTest
Replied by WhiskyTest on topic Quick Question
I use this:

in dg_variables.c
inside void find_replacement()
at around line 950ish - mine is a bit edited now but just find the other Quest related things and add this:
Code:
case 'q': if (!IS_NPC(c) && (!str_cmp(field, "questpoints") || !str_cmp(field, "qp") || !str_cmp(field, "qpnts"))) { if (subfield && *subfield) { int addition = atoi(subfield); GET_QUESTPOINTS(c) += addition; } snprintf(str, slen, "%d", GET_QUESTPOINTS(c)); } else if (!str_cmp(field, "quest")) { if (!IS_NPC(c) && (GET_QUEST(c) != NOTHING) && (real_quest(GET_QUEST(c)) != NOTHING)) snprintf(str, slen, "%d", GET_QUEST(c)); else strcpy(str, "0"); } + else if (!str_cmp(field, "queston")) + { + if (!IS_NPC(c) && subfield && *subfield) { + int q_num = atoi(subfield); + if (GET_QUEST(c) == q_num) + strcpy(str, "1"); + else + strcpy(str, "0"); + } + else + strcpy(str, "0"); + } + else if (!str_cmp(field, "questdone")) + { + if (!IS_NPC(c) && subfield && *subfield) { + int q_num = atoi(subfield); + if (is_complete(c, q_num)) + strcpy(str, "1"); + else + strcpy(str, "0"); + } + else + strcpy(str, "0"); + } break; case 'r':

Then in your triggers use it like this:
if %actor.queston(100)%
This will return 1 if they are on quest 100, returns 0 if not
AND
if %actor.questdone(100)%
This will return 1 if they have completed quest 100, returns 0 if not.

Please Log in or Create an account to join the conversation.

Time to create page: 0.209 seconds