From b1ff0f2cbbf03cbda01945537dfd65f6cc6f4e53 Mon Sep 17 00:00:00 2001 From: wushin Date: Tue, 21 Apr 2015 13:42:04 -0500 Subject: Quest Log example --- world/map/conf/tmwa-map.conf | 2 + world/map/db/quest-log.txt | 13 +++++ world/map/npc/029-1/hasan.txt | 24 ++++----- world/map/npc/029-1/hideandseek.txt | 97 ++++++++++++++-------------------- world/map/npc/029-1/kaan.txt | 18 +++---- world/map/npc/029-1/soul-menhir.txt | 1 - world/map/npc/029-1/tutorial.txt | 25 ++------- world/map/npc/029-1/valon.txt | 43 ++++++--------- world/map/npc/029-1/vincent.txt | 22 ++------ world/map/npc/029-1/zegas.txt | 20 +++---- world/map/npc/029-2/barrels_config.txt | 18 +------ world/map/npc/029-2/morgan.txt | 33 ++++-------- world/map/npc/029-2/sorfina.txt | 43 ++++++--------- world/map/npc/029-2/tanisha.txt | 35 +++++------- world/map/npc/functions/mob_points.txt | 4 +- 15 files changed, 148 insertions(+), 250 deletions(-) create mode 100644 world/map/db/quest-log.txt (limited to 'world') diff --git a/world/map/conf/tmwa-map.conf b/world/map/conf/tmwa-map.conf index 10dd615e..478eb241 100644 --- a/world/map/conf/tmwa-map.conf +++ b/world/map/conf/tmwa-map.conf @@ -14,6 +14,8 @@ const_db: db/const-quest.txt const_db: db/const-mapflags.txt const_db: db/const-debugflag.txt +quest_db: db/quest-log.txt + item_db: db/item_db_chest.txt item_db: db/item_db_foot.txt item_db: db/item_db_generic.txt diff --git a/world/map/db/quest-log.txt b/world/map/db/quest-log.txt new file mode 100644 index 00000000..3802640d --- /dev/null +++ b/world/map/db/quest-log.txt @@ -0,0 +1,13 @@ +//Quest Log +//Quest ID: var id used by client +//CommonVar: Used in getq & to set +//ServerVar: Server Varaible value is stored +//SHIFT: Posistion shifted. (SHIFT * MASK) +//MASK: Size of shift to make. ((1 << MASK) - 1) << (SHIFT * MASK) +//Quest ID,CommonVar,ServerVar,SHIFT,MASK +1,QL_BEGIN,STARTAREA,0,4 +2,QL_VALON,STARTAREA,1,4 +3,QL_MORGAN,STARTAREA,3,4 +4,QL_ZEGAS,STARTAREA,4,4 +5,QL_VINCENT,QUEST_SouthTulimshar,4,2 +6,QL_HIDENSEEK,QUEST_NorthTulimshar,0,8 diff --git a/world/map/npc/029-1/hasan.txt b/world/map/npc/029-1/hasan.txt index a5d3894b..99e5ea1e 100644 --- a/world/map/npc/029-1/hasan.txt +++ b/world/map/npc/029-1/hasan.txt @@ -12,7 +12,7 @@ callfunc "PCtoNPCRange"; if (@npc_check) goto L_End; - if (@tutorial >= 13) + if (QL_BEGIN >= 13) goto L_TutDone; message strcharinfo(0), "He looks too afraid to say anything."; goto L_End; @@ -33,16 +33,15 @@ L_End: goto L_Main; L_Main: - callfunc "TutorialState"; if ((getcharid(3) == $@ScorpionFighter) || ($@ScorpionFighter && $@ScorpionFighter != getcharid(3))) goto L_Afraid; - if (@tutorial == 14) + if (QL_BEGIN == 14) goto L_TutDone; - if (@tutorial == 13) + if (QL_BEGIN == 13) goto L_Thank; - if (@tutorial == 12) + if (QL_BEGIN == 12) goto L_Trick; - if ((@tutorial == 9) || (@tutorial == 10) || (@tutorial == 11)) + if ((QL_BEGIN == 9) || (QL_BEGIN == 10) || (QL_BEGIN == 11)) goto L_FightAgain; mes "You over hear some people nearby."; @@ -60,8 +59,7 @@ L_Main: mes "[Scared Man]"; mes "\"No, please don't. *sob*\""; mes "Sounds like this person is in trouble.\""; - set @tutorial_tmp, 9; - callfunc "SetTutorialMask"; + set QL_BEGIN, 9; mes "[Unfriendly Guy]"; mes "\"What are you looking at?\""; menu @@ -112,8 +110,7 @@ L_Thank: mes "\"Let me tell you something, I will no longer bully people."; mes "And you can have my Sharp Knife.\""; getitem "SharpKnife", 1; - set @tutorial_tmp, 14; - callfunc "SetTutorialMask"; + set QL_BEGIN, 14; mes "\"You want to go to Hurnscald, right? Shall I tell you how to get there?\""; menu "Sure, thanks.",L_HasanThanks, @@ -152,7 +149,7 @@ L_Close: close; OnTouch: - if (@tutorial >= 13) + if (QL_BEGIN >= 13) end; goto L_Main; } @@ -187,10 +184,9 @@ OnTimer5000: OnScorpionDeath: if (getcharid(3) != $@ScorpionFighter) goto L_SummonAgain; - if (@tutorial != 12) + if (QL_BEGIN != 12) goto L_Clean; - set @tutorial_tmp, 13; - callfunc "SetTutorialMask"; + set QL_BEGIN, 13; message strcharinfo(0), "You saved Hasan."; goto L_Clean; diff --git a/world/map/npc/029-1/hideandseek.txt b/world/map/npc/029-1/hideandseek.txt index 51280978..a8cc5fa1 100644 --- a/world/map/npc/029-1/hideandseek.txt +++ b/world/map/npc/029-1/hideandseek.txt @@ -1,5 +1,5 @@ // Children playing Hide and Seek -// QUEST_NorthTulimshar +// QL_HIDENSEEK // BYTE 0 // Bit 0: started quest at Ayasha // Bit 1 - 5: found one of the kids each @@ -24,15 +24,15 @@ OnInit: function|script|CountHideNSeek { set @hidden_kid_cnt, 0; - if (QUEST_NorthTulimshar & $@hideandseekNT_found1) + if (QL_HIDENSEEK & $@hideandseekNT_found1) set @hidden_kid_cnt, (@hidden_kid_cnt + 1); - if (QUEST_NorthTulimshar & $@hideandseekNT_found2) + if (QL_HIDENSEEK & $@hideandseekNT_found2) set @hidden_kid_cnt, (@hidden_kid_cnt + 1); - if (QUEST_NorthTulimshar & $@hideandseekNT_found3) + if (QL_HIDENSEEK & $@hideandseekNT_found3) set @hidden_kid_cnt, (@hidden_kid_cnt + 1); - if (QUEST_NorthTulimshar & $@hideandseekNT_found4) + if (QL_HIDENSEEK & $@hideandseekNT_found4) set @hidden_kid_cnt, (@hidden_kid_cnt + 1); - if (QUEST_NorthTulimshar & $@hideandseekNT_found5) + if (QL_HIDENSEEK & $@hideandseekNT_found5) set @hidden_kid_cnt, (@hidden_kid_cnt + 1); return; } @@ -45,26 +45,25 @@ function|script|CountHideNSeek "Close.", L_Close; L_Show: - set @state, ((QUEST_NorthTulimshar & BYTE_0_MASK) >> BYTE_0_SHIFT); - mes "State: " + @state; - if (QUEST_NorthTulimshar & $@hideandseekNT_started) + mes "State: " + QL_HIDENSEEK; + if (QL_HIDENSEEK & $@hideandseekNT_started) mes "Start set"; - if (QUEST_NorthTulimshar & $@hideandseekNT_found1) + if (QL_HIDENSEEK & $@hideandseekNT_found1) mes "Found 1 set"; - if (QUEST_NorthTulimshar & $@hideandseekNT_found2) + if (QL_HIDENSEEK & $@hideandseekNT_found2) mes "Found 2 set"; - if (QUEST_NorthTulimshar & $@hideandseekNT_found3) + if (QL_HIDENSEEK & $@hideandseekNT_found3) mes "Found 3 set"; - if (QUEST_NorthTulimshar & $@hideandseekNT_found4) + if (QL_HIDENSEEK & $@hideandseekNT_found4) mes "Found 4 set"; - if (QUEST_NorthTulimshar & $@hideandseekNT_found5) + if (QL_HIDENSEEK & $@hideandseekNT_found5) mes "Found 5 set"; - if (QUEST_NorthTulimshar & $@hideandseekNT_ended) + if (QL_HIDENSEEK & $@hideandseekNT_ended) mes "Complete set"; goto L_Close; L_Reset: - set QUEST_NorthTulimshar, 0; + set QL_HIDENSEEK, 0; goto L_Close; L_Close: @@ -80,13 +79,11 @@ OnInit: set @child_number, 0; callfunc "XmasList"; - set @state, ((QUEST_NorthTulimshar & BYTE_0_MASK) >> BYTE_0_SHIFT); - set @EXP, 75; - if (@state > 63) goto L_Done; - if (@state == 63) goto L_Reward; - if (@state > 0) goto L_Doing; + if (QL_HIDENSEEK > 63) goto L_Done; + if (QL_HIDENSEEK == 63) goto L_Reward; + if (QL_HIDENSEEK > 0) goto L_Doing; mes "You see a girl who is holding her hands in front of her face."; mes "[Ayasha]"; @@ -109,7 +106,7 @@ L_Next1: mes "\"Great! You can take my turn with searching. You need to find all five of my friends."; mes "They're hiding somewhere on the island, you will have to explore to find them. They could be hiding anywhere.\""; - set QUEST_NorthTulimshar, QUEST_NorthTulimshar | $@hideandseekNT_started; + set QL_HIDENSEEK, QL_HIDENSEEK | $@hideandseekNT_started; goto L_Close; L_Doing: @@ -123,7 +120,7 @@ L_Reward: mes "[Ayasha]"; mes "\"Oh, you found them all! Good job! Now it's my turn with searching again. Go and hide!\""; getexp @EXP, 0; - set QUEST_NorthTulimshar, QUEST_NorthTulimshar | $@hideandseekNT_ended; + set QL_HIDENSEEK, QL_HIDENSEEK | $@hideandseekNT_ended; menu "I think I need to do other things now.",L_Next2; @@ -140,7 +137,6 @@ L_Done: goto L_Close; L_Close: - set @state, 0; set @EXP, 0; close; } @@ -149,13 +145,11 @@ L_Close: { set @child_number, 1; callfunc "XmasList"; - set @state, ((QUEST_NorthTulimshar & BYTE_0_MASK) >> BYTE_0_SHIFT); - set @EXP, 15; - if (@state > 63) goto L_Done; - if ((@state > 0) && !(QUEST_NorthTulimshar & $@hideandseekNT_found1)) goto L_Find; - if (@state > 0) goto L_Doing; + if (QL_HIDENSEEK > 63) goto L_Done; + if ((QL_HIDENSEEK > 0) && !(QL_HIDENSEEK & $@hideandseekNT_found1)) goto L_Find; + if (QL_HIDENSEEK > 0) goto L_Doing; mes "You see a kid hiding behind a box."; menu @@ -185,7 +179,7 @@ L_Find: mes "[Latif]"; mes "\"Hey! Ah, you found me. Well done. But my hiding place wasn't that difficult this time.\""; getexp @EXP, 0; - set QUEST_NorthTulimshar, QUEST_NorthTulimshar | $@hideandseekNT_found1; + set QL_HIDENSEEK, QL_HIDENSEEK | $@hideandseekNT_found1; mes "\"Here, do you want a candy?\""; getitem "Candy", 1; goto L_Close; @@ -203,7 +197,6 @@ L_Done: goto L_Close; L_Close: - set @state, 0; set @EXP, 0; close; } @@ -212,13 +205,11 @@ L_Close: { set @child_number, 2; callfunc "XmasList"; - set @state, ((QUEST_NorthTulimshar & BYTE_0_MASK) >> BYTE_0_SHIFT); - set @EXP, 15; - if (@state > 63) goto L_Done; - if ((@state > 0) && !(QUEST_NorthTulimshar & $@hideandseekNT_found2)) goto L_Find; - if (@state > 0) goto L_Doing; + if (QL_HIDENSEEK > 63) goto L_Done; + if ((QL_HIDENSEEK > 0) && !(QL_HIDENSEEK & $@hideandseekNT_found2)) goto L_Find; + if (QL_HIDENSEEK > 0) goto L_Doing; mes "[Charda]"; mes "\"Hello. Psht, be careful. I'm playing hide and seek with Ayasha. You'll draw attention to my hiding place.\""; @@ -229,7 +220,7 @@ L_Find: mes "[Charda]"; mes "\"Oh! Got me! You're good at this.\""; getexp @EXP, 0; - set QUEST_NorthTulimshar, QUEST_NorthTulimshar | $@hideandseekNT_found2; + set QL_HIDENSEEK, QL_HIDENSEEK | $@hideandseekNT_found2; mes "She takes something out of her pocket."; mes "\"I'm hungry now. Do you want chocolate too?\""; getitem "ChocolateBar", 1; @@ -254,7 +245,6 @@ L_Done: goto L_Close; L_Close: - set @state, 0; set @EXP, 0; close; } @@ -263,13 +253,11 @@ L_Close: { set @child_number, 3; callfunc "XmasList"; - set @state, ((QUEST_NorthTulimshar & BYTE_0_MASK) >> BYTE_0_SHIFT); - set @EXP, 25; - if (@state > 63) goto L_Done; - if ((@state > 0) && !(QUEST_NorthTulimshar & $@hideandseekNT_found3)) goto L_Find; - if (@state > 0) goto L_Doing; + if (QL_HIDENSEEK > 63) goto L_Done; + if ((QL_HIDENSEEK > 0) && !(QL_HIDENSEEK & $@hideandseekNT_found3)) goto L_Find; + if (QL_HIDENSEEK > 0) goto L_Doing; mes "[Faris]"; mes "\"Oh, hi there. What are you doing here on the beach?\""; @@ -287,7 +275,7 @@ L_Find: mes "\"You found me! Well done. You look a bit thirsty, here.\""; getexp @EXP, 0; getitem "CactusDrink", 1; - set QUEST_NorthTulimshar, QUEST_NorthTulimshar | $@hideandseekNT_found3; + set QL_HIDENSEEK, QL_HIDENSEEK | $@hideandseekNT_found3; mes "\"It's really cool you're playing with us. I'm sure you have a lot of other things to do."; mes "You're an adventurer, right? I want to become an adventurer too when I'm grown up. I'll talk to Aidan then.\""; mes "\"Aidan is outside Sorfina's place and you can register there for monster points. That's something the Wizard's Council made up. They reward you for slaying monsters. It's so cool.\""; @@ -306,7 +294,6 @@ L_Done: goto L_Close; L_Close: - set @state, 0; set @EXP, 0; close; } @@ -315,13 +302,12 @@ L_Close: { set @child_number, 4; callfunc "XmasList"; - set @state, ((QUEST_NorthTulimshar & BYTE_0_MASK) >> BYTE_0_SHIFT); set @EXP, 15; - if (@state > 63) goto L_Done; - if ((@state > 0) && !(QUEST_NorthTulimshar & $@hideandseekNT_found4)) goto L_Find; - if (@state > 0) goto L_Doing; + if (QL_HIDENSEEK > 63) goto L_Done; + if ((QL_HIDENSEEK > 0) && !(QL_HIDENSEEK & $@hideandseekNT_found4)) goto L_Find; + if (QL_HIDENSEEK > 0) goto L_Doing; mes "[Rasin]"; mes "\"The harbor is to the south from here. There you can take a ferry to other places."; @@ -332,7 +318,7 @@ L_Find: mes "[Rasin]"; mes "\"Ah, you found me. I need to find a better place to hide next time.\""; getexp @EXP, 0; - set QUEST_NorthTulimshar, QUEST_NorthTulimshar | $@hideandseekNT_found4; + set QL_HIDENSEEK, QL_HIDENSEEK | $@hideandseekNT_found4; goto L_Close; L_Doing: @@ -349,7 +335,6 @@ L_Done: goto L_Close; L_Close: - set @state, 0; set @EXP, 0; close; } @@ -358,13 +343,12 @@ L_Close: { set @child_number, 5; callfunc "XmasList"; - set @state, ((QUEST_NorthTulimshar & BYTE_0_MASK) >> BYTE_0_SHIFT); set @EXP, 15; - if (@state > 63) goto L_Done; - if ((@state > 0) && !(QUEST_NorthTulimshar & $@hideandseekNT_found5)) goto L_Find; - if (@state > 0) goto L_Doing; + if (QL_HIDENSEEK > 63) goto L_Done; + if ((QL_HIDENSEEK > 0) && !(QL_HIDENSEEK & $@hideandseekNT_found5)) goto L_Find; + if (QL_HIDENSEEK > 0) goto L_Doing; mes "You see a girl standing behind the wheat. She has a look of intense concentration on her face."; menu @@ -381,7 +365,7 @@ L_Find: mes "\"Oh no! You found me! You must be very clever."; mes "My friend Sandra is clever too, but she said it's a waste of time to play hide and seek.\""; getexp @EXP, 0; - set QUEST_NorthTulimshar, QUEST_NorthTulimshar | $@hideandseekNT_found5; + set QL_HIDENSEEK, QL_HIDENSEEK | $@hideandseekNT_found5; goto L_Close; L_Doing: @@ -397,7 +381,6 @@ L_Done: goto L_Close; L_Close: - set @state, 0; set @EXP, 0; close; } diff --git a/world/map/npc/029-1/kaan.txt b/world/map/npc/029-1/kaan.txt index 1c3cf0bb..57ab1d4c 100644 --- a/world/map/npc/029-1/kaan.txt +++ b/world/map/npc/029-1/kaan.txt @@ -8,13 +8,13 @@ if (@npc_check) goto L_OutOfRange; - callfunc "TutorialState"; + set @kaan_talked, (STARTAREA & $@SpokeToKaan); if (!(@kaan_talked)) goto L_Tanisha; - if (@tutorial >= 13) goto L_TutDone; - if (@tutorial == 12) goto L_Plan; - if (@tutorial == 11) goto L_TrickKnown; - if (@tutorial == 10) goto L_Trick; - if (@tutorial == 9) goto L_Hasan; + if (QL_BEGIN >= 13) goto L_TutDone; + if (QL_BEGIN == 12) goto L_Plan; + if (QL_BEGIN == 11) goto L_TrickKnown; + if (QL_BEGIN == 10) goto L_Trick; + if (QL_BEGIN == 9) goto L_Hasan; goto L_Out; L_OutOfRange: @@ -69,8 +69,7 @@ L_Next1: mes "\"Sometimes he just freaks out and then he's dangerous."; mes "He might listen to one of the adult men, but they're all off to work in Hurnscald during the day.\""; mes "\"We should think about some kind of trick. Ah, if only I knew his weak point.\""; - set @tutorial_tmp, 10; - callfunc "SetTutorialMask"; + set QL_BEGIN, 10; goto L_Trick; L_Trick: @@ -91,8 +90,7 @@ L_Next2: mes "[Kaan]"; mes "\"Scorpions?! Right! How could I forget?"; mes "When he was a child, he nearly died because he fell into a scorpion nest.\""; - set @tutorial_tmp, 12; - callfunc "SetTutorialMask"; + set QL_BEGIN, 12; next; goto L_Explain; diff --git a/world/map/npc/029-1/soul-menhir.txt b/world/map/npc/029-1/soul-menhir.txt index d38f5e85..8113d9c5 100644 --- a/world/map/npc/029-1/soul-menhir.txt +++ b/world/map/npc/029-1/soul-menhir.txt @@ -2,7 +2,6 @@ 029-1,39,101,0|script|Soul Menhir#candor|344 { - callfunc "ClearVariables"; set @map$, "029-1"; setarray @Xs, 38, 39, 40, 38, 40, 38, 39, 40; setarray @Ys, 100, 100, 100, 101, 101, 102, 102, 102; diff --git a/world/map/npc/029-1/tutorial.txt b/world/map/npc/029-1/tutorial.txt index ddaea587..76124ef6 100644 --- a/world/map/npc/029-1/tutorial.txt +++ b/world/map/npc/029-1/tutorial.txt @@ -12,19 +12,6 @@ OnInit: set $@SpokeToKaan, (1 << 31); end; } -function|script|TutorialState -{ - callfunc "ClearVariables"; - set @tutorial, ((STARTAREA & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT); - set @kaan_talked, (STARTAREA & $@SpokeToKaan); - return; -} -function|script|SetTutorialMask -{ - set STARTAREA, (STARTAREA & ~(NIBBLE_0_MASK) | (@tutorial_tmp << NIBBLE_0_SHIFT)); - set @tutorial_tmp, 0; - return; -} 029-2,21,26,0|script|TutDebug|154 { mes "[TutDebug]"; @@ -35,16 +22,14 @@ function|script|SetTutorialMask "No.",L_Close; L_Kaan: - set @tutorial_tmp, 8; - set STARTAREA, (STARTAREA & ~(NIBBLE_0_MASK) | (@tutorial_tmp << NIBBLE_0_SHIFT)); + set QL_BEGIN, 8; set STARTAREA, STARTAREA &~ $@SpokeToKaan; mes "Reset!"; goto L_Close; L_Reset: set TUT_var, 0; - set @tutorial_tmp, 0; - set STARTAREA, (STARTAREA & ~(NIBBLE_0_MASK) | (@tutorial_tmp << NIBBLE_0_SHIFT)); + set QL_BEGIN, 0; set STARTAREA, STARTAREA &~ $@SpokeToKaan; mes "Reset!"; goto L_Close; @@ -59,14 +44,12 @@ OnInit: } 029-1,32,99,0|script|#tutorialoutside|45,0,0 { - callfunc "TutorialState"; - if (@tutorial >= 8) + if (QL_BEGIN >= 8) goto L_Warp; goto L_ResetTutorial; L_ResetTutorial: - set @tutorial_tmp, 8; - callfunc "SetTutorialMask"; + set QL_BEGIN, 8; goto L_Warp; L_Warp: diff --git a/world/map/npc/029-1/valon.txt b/world/map/npc/029-1/valon.txt index 49bb6c5d..89398635 100644 --- a/world/map/npc/029-1/valon.txt +++ b/world/map/npc/029-1/valon.txt @@ -10,21 +10,14 @@ OnInit: setarray $@ValonMobCnt, 10,5,3,1; end; } -function|script|ValonState +function|script|ValonCount { - set @valon_state, ((STARTAREA & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT); set @valon_mob, 0; - if (@valon_state >= 2) - set @valon_mob, (@valon_state - 2); + if (QL_VALON >= 2) + set @valon_mob, (QL_VALON - 2); set @valon_count, ((STARTAREA & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT); return; } -function|script|setValonMask -{ - set STARTAREA, (STARTAREA & ~(NIBBLE_1_MASK) | (@valon_tmp << NIBBLE_1_SHIFT)); - set @valon_tmp, 0; - return; -} function|script|ResetValonCntMask { set STARTAREA, (STARTAREA & ~(NIBBLE_2_MASK) | (0 << NIBBLE_2_SHIFT)); @@ -42,8 +35,8 @@ function|script|AddValonCntMask } function|script|ValonProgress { - callfunc "ValonState"; - if ((@valon_state > 1) && (@valon_state < 6)) + callfunc "ValonCount"; + if ((QL_VALON > 1) && (QL_VALON < 6)) message strcharinfo(0), $@ValonMobName$[@valon_mob] + ": " + @valon_count + "/" + $@ValonMobCnt[@valon_mob]; return; } @@ -56,7 +49,7 @@ function|script|ValonProgress "No.", L_Close; L_Reset: - set STARTAREA, (STARTAREA & ~(NIBBLE_1_MASK) | (0 << NIBBLE_1_SHIFT)); + set QL_VALON, 0; set STARTAREA, (STARTAREA & ~(NIBBLE_2_MASK) | (0 << NIBBLE_2_SHIFT)); mes "Reset!"; goto L_Close; @@ -75,14 +68,14 @@ OnInit: callfunc "PCtoNPCRange"; if (@npc_check) goto L_Close; - callfunc "ValonState"; - if (@valon_state >= 6) + callfunc "ValonCount"; + if (QL_VALON >= 6) goto L_QuestComplete; - if (@valon_start == 1) + if (QL_VALON == 1) goto L_QuestAskAgain; if (@valon_count >= $@ValonMobCnt[@valon_mob]) goto L_NextMob; - if ((@valon_state >= 2) && (@valon_state < 6)) + if ((QL_VALON >= 2) && (QL_VALON < 6)) goto L_QuestStarted; goto L_QuestAsk; @@ -102,17 +95,15 @@ L_QuestAsk: mes "\"I should know I guard this gate from all manner of island beasts.\""; mes "\"Maybe you would like help and earn your stripes?\""; mes "\"The Council of Wizard's does offer a reward for helping...\""; - set @valon_tmp, 1; - callfunc "setValonMask"; + set QL_VALON, 1; callfunc "ResetValonCntMask"; menu "YES!!! let me at them!", L_Accept, "Maybe some other time.", L_Close; L_Accept: - set @valon_tmp, 2; - callfunc "setValonMask"; - callfunc "ValonState"; + set QL_VALON, 2; + callfunc "ValonCount"; goto L_NewMob; L_NextMob: @@ -120,10 +111,9 @@ L_NextMob: mes "\"I see you killed all the " + $@ValonMobName$[@valon_mob] + " needed.\""; mes "\"The Wizard's thank thee as well.\""; set Zeny, Zeny + 25; - set @valon_tmp, (@valon_state + 1); - callfunc "setValonMask"; + set QL_VALON, (QL_VALON + 1); callfunc "ResetValonCntMask"; - callfunc "ValonState"; + callfunc "ValonCount"; if (@valon_mob == getarraysize($@ValonMob)) goto L_QuestOver; goto L_NewMob; @@ -144,8 +134,7 @@ L_QuestOver: mes "[Valon]"; mes "\"Thanks once again for helping with the monsters in the island.\""; getexp 50, 0; - set @valon_tmp, (@valon_state + 1); - callfunc "setValonMask"; + set QL_VALON, (QL_VALON + 1); goto L_Close; L_QuestComplete: diff --git a/world/map/npc/029-1/vincent.txt b/world/map/npc/029-1/vincent.txt index 2d70b6de..ab157e25 100644 --- a/world/map/npc/029-1/vincent.txt +++ b/world/map/npc/029-1/vincent.txt @@ -9,7 +9,7 @@ "No.", L_Close; L_Reset: - set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_2_MASK) | (0 << NIBBLE_2_SHIFT)); + set QL_VINCENT, 0; mes "Reset!"; goto L_Close; @@ -23,15 +23,11 @@ OnInit: } 029-1,107,110,0|script|Vincent|113 { - // This NPC previously used the variable TMW_Quest - callfunc "ClearVarTMW_Quest"; set @halloween_npc_id, $@halloween_npc_vincent; callfunc "TrickOrTreat"; - set @state, ((QUEST_SouthTulimshar & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT); - - if (@state >= 2) goto L_Done; - if (@state == 1) goto L_Progress; + if (QL_VINCENT >= 2) goto L_Done; + if (QL_VINCENT == 1) goto L_Progress; goto L_Con_Vin_First; L_Con_Vin_First: @@ -73,8 +69,7 @@ L_Ask: "No.", L_Close; L_Sure: - set @state, 1; - callsub S_Update_Var; + set QL_VINCENT, 1; set @TEMP, rand(4); if(@TEMP == 1) goto L_Req2; if(@TEMP == 2) goto L_Req3; @@ -125,8 +120,7 @@ L_Have: delitem "BugLeg", 5; getexp 50, 0; set Zeny, Zeny + 1000; - set @state, 2; - callsub S_Update_Var; + set QL_VINCENT, 2; mes "[Vincent]"; mes "\"Here you go, a little of my appreciation!\""; @@ -140,11 +134,5 @@ L_Done: goto L_Close; L_Close: - set @TEMP, 0; - set @state, 0; close; - -S_Update_Var: - set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_2_MASK) | (@state << NIBBLE_2_SHIFT)); - return; } diff --git a/world/map/npc/029-1/zegas.txt b/world/map/npc/029-1/zegas.txt index f9cefcbd..49b9a5c5 100644 --- a/world/map/npc/029-1/zegas.txt +++ b/world/map/npc/029-1/zegas.txt @@ -8,14 +8,13 @@ if (@npc_check) goto L_Range; - callfunc "CheckBarrelQuest"; - if (@barrel_quest == 1) + if (QL_ZEGAS == 1) goto L_Find; - if (@barrel_quest == 2) + if (QL_ZEGAS == 2) goto L_Looking; - if (@barrel_quest == 3) + if (QL_ZEGAS == 3) goto L_QuestEnd; - if (@barrel_quest == 4) + if (QL_ZEGAS == 4) goto L_Thanks; goto L_Meet; @@ -32,8 +31,7 @@ L_Meet: mes "\"Wouldn't you know it, the bug bomb Eomie gave us is in one of the store room barrels.\""; next; mes "\"Can you search the barrels for the bug bomb and set it off when you find it?\""; - set @barrel_tmp, 1; - callfunc "SetBarrelMask"; + set QL_ZEGAS, 1; menu "Sure.",L_Start, "Maybe some other time.",L_Close; @@ -49,8 +47,7 @@ L_Find: L_Start: mes "[Zegas]"; - set @barrel_tmp, 2; - callfunc "SetBarrelMask"; + set QL_ZEGAS, 2; mes "\"Thanks, come back and see me once you found the bug bomb and set it off.\""; goto L_Close; @@ -65,8 +62,7 @@ L_QuestEnd: mes "\"Thanks once again, I know it's not much but here is 50 GP for your troubles.\""; getexp 50, 0; set Zeny, (Zeny + 50); - set @barrel_tmp, 4; - callfunc "SetBarrelMask"; + set QL_ZEGAS, 4; goto L_Close; L_Thanks: @@ -86,7 +82,7 @@ L_Close: "No.", L_Close; L_Reset: - set STARTAREA, (STARTAREA & ~(NIBBLE_4_MASK) | (0 << NIBBLE_4_SHIFT)); + set QL_ZEGAS, 0; set STARTAREA, STARTAREA &~ (1 << 20); set STARTAREA, STARTAREA &~ (1 << 21); set STARTAREA, STARTAREA &~ (1 << 22); diff --git a/world/map/npc/029-2/barrels_config.txt b/world/map/npc/029-2/barrels_config.txt index 665903fb..1b83d25b 100644 --- a/world/map/npc/029-2/barrels_config.txt +++ b/world/map/npc/029-2/barrels_config.txt @@ -14,18 +14,6 @@ OnInit: set $@BarrelMax, getarraysize($@BarrelBits); end; } -function|script|SetBarrelMask -{ - set STARTAREA, (STARTAREA & ~(NIBBLE_4_MASK) | (@barrel_tmp << NIBBLE_4_SHIFT)); - set @barrel_tmp, 0; - return; -} -function|script|CheckBarrelQuest -{ - callfunc "CountBarrels"; - set @barrel_quest, ((STARTAREA & NIBBLE_4_MASK) >> NIBBLE_4_SHIFT); - return; -} function|script|CountBarrels { set @barrel_count, 0; @@ -55,8 +43,7 @@ function|script|CheckBarrel callfunc "PCtoNPCRange"; if (@npc_check) goto L_Range; - callfunc "CheckBarrelQuest"; - if (!(@barrel_quest == 2)) + if (!(QL_ZEGAS == 2)) goto L_NoI; if (STARTAREA & $@BarrelBits[@barrel]) goto L_Empty; @@ -86,8 +73,7 @@ L_Empty: L_QuestReward: message strcharinfo(0), "You found the bug bomb."; misceffect 33; - set @barrel_tmp, 3; - callfunc "SetBarrelMask"; + set QL_ZEGAS, 3; killmonster getmap() + "", "Barrel#0::OnMaggotDeath"; goto L_Return; diff --git a/world/map/npc/029-2/morgan.txt b/world/map/npc/029-2/morgan.txt index f6679f67..605169ab 100644 --- a/world/map/npc/029-2/morgan.txt +++ b/world/map/npc/029-2/morgan.txt @@ -3,18 +3,6 @@ // Gains Access to Magic School // See 024-2 clean that shit up // Morgan, liana -function|script|MorganState -{ - callfunc "ClearVariables"; - set @morgan, ((STARTAREA & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT); - return; -} -function|script|SetMorganMask -{ - set STARTAREA, (STARTAREA & ~(NIBBLE_3_MASK) | (@morgan_tmp << NIBBLE_3_SHIFT)); - set @morgan_tmp, 0; - return; -} 029-2,105,57,0|script|MorganDebug|355 { mes "[Morgan Debug]"; @@ -23,7 +11,7 @@ function|script|SetMorganMask "Yes.", L_Reset, "No.", L_End; L_Reset: - set STARTAREA, (STARTAREA & ~(NIBBLE_3_MASK) | (0 << NIBBLE_3_SHIFT)); + set QL_MORGAN, 0; mes "Reset!"; goto L_End; @@ -37,6 +25,7 @@ OnInit: } 029-2,101,57,0|script|Morgan#_M|355 { + callfunc "ClearVariables"; setarray @npc_loc, 101, 57, 4; callfunc "PCtoNPCRange"; if (@npc_check) @@ -47,21 +36,20 @@ OnInit: goto L_NotMagic; L_Learn: - if (@morgan == 0) + if (QL_MORGAN == 0) goto L_NotSeen; - if (@morgan == 1) + if (QL_MORGAN == 1) goto L_Seen; - if (@morgan == 2) + if (QL_MORGAN == 2) goto L_Started; - if (@morgan == 3) + if (QL_MORGAN == 3) goto L_CastOnce; - if (@morgan == 4) + if (QL_MORGAN == 4) goto L_LearningDone; goto L_Close; L_NotSeen: - set @morgan_tmp, 1; - callfunc "SetMorganMask"; + set QL_MORGAN, 1; mes "[Morgan]"; mes "\"Welcome to the magic school of Candor\""; mes "\"My name is Morgan, I'm Head of Wizardry.\""; @@ -86,8 +74,7 @@ L_NotMagic: goto L_Close; L_Start: - set @morgan_tmp, 2; - callfunc "SetMorganMask"; + set QL_MORGAN, 2; mes "\"Great, lets begin your first lesson.\""; getitem 1171, 1; mes "\"This is a wand, there are many like it but this one is now yours.\""; @@ -115,8 +102,6 @@ L_CastOnce: mes "\"Each time you attack the wand will convert a bit of you mana into a magic bolt.\""; mes "\"After so many attacks, you will need to recast the invocation to stay attuned to the wand.\""; mes "\"(Logging out will also cancel any spell effects currently active in-game.).\""; - set @morgan_tmp, 4; - callfunc "SetMorganMask"; goto L_Close; L_LearningDone: diff --git a/world/map/npc/029-2/sorfina.txt b/world/map/npc/029-2/sorfina.txt index 8becafd3..a7da1b31 100644 --- a/world/map/npc/029-2/sorfina.txt +++ b/world/map/npc/029-2/sorfina.txt @@ -9,12 +9,11 @@ goto L_Main; L_Main: - callfunc "TutorialState"; - if (@tutorial == 10) goto L_Hasan; - if (@tutorial >= 4) goto L_Again; - if (@tutorial == 3) goto L_Clothes; - if (@tutorial == 2) goto L_Dresser; - if (@tutorial == 1) goto L_Carpet; + if (QL_BEGIN == 10) goto L_Hasan; + if (QL_BEGIN >= 4) goto L_Again; + if (QL_BEGIN == 3) goto L_Clothes; + if (QL_BEGIN == 2) goto L_Dresser; + if (QL_BEGIN == 1) goto L_Carpet; goto L_Start; L_Start: @@ -60,8 +59,7 @@ L_Carpet: mes "Press [###keyMoveUp;] to move up, press [###keyMoveDown;] to move down, "; mes "press [###keyMoveLeft;] to move left, press [###keyMoveRight;] to move right "; mes " or click on the place you want to go to.\""; - set @tutorial_tmp, 1; - callfunc "SetTutorialMask"; + set QL_BEGIN, 1; goto L_Close; L_Dresser: @@ -98,8 +96,7 @@ L_Clothes: mes "\"And here is some money for you. Don't spend it all in one place."; mes "Now go help Tanisha downstairs.\""; set Zeny, Zeny + 30; - set @tutorial_tmp, 4; - callfunc "SetTutorialMask"; + set QL_BEGIN, 4; goto L_Close; L_Again: @@ -225,8 +222,7 @@ L_Next: mes "\"If Valon hadn't have come along that moment, Hasan would have died that day.\""; mes "\"However, the scorpions poison caused a bad fever and once Hasan had recovered from that, he was even more malicious than before.\""; mes "She sighs."; - set @tutorial_tmp, 11; - callfunc "SetTutorialMask"; + set QL_BEGIN, 11; goto L_Close; L_SkipTut: @@ -246,16 +242,14 @@ L_Bye: getitem "CottonShirt", 1; getitem "RaggedShorts", 1; set Zeny, Zeny + 35; // tanisha gives 5 zeny - set @tutorial_tmp, 8; - callfunc "SetTutorialMask"; + set QL_BEGIN, 8; goto L_Close; L_Close: close; OnTouch: - callfunc "TutorialState"; - if (@tutorial > 0) + if (QL_BEGIN > 0) end; goto L_Start; } @@ -265,8 +259,7 @@ OnTouch: end; OnTouch: - callfunc "TutorialState"; - if (@tutorial != 1) + if (QL_BEGIN != 1) end; mes "[Sorfina]"; mes "\"You should get dressed now.\""; @@ -274,8 +267,7 @@ OnTouch: mes "\"To interact with things in your environment or talk to NPCs you can either click on it or press N to focus and T to talk/activate.\""; next; mes "\"Now get the clothes out of the dresser.\""; - set @tutorial_tmp, 2; - callfunc "SetTutorialMask"; + set QL_BEGIN, 2; close; } @@ -285,9 +277,8 @@ OnTouch: callfunc "PCtoNPCRange"; if (@npc_check) goto L_CloseDis; - callfunc "TutorialState"; - if (@tutorial > 2) goto L_Empty; - if (@tutorial == 2) goto L_Shirt; + if (QL_BEGIN > 2) goto L_Empty; + if (QL_BEGIN == 2) goto L_Shirt; goto L_Walk; L_Walk: @@ -304,8 +295,7 @@ L_Shirt: mes "\"You can open your inventory by pressing F3 or clicking on the 'Inventory' button in the bar at the upper right corner.\""; next; mes "\"After we finish talking, click on the clothes and press the equip button.\""; - set @tutorial_tmp, 3; - callfunc "SetTutorialMask"; + set QL_BEGIN, 3; close; L_Empty: @@ -322,8 +312,7 @@ L_CloseDis: end; OnTouch: - callfunc "TutorialState"; - if (@tutorial < 4) + if (QL_BEGIN < 4) goto L_Block; warp "029-2", 112, 85; end; diff --git a/world/map/npc/029-2/tanisha.txt b/world/map/npc/029-2/tanisha.txt index 450bc77c..f2c2d652 100644 --- a/world/map/npc/029-2/tanisha.txt +++ b/world/map/npc/029-2/tanisha.txt @@ -12,11 +12,10 @@ if (isin("029-2", 98, 84, 106, 89)) goto L_Fighting; - callfunc "TutorialState"; - if (@tutorial >= 8) goto L_Tut_Done; - if (@tutorial == 7) goto L_Stats; - if (@tutorial == 6) goto L_Fail; - if (@tutorial == 5) goto L_Maggots; + if (QL_BEGIN >= 8) goto L_Tut_Done; + if (QL_BEGIN == 7) goto L_Stats; + if (QL_BEGIN == 6) goto L_Fail; + if (QL_BEGIN == 5) goto L_Maggots; mes "[Tanisha]"; mes "\"Hey! You're up again!\""; @@ -30,8 +29,7 @@ L_Next: mes "[Tanisha]"; mes "\"I'm glad you're feeling better. It was really bad luck what happened to you."; mes "Hey, I have an idea.\""; - set @tutorial_tmp, 5; - callfunc "SetTutorialMask"; + set QL_BEGIN, 5; goto L_Maggots; L_Maggots: @@ -67,24 +65,21 @@ L_Fight_Again: next; mes "\"Sometimes dead monsters leave some useful things. You can pick them up by pressing [###keyPickup;] or clicking on the items with your mouse.\""; close2; - // The getitem must be in the same place as set @tutorial, 2; + // The getitem must be in the same place as set QL_BEGIN, 2; // since it was moved to after L_Fight_Again, add it conditionally - callfunc "TutorialState"; - if (@tutorial == 5) + if (QL_BEGIN == 5) goto L_GetFightItems; goto L_ContinueFight; L_GetFightItems: - set @tutorial_tmp, 6; - callfunc "SetTutorialMask"; + set QL_BEGIN, 6; getitem "Knife", 1; getitem "SlingShot", 1; getitem "SlingBullet", 500; goto L_ContinueFight; L_ContinueFight: - set @tutorial_tmp, 6; - callfunc "SetTutorialMask"; + set QL_BEGIN, 6; set @Maggot_Kills, 0; set @time, 0; if (getareausers("029-2", 98, 84, 106, 89) == 0) @@ -118,8 +113,7 @@ L_StatsRe: mes "\"My Uncle sitting at the counter knows a spell to help the younglings reset their stats.\""; mes "\"He also knows of mages with even more powerful reset spells.\""; next; - callfunc "TutorialState"; - if (@tutorial == 7) + if (QL_BEGIN == 7) goto L_Money; goto L_Advice; @@ -128,8 +122,7 @@ L_Money: mes "[Tanisha]"; mes "\"Hey, you are so smart taking out all that yucky maggots for me."; mes "You can have my pocket money. Here.\""; - set @tutorial_tmp, 8; - callfunc "SetTutorialMask"; + set QL_BEGIN, 8; set Zeny, Zeny + 5; next; goto L_Advice; @@ -263,8 +256,7 @@ OnMaggotDeath: goto L_Summon; // else, complete warp "029-2", 110, 88; - set @tutorial_tmp, 7; - callfunc "SetTutorialMask"; + set QL_BEGIN, 7; set @Maggot_Kills, 0; set @time, 0; if (getareausers("029-2", 98, 84, 106, 89) == 0) @@ -284,8 +276,7 @@ OnInit: end; OnTouch: - callfunc "TutorialState"; - if (@tutorial >= 8) + if (QL_BEGIN >= 8) goto L_Warp; goto L_Block; diff --git a/world/map/npc/functions/mob_points.txt b/world/map/npc/functions/mob_points.txt index 7f1cb1db..ba2910b1 100644 --- a/world/map/npc/functions/mob_points.txt +++ b/world/map/npc/functions/mob_points.txt @@ -138,8 +138,8 @@ function|script|MobPoints if (MPQUEST == 1) set Mobpt, Mobpt + @points[@mobID - 1002]; - callfunc "ValonState"; - if (((@valon_state >= 2) && (@valon_state < 6)) && (@mobID == $@ValonMob[@valon_mob])) + callfunc "ValonCount"; + if (((QL_VALON >= 2) && (QL_VALON < 6)) && (@mobID == $@ValonMob[@valon_mob])) goto L_ValonMobKill; goto L_NatureKarma; -- cgit v1.2.3-60-g2f50