diff options
author | Jessica Tölke <jtoelke@mail.upb.de> | 2013-01-27 00:09:29 +0100 |
---|---|---|
committer | Jessica Tölke <jtoelke@mail.upb.de> | 2013-02-12 23:05:13 +0100 |
commit | 93efd4949c5eb7268c8f197fac1f8e6a924b63d3 (patch) | |
tree | 66c3b1e59750ce8f3ceeee78bd7f0533d27d8975 /world/map/npc/001-1 | |
parent | 55b20f23de4c709398b65e6833b29138e4307e7a (diff) | |
download | serverdata-93efd4949c5eb7268c8f197fac1f8e6a924b63d3.tar.gz serverdata-93efd4949c5eb7268c8f197fac1f8e6a924b63d3.tar.bz2 serverdata-93efd4949c5eb7268c8f197fac1f8e6a924b63d3.tar.xz serverdata-93efd4949c5eb7268c8f197fac1f8e6a924b63d3.zip |
Restructuring the quests saved in TMW_Quest: Convert Bernard and Mikhail to new variables.
The variable was also used in Kylian, so that script needed changes too.
Diffstat (limited to 'world/map/npc/001-1')
-rw-r--r-- | world/map/npc/001-1/bernard.txt | 35 | ||||
-rw-r--r-- | world/map/npc/001-1/mikhail.txt | 54 |
2 files changed, 56 insertions, 33 deletions
diff --git a/world/map/npc/001-1/bernard.txt b/world/map/npc/001-1/bernard.txt index 23b39f5c..0d65e6d2 100644 --- a/world/map/npc/001-1/bernard.txt +++ b/world/map/npc/001-1/bernard.txt @@ -1,10 +1,16 @@ -// +// Variables used: nibble 0 of QUEST_SouthTulimshar 001-1.gat,37,44,0|script|Bernard|117,{ - if(TMW_Quest >= 4) goto L_Done2; - if(TMW_Quest == 3) goto L_Progress2; - if(TMW_Quest == 2) goto L_Done1; - if(TMW_Quest == 1) goto L_Progress; + + // This NPC previously used the variable TMW_Quest + callfunc "ClearVarTMW_Quest"; + + set @state, ((QUEST_SouthTulimshar & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT); + + if(@state >= 4) goto L_Done2; + if(@state == 3) goto L_Progress2; + if(@state == 2) goto L_Done1; + if(@state == 1) goto L_Progress; set @TEMP, rand(2); if(@TEMP == 0) goto L_Opening0; @@ -45,7 +51,8 @@ L_Req1: goto L_Set; L_Set: - set TMW_Quest,1; + set @state, 1; + callsub S_Update_Var; mes "[Bernard]"; mes "\"Please bring it to me!\""; goto L_Close; @@ -60,7 +67,10 @@ L_Progress: delitem "RoastedMaggot", 1; getexp 100, 0; getitem "CherryCake", 5; - set TMW_Quest, 2; + set @state, 2; + callsub S_Update_Var; + next; + mes "\"Now let's see...\""; goto L_Close; L_Progress2: @@ -73,7 +83,8 @@ L_Progress2: delitem "MaggotSlime", 3; getexp 100, 0; getitem "Beer", 3; - set TMW_Quest, 4; + set @state, 4; + callsub S_Update_Var; goto L_Close; L_NotEnough: @@ -93,7 +104,8 @@ L_Done1: next; mes "\"I need 3 Maggot Slimes for that.\""; mes "\"Bring them to me, and I'll give you something nice.\""; - set TMW_Quest,3; + set @state, 3; + callsub S_Update_Var; goto L_Close; L_Done2: @@ -105,6 +117,7 @@ L_Done2: L_Close: set @TEMP, 0; + set @state, 0; close; L_TooMany: @@ -112,4 +125,8 @@ L_TooMany: mes "[Bernard]"; mes "\"You don't have room for my reward. I'll wait until you do.\""; goto L_Close; + +S_Update_Var: + set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_0_MASK) | (@state << NIBBLE_0_SHIFT)); + return; } diff --git a/world/map/npc/001-1/mikhail.txt b/world/map/npc/001-1/mikhail.txt index ced945cf..8e6b6aec 100644 --- a/world/map/npc/001-1/mikhail.txt +++ b/world/map/npc/001-1/mikhail.txt @@ -1,21 +1,23 @@ -// +// Variables used: nibble 0 of QUEST_SouthTulimshar 001-1.gat,50,46,0|script|Mikhail|120,{ - if (TMW_Quest >= 6) goto L_Done; - if (TMW_Quest == 5) goto L_Progress; - if (TMW_Quest == 4) goto L_Start; - if (TMW_Quest < 4) goto L_Convince_Mikhail_First; - // If this happens, something is wrong with the above case handling. - mes "Mikhail looks confused."; - close; + // This NPC previously used the variable TMW_Quest + callfunc "ClearVarTMW_Quest"; + + set @state, ((QUEST_SouthTulimshar & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT); + + if (@state >= 6) goto L_Done; + if (@state == 5) goto L_Progress; + if (@state == 4) goto L_Start; + if (@state < 4) goto L_Convince_Mikhail_First; L_Convince_Mikhail_First: mes "[Mikhail]"; mes "\"Hello...\""; mes ""; mes "It seems that the boy would like to say more, but does not dare to open up to you. Maybe you should help someone else first, so that he sees your intentions are good."; - close; + goto L_Close; L_Start: mes "[Mikhail]"; @@ -24,16 +26,13 @@ L_Start: mes "\"You look like a nice person. Would you go get them for me?\""; menu "Of course, I'll go get them for you.", L_accept, - "I've got other things to do right now.", L_close; - close; - -L_close: - close; + "I've got other things to do right now.", L_Close; L_accept: mes "[Mikhail]"; mes "\"Thank you so much! I'll wait for you here.\""; - set TMW_Quest, 5; + set @state, 5; + callsub S_Update_Var; close; L_Progress: @@ -42,27 +41,34 @@ L_Progress: next; menu "Yes, here they are, kiddo!", L_try, - "Not yet, but I'll be back soon.", L_close; - close; + "Not yet, but I'll be back soon.", L_Close; L_try: - if countitem("MaggotSlime") >= 5 goto L_get; + if countitem("MaggotSlime") >= 5 + goto L_get; mes "[Mikhail]"; mes "\"It doesn't look like you have them all...\""; - close; + goto L_Close; L_get: delitem "MaggotSlime", 5; - set TMW_Quest, 6; + getexp 100, 0; + set @state, 6; + callsub S_Update_Var; mes "[Mikhail]"; mes "\"Ooh! Thank you so much! I can get back to my grandma now!\""; - next; - getexp 100, 0; - mes "You get 100 xp."; - close; + goto L_Close; L_Done: mes "[Mikhail]"; mes "\"Thanks again for helping me get those Maggot Slimes!\""; + goto L_Close; + +L_Close: + set @state, 0; close; + +S_Update_Var: + set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_0_MASK) | (@state << NIBBLE_0_SHIFT)); + return; } |