summaryrefslogtreecommitdiff
path: root/world
diff options
context:
space:
mode:
authormeko <mekolat@users.noreply.github.com>2015-09-29 12:32:48 -0400
committermeko <mekolat@users.noreply.github.com>2015-09-29 12:32:48 -0400
commit1fa42ac121792035ea777e18bb6105552b8299c0 (patch)
tree8b50ead6a5b75d2c8a52bfe762cef38c4e849cbe /world
parentaef74e905ea2abc818ffaa526f6c5e559f397509 (diff)
parenta5816766ed870dd55170a4b66a75a1907021e421 (diff)
downloadserverdata-1fa42ac121792035ea777e18bb6105552b8299c0.tar.gz
serverdata-1fa42ac121792035ea777e18bb6105552b8299c0.tar.bz2
serverdata-1fa42ac121792035ea777e18bb6105552b8299c0.tar.xz
serverdata-1fa42ac121792035ea777e18bb6105552b8299c0.zip
Merge pull request #384 from wushin/tulimshar-quests
Some of the Tonori Area Quests
Diffstat (limited to 'world')
-rw-r--r--world/map/db/quest-log.txt17
-rw-r--r--world/map/npc/001-1/adrian.txt15
-rw-r--r--world/map/npc/001-1/eomie.txt52
-rw-r--r--world/map/npc/001-1/tinris.txt80
-rw-r--r--world/map/npc/001-1/weellos.txt8
-rw-r--r--world/map/npc/001-2/fieri.txt29
-rw-r--r--world/map/npc/001-2/heathin.txt81
-rw-r--r--world/map/npc/001-2/sandra.txt19
-rw-r--r--world/map/npc/001-2/yanis.txt11
-rw-r--r--world/map/npc/002-1/anwar.txt75
-rw-r--r--world/map/npc/002-1/lieutenant_dausen.txt46
-rw-r--r--world/map/npc/002-1/mine_debug.txt16
-rw-r--r--world/map/npc/002-1/nickos.txt45
-rw-r--r--world/map/npc/002-1/sarah.txt19
-rw-r--r--world/map/npc/002-1/stewen.txt17
-rw-r--r--world/map/npc/002-2/casino.txt7
-rw-r--r--world/map/npc/002-2/imec.txt25
-rw-r--r--world/map/npc/002-2/kps.txt34
-rw-r--r--world/map/npc/002-2/kylian.txt87
-rw-r--r--world/map/npc/002-2/latoy.txt8
-rw-r--r--world/map/npc/002-3/mining_camp_barrier.txt7
-rw-r--r--world/map/npc/002-3/nathan.txt48
-rw-r--r--world/map/npc/002-4/mine_triggerone.txt28
-rw-r--r--world/map/npc/002-4/mine_triggerthree.txt28
-rw-r--r--world/map/npc/002-4/mine_triggertwo.txt30
-rw-r--r--world/map/npc/002-4/naem.txt50
-rw-r--r--world/map/npc/002-4/underground_palace_barrier.txt7
-rw-r--r--world/map/npc/002-5/chest.txt14
-rw-r--r--world/map/npc/002-5/sema.txt24
-rw-r--r--world/map/npc/006-2/npcs.txt6
-rw-r--r--world/map/npc/008-1/banu.txt26
-rw-r--r--world/map/npc/008-1/mikhail.txt21
-rw-r--r--world/map/npc/009-2/bernard.txt31
-rw-r--r--world/map/npc/013-2/wizard.txt6
-rw-r--r--world/map/npc/020-2/baktar.txt6
-rw-r--r--world/map/npc/029-1/vincent.txt2
36 files changed, 300 insertions, 725 deletions
diff --git a/world/map/db/quest-log.txt b/world/map/db/quest-log.txt
index eac7f1a1..131dd2f6 100644
--- a/world/map/db/quest-log.txt
+++ b/world/map/db/quest-log.txt
@@ -5,19 +5,24 @@
//SHIFT: Posistion shifted. (SHIFT * MASK)
//MASK: Size of shift to make. ((1 << MASK) - 1) << (SHIFT * MASK)
//Quest ID,CommonVar,ServerVar,SHIFT,MASK
-//
-// CANDOR
-//
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
-//
-// KAIZEI
-//
7,QL_WELL,QUEST_Nivalis_state,4,4
8,QL_CINDY,QUEST_Nivalis_state,5,4
9,QL_BAKTAR,QUEST_Nivalis_state,0,8
10,QL_BSAGE_INVESTIGATE,QUEST_BlueSage,3,4
+11,QL_SOUP,QUEST_SouthTulimshar,0,4
+12,QL_SARAH,QUEST_SouthTulimshar,2,2
+13,QL_SANDRA,QUEST_SouthTulimshar,6,2
+// Not done
+14,QL_MINEALL,QUEST_SouthTulimshar,2,8
+15,QL_FIERI,QUEST_SouthTulimshar,6,4
+16,QL_IMEC,QUEST_NorthTulimshar,4,2
+17,QL_BANU,QUEST_NorthTulimshar,5,2
+18,QL_ANWAR,QUEST_NorthTulimshar,3,4
+19,QL_KYLIAN,QUEST_NorthTulimshar,5,4
+20,QL_TERRANITE_ARMOR,QUEST_NorthTulimshar,6,4
diff --git a/world/map/npc/001-1/adrian.txt b/world/map/npc/001-1/adrian.txt
index de2966b5..9582cba5 100644
--- a/world/map/npc/001-1/adrian.txt
+++ b/world/map/npc/001-1/adrian.txt
@@ -1,17 +1,8 @@
-// part of quest given by 021-2/kylian.txt
-// Author: Jenalya
-
-// state 1: player has the task to get the luggage from the harbor
-// state 2: Adrian gave the luggage to the player
-// state 3: player gave luggage to Kylian and Kylian asks who to talk to for the shop license
-
001-1,113,64,0|script|Adrian|213
{
- set @state, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT);
-
mes "[Adrian]";
mes "\"Hello. Are you here to pick up some luggage?\"";
- if (@state == 1)
+ if (QL_KYLIAN == 1)
menu
"Yes. Kylian sent me to get his luggage.",L_Get,
"No.",L_No;
@@ -37,8 +28,7 @@ L_Get:
mes "\"Alright. Here it is. Good luck carrying that thing.\"";
mes "Adrain hands you a very heavy suitcase.";
getitem "LeatherSuitcase", 1;
- set @state, 2;
- set QUEST_NorthTulimshar, (QUEST_NorthTulimshar & ~(NIBBLE_5_MASK)) | (@state << NIBBLE_5_SHIFT);
+ set QL_KYLIAN, 2;
goto L_Close;
L_Inventory:
@@ -48,7 +38,6 @@ L_Inventory:
goto L_Close;
L_Close:
- set @state, 0;
set @inventorylist_count, 0;
close;
}
diff --git a/world/map/npc/001-1/eomie.txt b/world/map/npc/001-1/eomie.txt
index 99085bcf..65cee42e 100644
--- a/world/map/npc/001-1/eomie.txt
+++ b/world/map/npc/001-1/eomie.txt
@@ -1,40 +1,18 @@
-// A professor at Tulimshar's magic academy, involved in quest:
-// Anwar needs a magic fertilizer for his field
-// Quest uses Nibble 3 of QUEST_NorthTulimshar
-// Author: Jenalya
-// state 1: Anwar sent to Tinris for help to get a magic fertilizer
-// state 2: Tinris asked for chocolate cake as present for his girlfriend
-// state 3: Tinris asked for ingredients for the fertilizer
-// state 4: Tinris gave you the fertilizer
-// state 5: Anwar tried it out and it doesn't work well, sent you back to Tinris
-// state 6: Tinris asked for more ingredients for a new try
-// state 7: Tinris says it's really hard, gives you the fertilizer and tells you to ask Eomie to cast a spell on it
-// state 8: Eomie sends you to get some stuff so she can interrupt her spell on the spot of grass
-// state 9: Eomie casted a spell on the fertilizer
-// state 10: Anwar used it and it worked. he asks you to help him preparing a thank-you-gift for each Tinris and Eomis
-// state 11: Anwar asked to bring present to Tinris
-// state 12: gave present to Tinris
-// state 13: Anwar asked to bring present to Eomie
-// state 14: gave present to Eomie
-// state 15: reported back to Anwar and done
-
001-1,71,23,0|script|Eomie|164
{
- set @state, ((QUEST_NorthTulimshar & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);
-
set @grass_amount, 5;
set @water_amount, 2;
set @ice_amount, 2;
set @silk_exp, 600;
- if (@state >= 14) goto L_Done;
- if (@state >= 9) goto L_CastedSpell;
- if (@state == 8) goto L_GetStuff;
+ if (QL_ANWAR >= 14) goto L_Done;
+ if (QL_ANWAR >= 9) goto L_CastedSpell;
+ if (QL_ANWAR == 8) goto L_GetStuff;
mes "[Eomie]";
mes "\"I maintain this little oasis in the desert.\"";
- if (@state != 7)
+ if (QL_ANWAR != 7)
goto L_Close;
menu
"I need to learn a spell to use Tinris' magic fertilizer. Can you help me out?",L_Next;
@@ -50,12 +28,11 @@ L_Next:
L_Continue:
mes "She hesitates.";
- set @state, 8;
- callsub S_Update_Mask;
+ set QL_ANWAR, 8;
goto L_GetStuff;
L_GetStuff:
- // @state == 8
+ // QL_ANWAR == 8
mes "[Eomie]";
mes "\"I could try to briefly interrupt my magic and then cast the spell on the fertilizer, but I would need to prepare the grass beforehand.";
mes "Bring me " + @grass_amount + " " + getitemlink("GrassSeed") + ", " + @water_amount + " " + getitemlink("BottleOfWater") + ", and " + @ice_amount + " " + getitemlink("IceCube") + ".\"";
@@ -71,8 +48,7 @@ L_More:
delitem "GrassSeed", @grass_amount;
delitem "BottleOfWater", @water_amount;
delitem "IceCube", @ice_amount;
- set @state, 9;
- callsub S_Update_Mask;
+ set QL_ANWAR, 9;
mes "[Eomie]";
mes "\"Very good!\"";
mes "She takes the ingredients you brought her and uses them to cast a cool mist into the air.";
@@ -98,10 +74,10 @@ L_Mine: // player asked how to get Ice Cubes
mes "\"I heard that Ice Goblins were seen in the caves surrounding Nivalis. Maybe you can find " + getitemlink("IceCube") + " there.\"";
goto L_Close;
-L_CastedSpell: // @state >= 9 but below 14
+L_CastedSpell: // QL_ANWAR >= 9 but below 14
mes "[Eomie]";
mes "\"Thankfully, the grass wasn't damaged. I hope Anwar finds the magic fertilizer to be useful.\"";
- if (@state != 13)
+ if (QL_ANWAR != 13)
goto L_Close;
menu
"It was. He even created this Silk Headband as a present for you!",L_Present,
@@ -112,14 +88,13 @@ L_Present:
goto L_NoItem;
delitem "SilkHeadband", 1;
getexp @silk_exp, 0;
- set @state, 14;
- callsub S_Update_Mask;
+ set QL_ANWAR, 14;
mes "[Eomie]";
mes "\"Oh, that's so nice of him! Please tell him that I really like it!\"";
mes "She smiles.";
goto L_Close;
-L_Done: // @state >= 14
+L_Done: // QL_ANWAR >= 14
mes "[Eomie]";
mes "\"Hello! I'm happy to see someone like you so dedicated to the environment.\" %%8";
goto L_Close;
@@ -130,13 +105,8 @@ L_NoItem:
goto L_Close;
L_Close:
- set @state, 0;
set @grass_amount, 0;
set @water_amount, 0;
set @ice_amount, 0;
close;
-
-S_Update_Mask:
- set QUEST_NorthTulimshar, (QUEST_NorthTulimshar & ~(NIBBLE_3_MASK)) | (@state << NIBBLE_3_SHIFT);
- return;
}
diff --git a/world/map/npc/001-1/tinris.txt b/world/map/npc/001-1/tinris.txt
index 1a6aab33..2ae908bc 100644
--- a/world/map/npc/001-1/tinris.txt
+++ b/world/map/npc/001-1/tinris.txt
@@ -1,26 +1,5 @@
-// Anwar needs a magic fertilizer for his field
-// Quest uses Nibble 3 of QUEST_NorthTulimshar
-// Author: Jenalya
-// state 1: Anwar sent to Tinris for help to get a magic fertilizer
-// state 2: Tinris asked for chocolate cake as present for his girlfriend
-// state 3: Tinris asked for ingredients for the fertilizer
-// state 4: Tinris gave you the fertilizer
-// state 5: Anwar tried it out and it doesn't work well, sent you back to Tinris
-// state 6: Tinris asked for more ingredients for a new try
-// state 7: Tinris says it's really hard, gives you the fertilizer and tells you to ask Eomie to cast a spell on it
-// state 8: Eomie sends you to get some stuff so she can interrupt her spell on the spot of grass
-// state 9: Eomie casted a spell on the fertilizer
-// state 10: Anwar used it and it worked. he asks you to help him preparing a thank-you-gift for each Tinris and Eomis
-// state 11: Anwar asked to bring present to Tinris
-// state 12: gave present to Tinris
-// state 13: Anwar asked to bring present to Eomie
-// state 14: gave present to Eomie
-// state 15: reported back to Anwar and done
-
001-1,69,29,0|script|Tinris|160
{
- set @state, ((QUEST_NorthTulimshar & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);
-
set @cake_exp, 50;
set @sweater_exp, 400;
@@ -34,19 +13,19 @@
set @ash_amount2, 2;
set @cactusp_amount, 1;
- if (@state >= 12) goto L_Done;
- if (@state == 11) goto L_GiveGift;
- if (@state == 9) goto L_FertilizerDone;
- if (@state >= 7) goto L_Eomie;
- if (@state == 6) goto L_SecondTry;
- if (@state >= 4) goto L_FirstTryDone;
- if (@state == 3) goto L_FirstTry;
- if (@state == 2) goto L_Annual;
+ if (QL_ANWAR >= 12) goto L_Done;
+ if (QL_ANWAR == 11) goto L_GiveGift;
+ if (QL_ANWAR == 9) goto L_FertilizerDone;
+ if (QL_ANWAR >= 7) goto L_Eomie;
+ if (QL_ANWAR == 6) goto L_SecondTry;
+ if (QL_ANWAR >= 4) goto L_FirstTryDone;
+ if (QL_ANWAR == 3) goto L_FirstTry;
+ if (QL_ANWAR == 2) goto L_Annual;
mes "[Tinris]";
mes "\"This is a magic school. I'm a student here and focus on ways to magically enhance growth of plants.";
mes "That topic is very important in a desert area.\"";
- if (@state != 1)
+ if (QL_ANWAR != 1)
goto L_Close;
menu
"The farmer Anwar sent me to ask for exactly that! Can you give me something for his field?",L_Next;
@@ -59,11 +38,10 @@ L_Next:
mes "Please go to the bakery and buy a Chocolate Cake for me. She loves Chocolate Cakes.\"";
next;
mes "\"When I have a present for her I can focus on creating some magic fertilizer.\"";
- set @state, 2;
- callsub S_Update_Mask;
+ set QL_ANWAR, 2;
goto L_Close;
-L_Annual: // @state == 2
+L_Annual: // QL_ANWAR == 2
mes "[Tinris]";
mes "\"Hello, did you get the Chocolate Cake for my girlfriend? After that I can focus on creating some magic fertilizer for you.\"";
menu
@@ -75,8 +53,7 @@ L_FreshFrom:
goto L_NoItem;
delitem "ChocolateCake", 1;
getexp @cake_exp, 0;
- set @state, 3;
- callsub S_Update_Mask;
+ set QL_ANWAR, 3;
mes "[Tinris]";
mes "\"Oh, thank you! You saved me!";
mes "All right, now we can start with the magic fertilizer.\"";
@@ -84,7 +61,7 @@ L_FreshFrom:
goto L_FirstTry;
L_FirstTry:
- // @state == 3
+ // QL_ANWAR == 3
mes "[Tinris]";
mes "\"You need to bring me some ingredients.";
mes "The ingredients are " + @slime_amount1 + " Maggot Slimes, " + @bugleg_amount1 + " Bug Legs, " + @stinger_amount1 + " Scorpion Stingers and " + @ash_amount1 + " Piles of Ash.\"";
@@ -99,8 +76,7 @@ L_Continue:
delitem "BugLeg", @bugleg_amount1;
delitem "ScorpionStinger", @stinger_amount1;
delitem "PileOfAsh", @ash_amount1;
- set @state, 4;
- callsub S_Update_Mask;
+ set QL_ANWAR, 4;
mes "Tinris takes the things and starts to mix them together while mumbling some invocations.";
misceffect sfx_magic_nature;
next;
@@ -110,21 +86,20 @@ L_Continue:
mes "He gives you a bottle with the magic fertilizer. You put it away in a separate pocket, so it doesn't get mixed with your inventory.";
goto L_Close;
-L_FirstTryDone: // @state >= 4 but below 6
+L_FirstTryDone: // QL_ANWAR >= 4 but below 6
mes "[Tinris]";
mes "\"Bring the fertilizer to Anwar and let me know if it worked.\"";
- if (@state != 5)
+ if (QL_ANWAR != 5)
goto L_Close;
menu
"I did, the plants went brown and shriveled.",L_More;
L_More:
- set @state, 6;
- callsub S_Update_Mask;
+ set QL_ANWAR, 6;
goto L_SecondTry;
L_SecondTry:
- // @state == 6
+ // QL_ANWAR == 6
mes "[Tinris]";
mes "\"Oh no! All right, we need to do another try.";
mes "Bring me " + @slime_amount2 + " Maggot Slimes, " + @bugleg_amount2 + " Bug Legs, " + @stinger_amount2 + " Scorpion Stingers, " + @ash_amount2 + " Piles of Ash and " + @cactusp_amount + " Cactus Potion.\"";
@@ -140,8 +115,7 @@ L_HereItIs:
delitem "ScorpionStinger", @stinger_amount2;
delitem "PileOfAsh", @ash_amount2;
delitem "CactusPotion", @cactusp_amount;
- set @state, 7;
- callsub S_Update_Mask;
+ set QL_ANWAR, 7;
mes "Tinris takes the things and starts to mix and mumble again.";
misceffect sfx_magic_nature;
next;
@@ -156,19 +130,19 @@ L_HereItIs:
goto L_Close;
L_Eomie:
- // @state >= 7 but below 9
+ // QL_ANWAR >= 7 but below 9
mes "[Tinris]";
mes "\"I did the best I could, but it seems I'm not experienced enough to cast the spells correctly. Better ask Professor Eomie for help.\"";
goto L_Close;
L_FertilizerDone:
- // @state == 9
+ // QL_ANWAR == 9
mes "[Tinris]";
mes "\"I heard Eomie cast the spell? I really hope it'll work this time. Bring the magic fertilizer to Anwar now.\"";
goto L_Close;
L_GiveGift:
- // @state == 11
+ // QL_ANWAR == 11
mes "[Tinris]";
mes "\"Ah, did Anwar try the new fertilizer?\"";
menu
@@ -180,14 +154,13 @@ L_ItWorksGreat:
goto L_NoItem;
delitem "GreenVNeckSweater", 1;
getexp @sweater_exp, 0;
- set @state, 12;
- callsub S_Update_Mask;
+ set QL_ANWAR, 12;
mes "[Tinris]";
mes "\"Hey, that's really nice. Tell him my thanks.\"";
goto L_Close;
L_Done:
- // @state >= 12
+ // QL_ANWAR >= 12
mes "[Tinris]";
mes "\"My girlfriend was delighted with the Chocolate Cake and Professor Eomie was happy with my work on the magic fertilizer.\"";
mes "He twinkles.";
@@ -201,7 +174,6 @@ L_NoItem:
goto L_Close;
L_Close:
- set @state, 0;
set @slime_amount1, 0;
set @slime_amount2, 0;
set @bugleg_amount1, 0;
@@ -212,8 +184,4 @@ L_Close:
set @ash_amount2, 0;
set @cactusp_amount, 0;
close;
-
-S_Update_Mask:
- set QUEST_NorthTulimshar, (QUEST_NorthTulimshar & ~(NIBBLE_3_MASK)) | (@state << NIBBLE_3_SHIFT);
- return;
}
diff --git a/world/map/npc/001-1/weellos.txt b/world/map/npc/001-1/weellos.txt
index e49c6814..d5b76a27 100644
--- a/world/map/npc/001-1/weellos.txt
+++ b/world/map/npc/001-1/weellos.txt
@@ -1,13 +1,9 @@
-// A historian
-// takes part in quest given by 021-2/kylian.txt
-
001-1,55,25,0|script|Weellos|103
{
set @halloween_npc_id, $@halloween_npc_weellos;
callfunc "TrickOrTreat";
set QUEST_NorthTulimshar, QUEST_NorthTulimshar | $@knowWeellosNT;
- set @kylian, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT);
if (isin("001-1", 48, 20, 61, 28)) goto L_In;
@@ -19,20 +15,18 @@
mes "\"Due to its historical significance, part of it has been turned into a museum.\"";
goto L_BeforeClose;
-// If the player is inside the fence with Weellos
L_In:
mes "[Weellos]";
mes "\"What did you think? Isn't the building intriguing?\"";
goto L_BeforeClose;
L_BeforeClose:
- if (@kylian != 4)
+ if (QL_KYLIAN != 4)
goto L_Close;
next;
mes "You wonder if Kylian would be interested in seeing this historic landmark...";
goto L_Close;
L_Close:
- set @kylian, 0;
close;
}
diff --git a/world/map/npc/001-2/fieri.txt b/world/map/npc/001-2/fieri.txt
index dbf12c2e..0d122fb2 100644
--- a/world/map/npc/001-2/fieri.txt
+++ b/world/map/npc/001-2/fieri.txt
@@ -1,13 +1,9 @@
-// Variables used: nibble 0 of QUEST_SouthTulimshar
-
001-2,114,89,0|script|Fieri|117
{
- set @state, ((QUEST_SouthTulimshar & NIBBLE_6_MASK) >> NIBBLE_6_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;
+ if (QL_FIERI >= 4) goto L_Done2;
+ if (QL_FIERI == 3) goto L_Progress2;
+ if (QL_FIERI == 2) goto L_Done1;
+ if (QL_FIERI == 1) goto L_Progress;
set @TEMP, rand(2);
if(@TEMP == 1) goto L_Opening1;
@@ -50,8 +46,7 @@ L_Req1:
goto L_Set;
L_Set:
- set @state, 1;
- callsub S_Update_Var;
+ set QL_FIERI, 1;
mes "[Fieri]";
mes "\"Please bring it to me!\"";
goto L_Close;
@@ -66,8 +61,7 @@ L_Progress:
delitem "Beer", 1;
getexp 100, 0;
getitem "CherryCake", 5;
- set @state, 2;
- callsub S_Update_Var;
+ set QL_FIERI, 2;
next;
mes "\"Now let's see...\"";
goto L_Close;
@@ -82,8 +76,7 @@ L_Progress2:
delitem "MaggotSlime", 3;
getexp 100, 0;
getitem "TonoriDelight", 3;
- set @state, 4;
- callsub S_Update_Var;
+ set QL_FIERI, 4;
goto L_Close;
L_NotEnough:
@@ -103,8 +96,7 @@ L_Done1:
next;
mes "\"I need 3 Maggot Slimes for that.\"";
mes "\"Bring them to me, and I'll give you something nice.\"";
- set @state, 3;
- callsub S_Update_Var;
+ set QL_FIERI, 3;
goto L_Close;
L_Done2:
@@ -116,7 +108,6 @@ L_Done2:
L_Close:
set @TEMP, 0;
- set @state, 0;
close;
L_TooMany:
@@ -124,8 +115,4 @@ L_TooMany:
mes "[Fieri]";
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_6_MASK) | (@state << NIBBLE_6_SHIFT));
- return;
}
diff --git a/world/map/npc/001-2/heathin.txt b/world/map/npc/001-2/heathin.txt
index 05044812..3ebfbbc7 100644
--- a/world/map/npc/001-2/heathin.txt
+++ b/world/map/npc/001-2/heathin.txt
@@ -1,5 +1,3 @@
-//Items for NPC are incomplete. Makes "simple ring" which can be crafted into a useful ring by Inya and terranite armor.
-
001-2,23,55,0|script|Heathin|147
{
set @TARROW_REQ_TERRA_ORE, 1;
@@ -7,23 +5,21 @@
set @TARROW_REQ_GP, 3000;
set @heathin_xp_bonus, (100 * BaseLevel);
- set @state, ((QUEST_NorthTulimshar & NIBBLE_6_MASK) >> NIBBLE_6_SHIFT);
-
- if (@state == 14) && (BaseLevel >= 80) goto L_Arrows_Trade;
- if (@state == 13) && (BaseLevel >= 80) goto L_Arrows_Ready;
- if (@state == 12) && (BaseLevel >= 80) goto L_Arrows_Forge;
- if (@state == 11) && (BaseLevel >= 80) goto L_Arrows;
- if (@state == 10) && (BaseLevel >= 80) goto L_Chest_Armor_Ready;
- if (@state == 9) && (BaseLevel >= 80) goto L_Chest_Armor_Forge;
- if (@state == 8) && (BaseLevel >= 80) goto L_Chest_Armor;
- if (@state == 7) && (BaseLevel >= 80) goto L_Legs_Ready;
- if (@state == 6) && (BaseLevel >= 80) goto L_Legs_Forge;
- if (@state == 5) && (BaseLevel >= 80) goto L_Legs;
- if (@state == 4) && (BaseLevel >= 80) goto L_Hood_Ready;
- if (@state == 3) && (BaseLevel >= 80) goto L_Hood_Forge;
- if (@state == 2) && (BaseLevel >= 80) goto L_Hood;
- if (@state == 2) && (BaseLevel >= 60) goto L_Forge_Thanks;
- if (@state == 1) && (BaseLevel >= 60) goto L_Forge_Award;
+ if (QL_TERRANITE_ARMOR == 14) && (BaseLevel >= 80) goto L_Arrows_Trade;
+ if (QL_TERRANITE_ARMOR == 13) && (BaseLevel >= 80) goto L_Arrows_Ready;
+ if (QL_TERRANITE_ARMOR == 12) && (BaseLevel >= 80) goto L_Arrows_Forge;
+ if (QL_TERRANITE_ARMOR == 11) && (BaseLevel >= 80) goto L_Arrows;
+ if (QL_TERRANITE_ARMOR == 10) && (BaseLevel >= 80) goto L_Chest_Armor_Ready;
+ if (QL_TERRANITE_ARMOR == 9) && (BaseLevel >= 80) goto L_Chest_Armor_Forge;
+ if (QL_TERRANITE_ARMOR == 8) && (BaseLevel >= 80) goto L_Chest_Armor;
+ if (QL_TERRANITE_ARMOR == 7) && (BaseLevel >= 80) goto L_Legs_Ready;
+ if (QL_TERRANITE_ARMOR == 6) && (BaseLevel >= 80) goto L_Legs_Forge;
+ if (QL_TERRANITE_ARMOR == 5) && (BaseLevel >= 80) goto L_Legs;
+ if (QL_TERRANITE_ARMOR == 4) && (BaseLevel >= 80) goto L_Hood_Ready;
+ if (QL_TERRANITE_ARMOR == 3) && (BaseLevel >= 80) goto L_Hood_Forge;
+ if (QL_TERRANITE_ARMOR == 2) && (BaseLevel >= 80) goto L_Hood;
+ if (QL_TERRANITE_ARMOR == 2) && (BaseLevel >= 60) goto L_Forge_Thanks;
+ if (QL_TERRANITE_ARMOR == 1) && (BaseLevel >= 60) goto L_Forge_Award;
if (BaseLevel >= 60) goto L_Start;
mes "[Heathin]";
@@ -43,8 +39,7 @@ L_Start:
"Wait, what kind of award are we talking about?", L_Interested;
L_Help:
- set @state, 1;
- callsub S_Update_Mask;
+ set QL_TERRANITE_ARMOR, 1;
mes "[Heathin]";
mes "\"Excellent! I am always glad when someone can be of service not just to me, but to all of Tulimshar. Please get me 50 Coal and you will be compensated for your efforts.\"";
close;
@@ -64,8 +59,7 @@ L_Interested:
L_Forge_Award:
if (countitem ("Coal") < 50) goto L_Forge_Wait;
getinventorylist;
- set @state, 2;
- callsub S_Update_Mask;
+ set QL_TERRANITE_ARMOR, 2;
delitem "Coal", 50;
getexp @heathin_xp_bonus, 0;
set Zeny, Zeny + 20000;
@@ -112,8 +106,7 @@ L_No:
close;
L_Yes:
- set @state, 3;
- callsub S_Update_Mask;
+ set QL_TERRANITE_ARMOR, 3;
mes "[Heathin]";
mes "\"Great, this is going to be fun! As I have not had much practice with this armor, I'd like to get started soon.\"";
next;
@@ -129,8 +122,7 @@ L_Hood_Forge:
|| (countitem("Coal") < 100)
|| (countitem("TerraniteOre") < 10) )
goto L_Hood_Wait;
- set @state, 4;
- callsub S_Update_Mask;
+ set QL_TERRANITE_ARMOR, 4;
delitem "Coal", 100;
delitem "TerraniteOre", 10;
getexp @heathin_xp_bonus, 0;
@@ -148,16 +140,14 @@ L_Hood_Ready:
getinventorylist;
if ((checkweight("TerraniteHelmet", 1) == 0) || (@inventorylist_count == 100))
goto L_InventoryNoSpace;
- set @state, 5;
- callsub S_Update_Mask;
+ set QL_TERRANITE_ARMOR, 5;
getitem "TerraniteHelmet", 1;
mes "[Heathin]";
mes "\"I am all done with your terranite hood. I hope you enjoy it! I have some work to wrap up for the Council, but come back later and I might be able to assist you again.\"";
close;
L_Legs:
- set @state, 6;
- callsub S_Update_Mask;
+ set QL_TERRANITE_ARMOR, 6;
mes "[Heathin]";
mes "\"I am glad you are back! I've just finished up some more of my commission. Now I can get back to making terranite armor for you. This time I will make some pants, but they need more ore, more Coal to heat my forge and of course, more gold for my efforts.\"";
next;
@@ -169,8 +159,7 @@ L_Legs_Forge:
|| (countitem("Coal") < 200)
|| (countitem("TerraniteOre") < 30) )
goto L_Legs_Wait;
- set @state, 7;
- callsub S_Update_Mask;
+ set QL_TERRANITE_ARMOR, 7;
delitem "Coal", 200;
delitem "TerraniteOre", 30;
getexp @heathin_xp_bonus, 0;
@@ -188,16 +177,14 @@ L_Legs_Ready:
getinventorylist;
if ((checkweight("TerraniteLegs", 1) == 0) || (@inventorylist_count == 100))
goto L_InventoryNoSpace;
- set @state, 8;
- callsub S_Update_Mask;
+ set QL_TERRANITE_ARMOR, 8;
getitem "TerraniteLegs", 1;
mes "[Heathin]";
mes "\"I am all done with your terranite pants. Hope you enjoy them! I have some more work to complete for the Council. Come back later and I might be able to assist you again.\"";
close;
L_Chest_Armor:
- set @state, 9;
- callsub S_Update_Mask;
+ set QL_TERRANITE_ARMOR, 9;
mes "[Heathin]";
mes "\"Good to see you again. I have just finished up some more of my commission. Now I can get back to making terranite armor for you. This time, I will make some terranite chest armor, but it needs more ore, more Coal for my forge and of course, more gold to compensate for my efforts.\"";
next;
@@ -209,8 +196,7 @@ L_Chest_Armor_Forge:
|| (countitem("Coal") < 250)
|| (countitem("TerraniteOre") < 40) )
goto L_Chest_Armor_Wait;
- set @state, 10;
- callsub S_Update_Mask;
+ set QL_TERRANITE_ARMOR, 10;
delitem "Coal", 250;
delitem "TerraniteOre", 40;
getexp @heathin_xp_bonus, 0;
@@ -228,8 +214,7 @@ L_Chest_Armor_Ready:
getinventorylist;
if ((checkweight("TerraniteChestArmor", 1) == 0) || (@inventorylist_count == 100))
goto L_InventoryNoSpace;
- set @state, 11;
- callsub S_Update_Mask;
+ set QL_TERRANITE_ARMOR, 11;
getitem "TerraniteChestArmor", 1;
mes "[Heathin]";
mes "\"I have completed your terranite chest armor. I hope you enjoy it! I have some work to wrap up for the Council again, but come back later and I might be able to assist you once more.\"";
@@ -250,8 +235,7 @@ L_Arrows_No:
close;
L_Arrows_Yes:
- set @state, 12;
- callsub S_Update_Mask;
+ set QL_TERRANITE_ARMOR, 12;
mes "[Heathin]";
mes "\"Good, good. I shall begin crafting these arrows as soon as you come back. However, I cannot just make small handfuls as it would not be worth my time and effort to have my concentration interrupted for small tasks. I will make 1,000 Terranite Arrows per request, for which I will need "+@TARROW_REQ_TERRA_ORE+" Terranite Ore, "+@TARROW_REQ_COAL+" Coal and "+@TARROW_REQ_GP+" gold pieces.\"";
next;
@@ -263,8 +247,7 @@ L_Arrows_Forge:
|| (countitem("Coal") < @TARROW_REQ_COAL)
|| (countitem("TerraniteOre") < @TARROW_REQ_TERRA_ORE) )
goto L_Arrows_Wait;
- set @state, 13;
- callsub S_Update_Mask;
+ set QL_TERRANITE_ARMOR, 13;
delitem "Coal", @TARROW_REQ_COAL;
delitem "TerraniteOre", @TARROW_REQ_TERRA_ORE;
getexp @heathin_xp_bonus, 0;
@@ -282,8 +265,7 @@ L_Arrows_Ready:
getinventorylist;
if ((checkweight("TerraniteArrow", 1000) == 0) || (@inventorylist_count == 100))
goto L_InventoryNoSpace;
- set @state, 14;
- callsub S_Update_Mask;
+ set QL_TERRANITE_ARMOR, 14;
getitem "TerraniteArrow", 1000;
mes "[Heathin]";
mes "\"All done, here you go! I hope you like them. I am still working on my commission, but if you ever need any more Terranite Arrows, just come on by with "+@TARROW_REQ_COAL+" Coal, "+@TARROW_REQ_TERRA_ORE+" Terranite Ore and "+@TARROW_REQ_GP+" gold pieces and I will make another 1,000 arrows for you. By now I have enough Terranite Ore in reserve that you can just trade me my requirements to keep my resources up. Thank you for all your efforts!\"";
@@ -331,9 +313,6 @@ L_InventoryNoSpace:
mes "\"Hm no. You can't carry this right now. Make some room and come back.\"";
close;
-S_Update_Mask:
- set QUEST_NorthTulimshar, (QUEST_NorthTulimshar & ~(NIBBLE_6_MASK)) | (@state << NIBBLE_6_SHIFT);
- return;
}
001-2,25,55,0|script|HeathinDebug|147
{
@@ -344,7 +323,7 @@ S_Update_Mask:
"Exit", L_End;
L_Reset:
- set QUEST_NorthTulimshar, (QUEST_NorthTulimshar & ~(NIBBLE_6_MASK) | (0 << NIBBLE_6_SHIFT));
+ set QL_TERRANITE_ARMOR, 0;
mes "Reset!";
goto L_End;
diff --git a/world/map/npc/001-2/sandra.txt b/world/map/npc/001-2/sandra.txt
index a94d10a3..2465290b 100644
--- a/world/map/npc/001-2/sandra.txt
+++ b/world/map/npc/001-2/sandra.txt
@@ -1,11 +1,7 @@
-// Variables used: nibble 3 of QUEST_SouthTulimshar
-
001-2,98,88,0|script|Sandra|114
{
- set @state, ((QUEST_SouthTulimshar & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);
-
- if (@state >= 2) goto L_Done;
- if (@state == 1) goto L_Progress;
+ if (QL_SANDRA >= 2) goto L_Done;
+ if (QL_SANDRA == 1) goto L_Progress;
mes "[Sandra]";
mes "\"Hunting monsters for potion ingredients can sometimes be a difficult task.\"";
@@ -67,8 +63,7 @@ L_Req2:
goto L_Set;
L_Set:
- set @state, 1;
- callsub S_Update_Var;
+ set QL_SANDRA, 1;
mes "\"Please get them for me!\"";
goto L_Close;
@@ -84,8 +79,7 @@ L_Progress:
delitem "ScorpionStinger", 5;
getitem "Bow", 1;
getitem "Arrow", 100;
- set @state, 2;
- callsub S_Update_Var;
+ set QL_SANDRA, 2;
goto L_Close;
L_NotEnough:
@@ -100,7 +94,6 @@ L_Done:
L_Close:
set @TEMP, 0;
- set @state, 0;
close;
L_TooMany:
@@ -108,8 +101,4 @@ L_TooMany:
mes "[Sandra]";
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_3_MASK) | (@state << NIBBLE_3_SHIFT));
- return;
}
diff --git a/world/map/npc/001-2/yanis.txt b/world/map/npc/001-2/yanis.txt
index e8cf13a3..31a91f77 100644
--- a/world/map/npc/001-2/yanis.txt
+++ b/world/map/npc/001-2/yanis.txt
@@ -4,8 +4,6 @@
001-2,31,21,0|script|Yanis|107
{
set QUEST_NorthTulimshar, QUEST_NorthTulimshar | $@knowYanisNT;
- set @kylian, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT);
- set @imec, ((QUEST_NorthTulimshar & TWOBIT_4_MASK) >> TWOBIT_4_SHIFT);
set @halloween_npc_id, $@halloween_npc_yanis;
callfunc "TrickOrTreat";
@@ -15,7 +13,7 @@ L_Base_Menu:
mes "[Yanis]";
mes "\"Welcome. I'm handling issues with trading licenses for the shop owners in Tulimshar. Can I help you?\"";
- if (@imec != 1)
+ if (QL_IMEC != 1)
menu
"Nothing right now.",L_BeforeClose;
menu
@@ -29,19 +27,16 @@ L_Next:
next;
mes "[Yanis]";
mes "\"Here you have a letter of acknowledgement. You can bring that back to Imec. We will have a look at his case.\"";
- set @imec, 2;
- set QUEST_NorthTulimshar, (QUEST_NorthTulimshar & ~(TWOBIT_4_MASK)) | (@imec << TWOBIT_4_SHIFT);
+ set QL_IMEC, 2;
goto L_BeforeClose;
L_BeforeClose:
- if (@kylian != 3)
+ if (QL_KYLIAN != 3)
goto L_Close;
next;
mes "You think that this is the person Kylian needs to talk to. You should tell him.";
goto L_Close;
L_Close:
- set @imec, 0;
- set @kylian, 0;
close;
}
diff --git a/world/map/npc/002-1/anwar.txt b/world/map/npc/002-1/anwar.txt
index d0c73abf..bdae05c2 100644
--- a/world/map/npc/002-1/anwar.txt
+++ b/world/map/npc/002-1/anwar.txt
@@ -1,25 +1,5 @@
-// Anwar needs a magic fertilizer for his field
-// Quest uses Nibble 3 of QUEST_NorthTulimshar
-// Author: Jenalya
-// state 1: Anwar sent to Tinris for help to get a magic fertilizer
-// state 2: Tinris asked for chocolate cake as present for his girlfriend
-// state 3: Tinris asked for ingredients for the fertilizer
-// state 4: Tinris gave you the fertilizer
-// state 5: Anwar tried it out and it doesn't work well, sent you back to Tinris
-// state 6: Tinris asked for more ingredients for a new try
-// state 7: Tinris says it's really hard, gives you the fertilizer and tells you to ask Eomie to cast a spell on it
-// state 8: Eomie sends you to get some stuff so she can interrupt her spell on the spot of grass
-// state 9: Eomie casted a spell on the fertilizer
-// state 10: Anwar used it and it worked. he asks you to help him preparing a thank-you-gift for each Tinris and Eomis
-// state 11: Anwar asked to bring present to Tinris
-// state 12: gave present to Tinris
-// state 13: Anwar asked to bring present to Eomie
-// state 14: gave present to Eomie
-// state 15: reported back to Anwar and done
002-1,95,67,0|script|Anwar|156
{
- set @state, ((QUEST_NorthTulimshar & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);
-
set @cloth_amount, 3;
set @silk_amount, 30;
@@ -28,12 +8,12 @@
set @material_exp, 1000;
set @final_exp, 2000;
- if (@state >= 15) goto L_Done;
- if (@state >= 13) goto L_GiveEomie;
- if (@state >= 11) goto L_GiveTinris;
- if (@state == 10) goto L_GiftMaterial;
- if (@state >= 5) goto L_SecondTry;
- if (@state >= 1) goto L_FirstTry;
+ if (QL_ANWAR >= 15) goto L_Done;
+ if (QL_ANWAR >= 13) goto L_GiveEomie;
+ if (QL_ANWAR >= 11) goto L_GiveTinris;
+ if (QL_ANWAR == 10) goto L_GiftMaterial;
+ if (QL_ANWAR >= 5) goto L_SecondTry;
+ if (QL_ANWAR >= 1) goto L_FirstTry;
mes "[Anwar]";
mes "\"Hello. You look like one of those young people who come here to go on an adventure.";
@@ -49,14 +29,13 @@ L_Sure:
mes "\"I can't go there myself, since this area of the city is full of sneaky ragtags and they will rob my field if I leave here. Could you go to the magic school and ask for some magic enhancement for my field?\"";
next;
mes "\"To find the school just follow the street north back into town. The school is the castle at the north end of town.\"";
- set @state, 1;
- callsub S_Update_Mask;
+ set QL_ANWAR, 1;
goto L_Close;
-L_FirstTry: // @state >= 1 but below 5
+L_FirstTry: // QL_ANWAR >= 1 but below 5
mes "[Anwar]";
mes "\"I hope the wizards at the magic school can help me with the field. I'd really like to have more free time. I want to make clothing, but I'm not experienced enough to make a living out of that.\"";
- if (@state != 4)
+ if (QL_ANWAR != 4)
goto L_Close;
menu
"Tinris gave me a magic fertilizer for your field, but he isn't sure if it works.",L_Next;
@@ -70,14 +49,13 @@ L_Next:
mes "[Anwar]";
mes "\"Oh no! What is this? It's damaging my plants! Go back to Tinris and tell him it doesn't work!\"";
getexp @firstTry_exp, 0;
- set @state, 5;
- callsub S_Update_Mask;
+ set QL_ANWAR, 5;
goto L_Close;
-L_SecondTry: // @state >= 5 but below 10
+L_SecondTry: // QL_ANWAR >= 5 but below 10
mes "[Anwar]";
mes "\"I hope Tinris can come up with a better fertilizer. My plants are suffering from the first try.\"";
- if (@state != 9)
+ if (QL_ANWAR != 9)
goto L_Close;
menu
"Here is another one. Eomie cast a spell on it.",L_Continue;
@@ -91,12 +69,11 @@ L_Continue:
mes "[Anwar]";
mes "\"Ah, this one is better. I'll put it on the entire field.\"";
getexp @secondTry_exp, 0;
- set @state, 10;
- callsub S_Update_Mask;
+ set QL_ANWAR, 10;
next;
goto L_GiftMaterial;
-L_GiftMaterial: // @state == 10
+L_GiftMaterial: // QL_ANWAR == 10
mes "[Anwar]";
mes "\"I want to show my gratitude to Tinris and Eomie. Can you help me once again? I would like to make some clothes for them and need " + @cloth_amount + " pieces of Cotton Cloth and " + @silk_amount + " Silk Cocoons.\"";
menu
@@ -115,8 +92,7 @@ L_GiveGiftStuff:
getexp @material_exp, 0;
getitem "GreenVNeckSweater", 1;
- set @state, 11;
- callsub S_Update_Mask;
+ set QL_ANWAR, 11;
mes "[Anwar]";
mes "\"Great! I'll start right away with the present for Tinris. That shouldn't take long.\"";
mes "After a short while of cutting and sewing he holds a V-Neck Sweater in his hands. Then he dyes it green.";
@@ -133,10 +109,10 @@ L_Hint:
mes "They live in the woodland area around Hurnscald. You can get there by taking the ferry.\"";
goto L_Close;
-L_GiveTinris: // @state >= 11 but below 13
+L_GiveTinris: // QL_ANWAR >= 11 but below 13
mes "[Anwar]";
mes "\"Did you already bring the Green V-Neck Sweater to Tinris?\"";
- if (@state != 12)
+ if (QL_ANWAR != 12)
menu
"Not yet.",L_Close;
menu
@@ -149,17 +125,16 @@ L_Happy:
mes "[Anwar]";
mes "\"Wonderful! I also finished the present for Eomie. Can you bring it to her?\"";
getitem "SilkHeadband", 1;
- set @state, 13;
- callsub S_Update_Mask;
+ set QL_ANWAR, 13;
goto L_Close;
-L_GiveEomie: // @state >= 13 but below 15
+L_GiveEomie: // QL_ANWAR >= 13 but below 15
getinventorylist;
if (@inventorylist_count == 100)
goto L_Full_Inv;
mes "[Anwar]";
mes "\"Did you give the Silk Headband to Eomie?\"";
- if (@state != 14)
+ if (QL_ANWAR != 14)
menu
"Not yet.",L_Close;
menu
@@ -171,11 +146,10 @@ L_ThankYou:
mes "\"I'm so happy. Thank you so much for your help. I made this for you while you went to see Eomie.\"";
getexp @final_exp, 0;
getitem "DarkGreenCottonTrousers", 1;
- set @state, 15;
- callsub S_Update_Mask;
+ set QL_ANWAR, 15;
goto L_Close;
-L_Done: // @state == 15
+L_Done: // QL_ANWAR == 15
mes "[Anwar]";
mes "\"Thank you so much for your help. The plants are growing much better now. I don't have to spend all my time working in the field any more.";
mes "Finally I can do what I'm really interested in and work on getting better at sewing clothes.\"";
@@ -192,13 +166,8 @@ L_Full_Inv:
goto L_Close;
L_Close:
- set @state, 0;
set @cloth_amount, 0;
set @silk_amount, 0;
set @inventorylist_count, 0;
close;
-
-S_Update_Mask:
- set QUEST_NorthTulimshar, (QUEST_NorthTulimshar & ~(NIBBLE_3_MASK)) | (@state << NIBBLE_3_SHIFT);
- return;
}
diff --git a/world/map/npc/002-1/lieutenant_dausen.txt b/world/map/npc/002-1/lieutenant_dausen.txt
index 2751d49a..33e88da3 100644
--- a/world/map/npc/002-1/lieutenant_dausen.txt
+++ b/world/map/npc/002-1/lieutenant_dausen.txt
@@ -1,28 +1,22 @@
-// Lieutenant in charge of monitoring the monster threat surrounding the city.
-// Variables used: nibble 4 and 5 of QUEST_SouthTulimshar
-
002-1,63,67,0|script|Lieutenant Dausen|122
{
- set @state, ((QUEST_SouthTulimshar & BYTE_2_MASK) >> BYTE_2_SHIFT);
-
- if (@state == 21) goto L_LD_Key;
- if (@state == 7) goto L_LD_Miners;
- if (@state == 6) goto L_LD_Orders;
- if (@state == 5) goto L_LD_Nickos_Waits;
- if (@state == 4) goto L_LD_Nickos;
- if (@state == 3) goto L_LD_Waits;
- if (@state == 2) goto L_LD_Woe_Is_Me;
- if (@state == 1) goto L_LD_Drinks;
+ if (QL_MINEALL == 21) goto L_LD_Key;
+ if (QL_MINEALL == 7) goto L_LD_Miners;
+ if (QL_MINEALL == 6) goto L_LD_Orders;
+ if (QL_MINEALL == 5) goto L_LD_Nickos_Waits;
+ if (QL_MINEALL == 4) goto L_LD_Nickos;
+ if (QL_MINEALL == 3) goto L_LD_Waits;
+ if (QL_MINEALL == 2) goto L_LD_Woe_Is_Me;
+ if (QL_MINEALL == 1) goto L_LD_Drinks;
mes "[Lieutenant Dausen]";
mes "\"Hello. I am Lieutenant Dausen. I monitor the monster threat around the city to ensure the safety of its citizens.\"";
- if (@state)
+ if (QL_MINEALL)
goto L_Close;
goto L_LD_Start;
L_LD_Start:
- set @state, 1;
- callsub S_Update_Var;
+ set QL_MINEALL, 1;
next;
mes "\"Out here in the desert, it sure does get hot! My men and I get thirsty rather quickly. Cactus Drinks are our favourite; if you can get some for us, we'd surely appreciate your effort. About 10 would do.\"";
goto L_Close;
@@ -33,8 +27,7 @@ L_LD_Drinks:
getinventorylist;
if (@inventorylist_count - (countitem("CactusDrink") == 10) > 99)
goto L_LD_TooMany;
- set @state, 2;
- callsub S_Update_Var;
+ set QL_MINEALL, 2;
delitem "CactusDrink", 10;
getitem "Boots", 1;
mes "[Lieutenant Dausen]";
@@ -65,8 +58,7 @@ L_LD_Woe_Is_Me:
"Bye-bye.", L_LD_NoHelp;
L_LD_Help:
- set @state, 3;
- callsub S_Update_Var;
+ set QL_MINEALL, 3;
mes "[Lieutenant Dausen]";
mes "\"Oh! Would you? You are ever most helpful! Could you let Stewen know first? I'm the most worried about the monsters from the eastern desert and he should know first to hold his post. Come back to me after you see him. Hope to hear from you soon!\"";
goto L_Close;
@@ -82,8 +74,7 @@ L_LD_Waits:
goto L_Close;
L_LD_Nickos:
- set @state, 5;
- callsub S_Update_Var;
+ set QL_MINEALL, 5;
mes "[Lieutenant Dausen]";
mes "\"Thanks for letting Stewen know. Can you now tell Nickos to hold his post too? He guards the mine to the south, monitoring the monster threat and protecting the miners when he can.\"";
goto L_Close;
@@ -94,8 +85,7 @@ L_LD_Nickos_Waits:
goto L_Close;
L_LD_Orders:
- set @state, 7;
- callsub S_Update_Var;
+ set QL_MINEALL, 7;
set Zeny, Zeny + 500;
mes "[Lieutenant Dausen]";
mes "\"Thank you for clearing up the orders to my men! Here's some gold for your efforts.\"";
@@ -111,17 +101,11 @@ L_LD_Miners:
goto L_Close;
L_LD_Key:
- set @state, 22;
- callsub S_Update_Var;
+ set QL_MINEALL, 22;
mes "[Lieutenant Dausen]";
mes "\"Oh, Naem lost his key? Here, take this spare. It should help you get into the underground palace.\"";
goto L_Close;
L_Close:
- set @state, 0;
close;
-
-S_Update_Var:
- set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(BYTE_2_MASK) | (@state << BYTE_2_SHIFT));
- return;
}
diff --git a/world/map/npc/002-1/mine_debug.txt b/world/map/npc/002-1/mine_debug.txt
index eb01dc81..6ffbe49a 100644
--- a/world/map/npc/002-1/mine_debug.txt
+++ b/world/map/npc/002-1/mine_debug.txt
@@ -12,8 +12,9 @@ function|script|DesertMineDebug
"nothing.", L_Close;
L_Reset:
- set @state, 0;
- callsub S_Update_Var;
+ set QL_MINEALL, 0;
+ set FLAGS, FLAGS &~ FLAG_GOT_NAEM_GLOVES;
+ set FLAGS, FLAGS &~ FLAG_OPENED_UNDERGROUND;
goto L_Close;
L_Set:
@@ -22,21 +23,14 @@ L_Set:
mes "18 is Angry Scorpions Start";
mes "20 is Underground Palace Start";
mes "26 is Giant Cave Maggot Start";
- input @state;
- callsub S_Update_Var;
+ input QL_MINEALL;
goto L_Close;
L_Show:
- set @state, ((QUEST_SouthTulimshar & BYTE_2_MASK) >> BYTE_2_SHIFT);
- mes "Current State: " + @state;
+ mes "Current State: " + QL_MINEALL;
goto L_Close;
L_Close:
- set @state, 0;
- return;
-
-S_Update_Var:
- set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(BYTE_2_MASK) | (@state << BYTE_2_SHIFT));
return;
}
002-1,61,69,0|script|Mine Debug#1|122
diff --git a/world/map/npc/002-1/nickos.txt b/world/map/npc/002-1/nickos.txt
index 99f17b5c..97b1c6a7 100644
--- a/world/map/npc/002-1/nickos.txt
+++ b/world/map/npc/002-1/nickos.txt
@@ -1,20 +1,15 @@
-// Sandstorm mine guard
-// Variables used: nibble 4 and 5 of QUEST_SouthTulimshar
-
002-1,46,108,0|script|Nickos|123
{
- set @state, ((QUEST_SouthTulimshar & BYTE_2_MASK) >> BYTE_2_SHIFT);
-
- if (@state == 20) goto L_UGQ;
- if (@state == 19) goto L_AS_Done;
- if (@state == 18) goto L_AS_Start;
- if (@state >= 11) && (@state < 18) goto L_Guards;
- if (@state == 10) goto L_Check_Happy;
- if (@state > 7) && (@state < 10) goto L_Waits;
- if (@state == 7) goto L_Mine;
- if (@state == 6) goto L_Orders_Received;
- if (@state == 5) goto L_Orders;
- if (@state < 5) goto L_See_Dausen_First;
+ if (QL_MINEALL == 20) goto L_UGQ;
+ if (QL_MINEALL == 19) goto L_AS_Done;
+ if (QL_MINEALL == 18) goto L_AS_Start;
+ if (QL_MINEALL >= 11) && (QL_MINEALL < 18) goto L_Guards;
+ if (QL_MINEALL == 10) goto L_Check_Happy;
+ if (QL_MINEALL > 7) && (QL_MINEALL < 10) goto L_Waits;
+ if (QL_MINEALL == 7) goto L_Mine;
+ if (QL_MINEALL == 6) goto L_Orders_Received;
+ if (QL_MINEALL == 5) goto L_Orders;
+ if (QL_MINEALL < 5) goto L_See_Dausen_First;
mes "[Nickos]";
mes "\"I'm watching this mine to make sure the monsters don't harm the miners.\"";
@@ -29,8 +24,7 @@ L_See_Dausen_First:
goto L_Close;
L_Orders:
- set @state, 6;
- callsub S_Update_Var;
+ set QL_MINEALL, 6;
mes "[Nickos]";
mes "\"I have to hold my post longer? Argh! I was looking forward to my break. Oh well, thanks for letting me know.\"";
goto L_Close;
@@ -55,8 +49,7 @@ L_Disappoint:
goto L_Close;
L_Mine_Open:
- set @state, 8;
- callsub S_Update_Var;
+ set QL_MINEALL, 8;
mes "[Nickos]";
mes "\"Excellent! You now have my permission to enter the mine. Your assistance helps ease my worries.\"";
goto L_Close;
@@ -67,8 +60,7 @@ L_Waits:
goto L_Close;
L_Check_Happy:
- set @state, 11;
- callsub S_Update_Var;
+ set QL_MINEALL, 11;
set Zeny, Zeny + 500;
mes "[Nickos]";
mes "\"Oh, everything is okay? That's great! I think they are pretty busy and could use some help. Feel free to give them a hand. Here's some gold for your troubles.\"";
@@ -82,8 +74,7 @@ L_Guards:
goto L_Close;
L_AS_Start:
- set @state, 19;
- callsub S_Update_Var;
+ set QL_MINEALL, 19;
mes "[Nickos]";
mes "\"Oh, the angry scorpions are becoming a problem? We could thin down their numbers a bit. I can make it worth your time, but of course, I'll need something to show your work. Bring me 10 Angry Scorpion Stingers to demonstrate your effectiveness, and you will be rewarded for your efforts.\"";
goto L_Close;
@@ -94,8 +85,7 @@ L_AS_Done:
getinventorylist;
if (@inventorylist_count - (countitem("AngryScorpionStinger") == 10) > 99)
goto L_TooMany;
- set @state, 20;
- callsub S_Update_Var;
+ set QL_MINEALL, 20;
delitem "AngryScorpionStinger", 10;
getitem "LeatherShield", 1;
mes "[Nickos]";
@@ -120,10 +110,5 @@ L_UGQ:
goto L_Close;
L_Close:
- set @state, 0;
close;
-
-S_Update_Var:
- set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(BYTE_2_MASK) | (@state << BYTE_2_SHIFT));
- return;
}
diff --git a/world/map/npc/002-1/sarah.txt b/world/map/npc/002-1/sarah.txt
index 3b7a7232..e70f36eb 100644
--- a/world/map/npc/002-1/sarah.txt
+++ b/world/map/npc/002-1/sarah.txt
@@ -1,11 +1,7 @@
-// Variables used: nibble 1 of QUEST_SouthTulimshar
-
002-1,93,43,0|script|Sarah|106
{
- set @state, ((QUEST_SouthTulimshar & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT);
-
- if (@state >= 2) goto L_Done;
- if (@state == 1) goto L_Progress;
+ if (QL_SARAH >= 2) goto L_Done;
+ if (QL_SARAH == 1) goto L_Progress;
mes "[Sarah]";
mes "\"Boy, am I hungry or what!\"";
@@ -35,8 +31,7 @@ L_Req0:
mes "[Sarah]";
mes "\"Yippee! Bring me a piece of Cherry Cake, and I'll give you a nice hat!\"";
next;
- set @state, 1;
- callsub S_Update_Var;
+ set QL_SARAH, 1;
mes "[Sarah]";
mes "\"Please bring it to me!\"";
goto L_Close;
@@ -52,8 +47,7 @@ L_Progress:
if ((@inventorylist_count - (countitem("CherryCake") == 1)) > 99) goto L_TooMany;
delitem "CherryCake", 1;
getitem "SerfHat", 1;
- set @state, 2;
- callsub S_Update_Var;
+ set QL_SARAH, 2;
close2;
emotion EMOTE_TONGUE, strcharinfo(0);
end;
@@ -72,7 +66,6 @@ L_Done:
L_Close:
set @TEMP, 0;
- set @state, 0;
close;
L_TooMany:
@@ -80,8 +73,4 @@ L_TooMany:
mes "[Sarah]";
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_1_MASK) | (@state << NIBBLE_1_SHIFT));
- return;
}
diff --git a/world/map/npc/002-1/stewen.txt b/world/map/npc/002-1/stewen.txt
index 63808935..7daca790 100644
--- a/world/map/npc/002-1/stewen.txt
+++ b/world/map/npc/002-1/stewen.txt
@@ -1,20 +1,14 @@
-// East sandstorm guard
-// Variables used: nibble 4 and 5 of QUEST_SouthTulimshar
-
002-1,116,93,0|script|Stewen|123
{
- set @state, ((QUEST_SouthTulimshar & BYTE_2_MASK) >> BYTE_2_SHIFT);
-
- if (@state == 4) goto L_TMW_Quest_Received;
- if (@state == 3) goto L_TMW_Quest;
+ if (QL_MINEALL == 4) goto L_TMW_Quest_Received;
+ if (QL_MINEALL == 3) goto L_TMW_Quest;
mes "[Stewen]";
mes "\"I'm keeping a watchful eye on the monsters to the east so they don't threaten Tulimshar's citizens. They are pretty strong.\"";
goto L_Close;
L_TMW_Quest:
- set @state, 4;
- callsub S_Update_Var;
+ set QL_MINEALL, 4;
mes "[Stewen]";
mes "\"I don't get a break?! Lieutenant Dausen needs to ask the Wizard's Council for more help out here. Either that or give me a raise! Oh well. Thanks for letting me know.\"";
goto L_Close;
@@ -25,10 +19,5 @@ L_TMW_Quest_Received:
goto L_Close;
L_Close:
- set @state, 0;
close;
-
-S_Update_Var:
- set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(BYTE_2_MASK) | (@state << BYTE_2_SHIFT));
- return;
}
diff --git a/world/map/npc/002-2/casino.txt b/world/map/npc/002-2/casino.txt
index b99f6911..5e3999ac 100644
--- a/world/map/npc/002-2/casino.txt
+++ b/world/map/npc/002-2/casino.txt
@@ -1,17 +1,12 @@
-// Casino
-
-// takes part in quest given by 021-2/kylian.txt
002-2,79,68,0|script|#CasinoEntrance|32767,13,0
{
set QUEST_NorthTulimshar, QUEST_NorthTulimshar | $@knowCasinoNT;
- set @kylian, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT);
- if (@kylian != 6)
+ if (QL_KYLIAN != 6)
goto L_End;
message strcharinfo(0), "You wonder if Kylian would be interested in visiting the Casino.";
goto L_End;
L_End:
- set @kylian, 0;
end;
}
diff --git a/world/map/npc/002-2/imec.txt b/world/map/npc/002-2/imec.txt
index b8f63e4d..6bb00065 100644
--- a/world/map/npc/002-2/imec.txt
+++ b/world/map/npc/002-2/imec.txt
@@ -1,17 +1,12 @@
-// Merchant got his shop shot down due to selling poison and asks the player for some errand
-// after finishing this, daily quest with scorpion stingers
-// Using bit 8 and 9 of QUEST_NorthTulimshar (first half of nibble 2)
-// author: Jenalya
002-2,36,75,0|script|Imec|162
{
- set @state, ((QUEST_NorthTulimshar & TWOBIT_4_MASK) >> TWOBIT_4_SHIFT);
set @EXP, 90;
set @money, 500;
set @lvl, 10;
- if (@state >= 3) goto L_Stingers;
- if (@state == 2) goto L_Return;
- if (@state == 1) goto L_Bring;
+ if (QL_IMEC >= 3) goto L_Stingers;
+ if (QL_IMEC == 2) goto L_Return;
+ if (QL_IMEC == 1) goto L_Bring;
mes "[Imec]";
mes "%%9";
@@ -40,8 +35,7 @@ L_Next:
mes "[Imec]";
mes "\"Great! Here's the appeal.\"";
mes "Imec gives you a sealed letter, which you store in a safe pocket outside of your inventory.";
- set @state, 1;
- callsub S_Update_Mask;
+ set QL_IMEC, 1;
goto L_Close;
L_Explain:
@@ -53,7 +47,7 @@ L_Explain:
if (BaseLevel < WEDDING_MIN_LEVEL) mes "\"Once you're older, you can even get married there.\"";
next;
mes "\"So... will you submit my appeal for me?\"";
- if (@state == 0)
+ if (QL_IMEC == 0)
goto L_Offer;
goto L_Close;
@@ -82,8 +76,7 @@ L_Next1:
mes "\"What? Oh, right. Here, have this.\"";
getexp @EXP, 0;
set Zeny, Zeny + @money;
- set @state, 3;
- callsub S_Update_Mask;
+ set QL_IMEC, 3;
next;
if (BaseLevel >= @lvl)
goto L_Transition_Stingers;
@@ -111,8 +104,6 @@ L_Stingers:
L_Close:
set @money, 0;
- set @state, 0;
-
set @dq_level, 0;
set @dq_cost, 0;
set @dq_count, 0;
@@ -122,8 +113,4 @@ L_Close:
set @dq_exp, 0;
set @dq_return, 0;
close;
-
-S_Update_Mask:
- set QUEST_NorthTulimshar, (QUEST_NorthTulimshar & ~(TWOBIT_4_MASK)) | (@state << TWOBIT_4_SHIFT);
- return;
}
diff --git a/world/map/npc/002-2/kps.txt b/world/map/npc/002-2/kps.txt
index 73b40466..176b7ba8 100644
--- a/world/map/npc/002-2/kps.txt
+++ b/world/map/npc/002-2/kps.txt
@@ -1,25 +1,18 @@
-// KPS (Killian Parcel Service)
-// Author: Wushin
-// Kylian_Timer denotes current quest time & holds last completed.
-// reuse the 4 bits
-// To Mark 4 Different NPCs.
-// setarray $@kps_npc_bits, $@knowYanisNT, $@knowLatoyNT, $@knowWeellosNT, $@knowCasinoNT;
002-2,120,89,0|script|KPS Manager|191
{
- set @state, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT);
set @run, ((QUEST_NorthTulimshar & TWOBIT_8_MASK) >> TWOBIT_8_SHIFT);
set @run_cnt, ((QUEST_NorthTulimshar & TWOBIT_9_MASK) >> TWOBIT_9_SHIFT);
- if (@state == 15)
+ if (QL_KYLIAN == 15)
goto L_SeeKylian;
- if (@state == 14)
+ if (QL_KYLIAN == 14)
goto L_RunComplete;
- if (@state == 13)
+ if (QL_KYLIAN == 13)
goto L_RunStarted;
- if (@state == 12)
+ if (QL_KYLIAN == 12)
goto L_JobSelect;
- if (@state == 11)
+ if (QL_KYLIAN == 11)
goto L_AcceptJob;
- if (@state == 10)
+ if (QL_KYLIAN == 10)
goto L_OfferJob;
goto L_Default;
@@ -41,8 +34,7 @@ L_OfferJob:
"Nothing.", L_Close;
L_MyName:
- set @state, 11;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 11;
mes "\"Ah. Kylian said you would be dropping by.\"";
next;
mes "\"I assume you are looking for some work?\"";
@@ -62,15 +54,13 @@ L_StartJob:
callfunc "SetKylianRun";
set @run_cnt, 0;
callfunc "SetKylianRunCnt";
- set @state, 12;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 12;
goto L_JobSelect;
L_StartJobAgain:
set @run, 0;
callfunc "SetKylianRun";
- set @state, 12;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 12;
goto L_JobSelect;
L_JobSelect:
@@ -93,8 +83,7 @@ L_JobInfo:
"I need a break.", L_Close;
L_StartRun:
- set @state, 13;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 13;
set @run, @rand_quest;
callfunc "SetKylianRun";
set Kylian_Timer, gettimetick(2);
@@ -128,8 +117,7 @@ L_KylianReward:
set Zeny, Zeny + $@delivery_money;
getexp ($@delivery_exp_mod * BaseLevel), 0;
callfunc "SetKylianRun";
- set @state, 15;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 15;
mes "[" + $@delivery_money + " money]";
mes "[" + ($@delivery_exp_mod * BaseLevel) + " experience points]";
next;
diff --git a/world/map/npc/002-2/kylian.txt b/world/map/npc/002-2/kylian.txt
index dcd94548..33df4ba7 100644
--- a/world/map/npc/002-2/kylian.txt
+++ b/world/map/npc/002-2/kylian.txt
@@ -66,8 +66,6 @@ OnInit:
}
002-2,43,101,0|script|Kylian|193
{
- set @state, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT);
-
set @acorn_amount, 12;
set @suitcase_money, 100;
set @suitcase_exp, 50;
@@ -82,22 +80,20 @@ OnInit:
set @fun_money, 50;
set @fun_exp, 20;
- set @fieri, ((QUEST_SouthTulimshar & NIBBLE_6_MASK) >> NIBBLE_6_SHIFT);
-
- if (@state == 15) goto L_Done;
- if (@state >= 11) goto L_Helping;
- if (@state == 10) goto L_OfferedJob;
- if (@state == 9) goto L_Shop;
+ if (QL_KYLIAN == 15) goto L_Done;
+ if (QL_KYLIAN >= 11) goto L_Helping;
+ if (QL_KYLIAN == 10) goto L_OfferedJob;
+ if (QL_KYLIAN == 9) goto L_Shop;
if (@KylianNTCasino) goto L_CasinoDone;
- if (@state == 8) goto L_DesertHat;
- if (@state == 7) goto L_Clothes;
+ if (QL_KYLIAN == 8) goto L_DesertHat;
+ if (QL_KYLIAN == 7) goto L_Clothes;
if (@KylianNTSightSeeing) goto L_SightSeeingDone;
- if (@state == 6) goto L_Casino;
- if (@state == 5) goto L_Food;
+ if (QL_KYLIAN == 6) goto L_Casino;
+ if (QL_KYLIAN == 5) goto L_Food;
if (@KylianNTLicense) goto L_LicenseDone;
- if (@state == 4) goto L_SightSeeing;
- if (@state == 3) goto L_ShopLicense;
- if (@state >= 1) goto L_Suitcase;
+ if (QL_KYLIAN == 4) goto L_SightSeeing;
+ if (QL_KYLIAN == 3) goto L_ShopLicense;
+ if (QL_KYLIAN >= 1) goto L_Suitcase;
mes "[Kylian]";
mes "\"Ah! Are you the room service? I've some requests.\"";
@@ -117,14 +113,13 @@ L_Luggage:
mes "[Kylian]";
mes "\"I need you to get my luggage from the docks. Just show this paper to the sailor who's watching the luggage.\"";
mes "He gives you his ticket, which you promptly store in a safe pocket outside of your inventory.";
- set @state, 1;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 1;
goto L_Close;
-L_Suitcase: // @state >= 1, but below 3
+L_Suitcase: // QL_KYLIAN >= 1, but below 3
mes "[Kylian]";
mes "\"Did you get my luggage from the docks?\"";
- if (@state != 2)
+ if (QL_KYLIAN != 2)
goto L_Close;
menu
"Here it is.",L_Continue,
@@ -137,8 +132,7 @@ L_Continue:
set Zeny, Zeny + @suitcase_money;
getitem "Acorn", @acorn_amount;
getexp @suitcase_exp, 0;
- set @state, 3;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 3;
next;
mes "[Kylian]";
mes "\"Ah! Very good. I have some urgent paperwork that I've been needing to attend to.\"";
@@ -151,7 +145,7 @@ L_Continue:
next;
goto L_ShopLicense;
-L_ShopLicense: // @state == 3
+L_ShopLicense: // QL_KYLIAN == 3
mes "[Kylian]";
mes "\"I'm a salesman and came to Tulimshar because I'm thinking about establishing a shop here.\"";
mes "\"While I'm going through my papers, could you find out whom I have to talk to about opening up a shop in this city?\"";
@@ -164,8 +158,7 @@ L_ShopLicense: // @state == 3
L_GovBuild:
set Zeny, Zeny + @license_money;
getexp @license_exp, 0;
- set @state, 4;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 4;
set @KylianNTLicense, 1;
mes "[Kylian]";
mes "\"Ah... excellent! That's very helpful. Could you tell me how to get to that building?\"";
@@ -178,7 +171,7 @@ L_LicenseDone: // the player didn't log out yet after telling about Yanis
mes "\"I need to prepare my papers now. I might have some more questions later on though.\"";
goto L_Close;
-L_SightSeeing: // @state == 4 and logged out sometime between getting to that state and now
+L_SightSeeing: // QL_KYLIAN == 4 and logged out sometime between getting to that state and now
mes "[Kylian]";
mes "\"You came here at just the right moment! I have finished my business affairs, and I think I should use my time here to learn a bit about the culture in the area. Can you tell me if there are any historical places or landmarks to visit?\"";
if (!(QUEST_NorthTulimshar & $@knowWeellosNT))
@@ -190,18 +183,17 @@ L_SightSeeing: // @state == 4 and logged out sometime between getting to that st
L_HistBuild:
set Zeny, Zeny + @sightseeing_money;
getexp @sightseeing_exp, 0;
- set @state, 5;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 5;
mes "[Kylian]";
mes "\"This sounds interesting. Please tell me the way.\"";
mes "You tell him how to get to the historic building.";
next;
goto L_Food;
-L_Food: // @state == 5
+L_Food: // QL_KYLIAN == 5
mes "[Kylian]";
mes "\"While I'm out, I could also get something to eat. Do you have any suggestions for local cuisine?\"";
- if (@fieri < 4) // didn't yet help Fieri make Tonori Delight
+ if (QL_FIERI < 4) // didn't yet help Fieri make Tonori Delight
goto L_Close;
menu
"A man named Fieri makes a tasty Tonori Delight over at the castle.",L_SoupBer,
@@ -210,8 +202,7 @@ L_Food: // @state == 5
L_SoupBer:
set Zeny, Zeny + @food_money;
getexp @food_exp, 0;
- set @state, 6;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 6;
set @KylianNTSightSeeing, 1;
goto L_SightSeeingDone;
@@ -220,7 +211,7 @@ L_SightSeeingDone:
mes "\"I'm going to see the historic building you told me about and try the local food at the castle. Thank you for the suggestions.\"";
goto L_Close;
-L_Casino: // @state == 6 and logged out sometime between getting to that state and now
+L_Casino: // QL_KYLIAN == 6 and logged out sometime between getting to that state and now
mes "[Kylian]";
mes "\"Hello. I just came back from my sight-seeing tour, and this Tonori Delight really was delicious. I wonder what it's made of...\"";
next;
@@ -234,15 +225,14 @@ L_Casino: // @state == 6 and logged out sometime between getting to that state a
L_CasinoFound:
set Zeny, Zeny + @casino_money;
getexp @casino_exp, 0;
- set @state, 7;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 7;
mes "[Kylian]";
mes "\"Oh! There's a casino in this city? That's wonderful! Where can I find it?\"";
mes "You explain how to get to the casino.";
next;
goto L_Clothes;
-L_Clothes: // @state == 7
+L_Clothes: // QL_KYLIAN == 7
mes "[Kylian]";
mes "\"I should acquire proper clothing before I go to the casino tonight. Do you know a reputable shop where high-quality clothing is sold?\"";
if (!(QUEST_NorthTulimshar & $@knowLatoyNT))
@@ -254,8 +244,7 @@ L_Clothes: // @state == 7
L_HarborDistrict:
set Zeny, Zeny + @clothes_money;
getexp @clothes_exp, 0;
- set @state, 8;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 8;
set @KylianNTCasino, 1;
mes "You explain about Latoy and the quality of his shop.";
next;
@@ -268,7 +257,7 @@ L_CasinoDone:
mes "\"I'm looking forward to going to the casino tonight. See me tomorrow, and I might have more requests.\"";
goto L_Close;
-L_DesertHat: // @state == 8
+L_DesertHat: // QL_KYLIAN == 8
mes "Kylian looks a bit tired.";
next;
mes "[Kylian]";
@@ -279,8 +268,7 @@ L_DesertHat: // @state == 8
if ((checkweight("DesertHat", 1) == 0) || (@inventorylist_count == 100))
goto L_Inventory;
getitem "DesertHat", 1;
- set @state, 9;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 9;
next;
goto L_Close;
@@ -291,8 +279,7 @@ L_Shop:
next;
mes "\"If you are looking for work, go see the shop keeper I have working for me there.\"";
mes "\"Mention your name, and he will know I sent you.\"";
- set @state, 10;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 10;
goto L_Close;
L_OfferedJob:
@@ -319,8 +306,7 @@ L_Done:
getexp ($@delivery_exp_mod * BaseLevel), 0;
set @run_cnt, 0;
callfunc "SetKylianRunCnt";
- set @state, 12;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 12;
mes "[" + $@delivery_money + " money]";
mes "[" + ($@delivery_exp_mod * BaseLevel) + " experience points]";
next;
@@ -351,20 +337,12 @@ L_Close:
set @fun_money, 0;
set @fun_exp, 0;
set @inventorylist_count, 0;
- set @fieri, 0;
// NOT set to zero: @KylianNTLicense, @KylianNTSightSeeing and @KylianNTCasino
// those are used to check if the player logged out in the meanwhile
close;
}
-function|script|SetKylianQuest
-{
- set QUEST_NorthTulimshar, (QUEST_NorthTulimshar & ~(NIBBLE_5_MASK)) | (@state << NIBBLE_5_SHIFT);
- return;
-}
function|script|KylianDebug
{
- set @state, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT);
- set @fieri, ((QUEST_SouthTulimshar & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
set @run, ((QUEST_NorthTulimshar & TWOBIT_8_MASK) >> TWOBIT_8_SHIFT);
set @run_cnt, ((QUEST_NorthTulimshar & TWOBIT_9_MASK) >> TWOBIT_9_SHIFT);
goto L_Menu;
@@ -379,7 +357,7 @@ L_Menu:
"Close.", L_Close;
L_ShowState:
- mes "State: " + @state;
+ mes "State: " + QL_KYLIAN;
mes "Timer: " + Kylian_Timer;
mes "Time: " + gettimetick(2);
mes "Elapsed Time: " + (gettimetick(2) - Kylian_Timer);
@@ -391,8 +369,7 @@ L_ShowState:
L_SetState:
mes "\"Input the quest state desired.\"";
- input @state;
- callfunc "SetKylianQuest";
+ input QL_KYLIAN;
goto L_Menu;
L_WorkTimer:
diff --git a/world/map/npc/002-2/latoy.txt b/world/map/npc/002-2/latoy.txt
index bb818bc1..90dfe9bb 100644
--- a/world/map/npc/002-2/latoy.txt
+++ b/world/map/npc/002-2/latoy.txt
@@ -1,16 +1,11 @@
-// A snobby store that won't sell to the player
-// takes part in quest given by 021-2/kylian.txt
-
002-2,86,93,0|shop|#LatoyShop|32767,SilkHeadband:*4,SilkGloves:*4,SilkPants:*4,SilkRobe:*4
-
002-2,86,93,0|script|Latoy|106
{
set QUEST_NorthTulimshar, QUEST_NorthTulimshar | $@knowLatoyNT;
- set @kylian, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT);
mes "[Latoy]";
mes "\"Is there something I can help you with?\"";
- if (@kylian != 7)
+ if (QL_KYLIAN != 7)
goto L_Shop;
next;
mes "Maybe this is the kind of shop Kylian is looking for?";
@@ -28,6 +23,5 @@ L_LatoyShop:
shop "#LatoyShop";
L_Close:
- set @kylian, 0;
close;
}
diff --git a/world/map/npc/002-3/mining_camp_barrier.txt b/world/map/npc/002-3/mining_camp_barrier.txt
index a6550990..baf815c5 100644
--- a/world/map/npc/002-3/mining_camp_barrier.txt
+++ b/world/map/npc/002-3/mining_camp_barrier.txt
@@ -1,10 +1,6 @@
-//Sandstorm mine barrier
-
002-3,82,32,0|script|#Sandstorm_Mine_Barrier|45,0,0
{
- set @state, ((QUEST_SouthTulimshar & BYTE_2_MASK) >> BYTE_2_SHIFT);
-
- if (@state >= 8) goto L_Barrier_Open;
+ if (QL_MINEALL >= 8) goto L_Barrier_Open;
message strcharinfo(0), "Some force seems to block your entrance.";
goto L_End;
@@ -14,6 +10,5 @@ L_Barrier_Open:
goto L_End;
L_End:
- set @state, 0;
end;
}
diff --git a/world/map/npc/002-3/nathan.txt b/world/map/npc/002-3/nathan.txt
index 125c6a01..bf484907 100644
--- a/world/map/npc/002-3/nathan.txt
+++ b/world/map/npc/002-3/nathan.txt
@@ -1,29 +1,24 @@
-// Variables used: nibble 4 and 5 of QUEST_SouthTulimshar
-
002-3,42,45,6|script|Nathan|109
{
- set @state, ((QUEST_SouthTulimshar & BYTE_2_MASK) >> BYTE_2_SHIFT);
-
- if (@state >= 20) goto L_Nathan_Complete;
- if (@state == 19) goto L_Nathan_UGQ_Naem;
- if (@state == 18) goto L_Nathan_Help_Cool;
- if (@state == 17) goto L_Nathan_Help_Done;
- if (@state == 16) goto L_Nathan_Waits_3;
- if (@state == 15) goto L_Nathan_Help_3;
- if (@state == 14) goto L_Nathan_Waits_2;
- if (@state == 13) goto L_Nathan_Help_2;
- if (@state == 12) goto L_Nathan_Waits_1;
- if (@state == 11) goto L_Nathan_Help_1;
- if (@state == 9) goto L_Nathan_Cool;
- if (@state == 8) goto L_Nathan_Okay;
+ if (QL_MINEALL >= 20) goto L_Nathan_Complete;
+ if (QL_MINEALL == 19) goto L_Nathan_UGQ_Naem;
+ if (QL_MINEALL == 18) goto L_Nathan_Help_Cool;
+ if (QL_MINEALL == 17) goto L_Nathan_Help_Done;
+ if (QL_MINEALL == 16) goto L_Nathan_Waits_3;
+ if (QL_MINEALL == 15) goto L_Nathan_Help_3;
+ if (QL_MINEALL == 14) goto L_Nathan_Waits_2;
+ if (QL_MINEALL == 13) goto L_Nathan_Help_2;
+ if (QL_MINEALL == 12) goto L_Nathan_Waits_1;
+ if (QL_MINEALL == 11) goto L_Nathan_Help_1;
+ if (QL_MINEALL == 9) goto L_Nathan_Cool;
+ if (QL_MINEALL == 8) goto L_Nathan_Okay;
mes "[Nathan the Miner]";
mes "\"It's very dangerous in here. We had a big earthquake here just recently, too... so be careful!\"";
goto L_Close;
L_Nathan_Okay:
- set @state, 9;
- callsub S_Update_Var;
+ set QL_MINEALL, 9;
mes "[Nathan]";
mes "\"Hey there! Just mining away down here. You say Nickos was worried about us? Nothing down here we can't handle, but you should try to be safe down here yourself. The monsters can be rather aggressive. Come to think of it, you might want to check on Naem to make sure he's okay. You can find him in the southeast parts of the mine.\"";
goto L_Close;
@@ -34,8 +29,7 @@ L_Nathan_Cool:
goto L_Close;
L_Nathan_Help_1:
- set @state, 12;
- callsub S_Update_Var;
+ set QL_MINEALL, 12;
mes "[Nathan]";
mes "\"Oh, hey again! Nickos told you we need some help down here too? Yeah, Naem could use a spare pair of hands moving his bags of ore to me. He's got a lot of work built up. Just go talk to him and he'll give you the bags. You might have to make a few trips, but I'll make it worth your troubles.\"";
goto L_Close;
@@ -46,8 +40,7 @@ L_Nathan_Waits_1:
goto L_Close;
L_Nathan_Help_2:
- set @state, 14;
- callsub S_Update_Var;
+ set QL_MINEALL, 14;
mes "You give the bag of ore to Nathan";
next;
mes "[Nathan]";
@@ -60,8 +53,7 @@ L_Nathan_Waits_2:
goto L_Close;
L_Nathan_Help_3:
- set @state, 16;
- callsub S_Update_Var;
+ set QL_MINEALL, 16;
mes "You hand the bag of ore to Nathan.";
next;
mes "[Nathan]";
@@ -77,8 +69,7 @@ L_Nathan_Help_Done:
getinventorylist;
if (@inventorylist_count == 100)
goto L_Nathan_TooMany;
- set @state, 18;
- callsub S_Update_Var;
+ set QL_MINEALL, 18;
getitem "MinersHat", 1;
mes "[Nathan]";
mes "You hand the bag of ore to Nathan.";
@@ -109,10 +100,5 @@ L_Nathan_Complete:
goto L_Close;
L_Close:
- set @state, 0;
close;
-
-S_Update_Var:
- set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(BYTE_2_MASK) | (@state << BYTE_2_SHIFT));
- return;
}
diff --git a/world/map/npc/002-4/mine_triggerone.txt b/world/map/npc/002-4/mine_triggerone.txt
index ef8a75cb..2ea0f8ce 100644
--- a/world/map/npc/002-4/mine_triggerone.txt
+++ b/world/map/npc/002-4/mine_triggerone.txt
@@ -1,13 +1,8 @@
-//Sandstorm mine trigger 1 Trigger 002-4 35,43 (127)
-// Variables used: nibble 4 and 5 of QUEST_SouthTulimshar
-
002-4,30,47,0|script|Button#mine-1|400,0,0
{
- set @state, ((QUEST_SouthTulimshar & BYTE_2_MASK) >> BYTE_2_SHIFT);
-
- if (@state == 24) goto L_Trigger_Wrong_1;
- if (@state == 23) goto L_Trigger_Wrong_1;
- if (@state == 22) goto L_Trigger_1;
+ if (QL_MINEALL == 24) goto L_Trigger_Wrong_1;
+ if (QL_MINEALL == 23) goto L_Trigger_Wrong_1;
+ if (QL_MINEALL == 22) goto L_Trigger_1;
mes "There is a large button on the ground. A key hole appears on the button.";
goto L_Close;
@@ -20,14 +15,12 @@ L_Trigger_Wrong_1:
"Do nothing.", L_Nothing_1;
L_Right_Wrong_1:
- set @state, 22;
- callsub S_Update_Var;
+ set QL_MINEALL, 22;
mes "You turn the key right.";
goto L_Close;
L_Left_Wrong_1:
- set @state, 22;
- callsub S_Update_Var;
+ set QL_MINEALL, 22;
mes "You turn the key left.";
goto L_Close;
@@ -39,14 +32,12 @@ L_Trigger_1:
"Do nothing.", L_Nothing_1;
L_Right_1:
- set @state, 23;
- callsub S_Update_Var;
+ set QL_MINEALL, 23;
mes "You turn the key right. A clicking sound echoes throughout the mine.";
goto L_Close;
L_Left_1:
- set @state, 22;
- callsub S_Update_Var;
+ set QL_MINEALL, 22;
mes "You turn the key left.";
goto L_Close;
@@ -55,10 +46,5 @@ L_Nothing_1:
goto L_Close;
L_Close:
- set @state, 0;
close;
-
-S_Update_Var:
- set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(BYTE_2_MASK) | (@state << BYTE_2_SHIFT));
- return;
}
diff --git a/world/map/npc/002-4/mine_triggerthree.txt b/world/map/npc/002-4/mine_triggerthree.txt
index 707329da..f79f739a 100644
--- a/world/map/npc/002-4/mine_triggerthree.txt
+++ b/world/map/npc/002-4/mine_triggerthree.txt
@@ -1,13 +1,8 @@
-//Sandstorm mine trigger 3 Trigger 002-4 98,42 (127)
-// Variables used: nibble 4 and 5 of QUEST_SouthTulimshar
-
002-4,91,99,0|script|Button#mine-3|400,0,0
{
- set @state, ((QUEST_SouthTulimshar & BYTE_2_MASK) >> BYTE_2_SHIFT);
-
- if (@state == 24) goto L_Trigger_Wrong_3;
- if (@state == 23) goto L_Trigger_3;
- if (@state == 22) goto L_Trigger_Wrong_3;
+ if (QL_MINEALL == 24) goto L_Trigger_Wrong_3;
+ if (QL_MINEALL == 23) goto L_Trigger_3;
+ if (QL_MINEALL == 22) goto L_Trigger_Wrong_3;
mes "There is a large button on the ground. A key hole appears on the button.";
goto L_Close;
@@ -20,14 +15,12 @@ L_Trigger_Wrong_3:
"Do nothing.", L_Nothing_3;
L_Right_Wrong_3:
- set @state, 22;
- callsub S_Update_Var;
+ set QL_MINEALL, 22;
mes "You turn the key right.";
goto L_Close;
L_Left_Wrong_3:
- set @state, 22;
- callsub S_Update_Var;
+ set QL_MINEALL, 22;
mes "You turn the key left.";
goto L_Close;
@@ -39,14 +32,12 @@ L_Trigger_3:
"Do nothing.", L_Nothing_3;
L_Right_3:
- set @state, 22;
- callsub S_Update_Var;
+ set QL_MINEALL, 22;
mes "You turn the key right.";
goto L_Close;
L_Left_3:
- set @state, 24;
- callsub S_Update_Var;
+ set QL_MINEALL, 24;
mes "You turn the key left. A clicking sound echoes throughout the mine.";
goto L_Close;
@@ -55,10 +46,5 @@ L_Nothing_3:
goto L_Close;
L_Close:
- set @state, 0;
close;
-
-S_Update_Var:
- set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(BYTE_2_MASK) | (@state << BYTE_2_SHIFT));
- return;
}
diff --git a/world/map/npc/002-4/mine_triggertwo.txt b/world/map/npc/002-4/mine_triggertwo.txt
index 5ec5b659..bfdf9d17 100644
--- a/world/map/npc/002-4/mine_triggertwo.txt
+++ b/world/map/npc/002-4/mine_triggertwo.txt
@@ -1,15 +1,8 @@
-//Sandstorm mine trigger
-// Variables used:
-// - nibble 4 and 5 of QUEST_SouthTulimshar
-// - in FLAGS, FLAG_OPENED_UNDERGROUND
-
002-4,100,37,0|script|Button#mine-2|400,0,0
{
- set @state, ((QUEST_SouthTulimshar & BYTE_2_MASK) >> BYTE_2_SHIFT);
-
- if (@state == 24) goto L_Trigger_2;
- if (@state == 23) goto L_Trigger_Wrong_2;
- if (@state == 22) goto L_Trigger_Wrong_2;
+ if (QL_MINEALL == 24) goto L_Trigger_2;
+ if (QL_MINEALL == 23) goto L_Trigger_Wrong_2;
+ if (QL_MINEALL == 22) goto L_Trigger_Wrong_2;
mes "There is a large button on the ground. A key hole appears on the button.";
goto L_Close;
@@ -22,14 +15,12 @@ L_Trigger_Wrong_2:
"Do nothing.", L_Nothing_2;
L_Right_Wrong_2:
- set @state, 22;
- callsub S_Update_Var;
+ set QL_MINEALL, 22;
mes "You turn the key right.";
goto L_Close;
L_Left_Wrong_2:
- set @state, 22;
- callsub S_Update_Var;
+ set QL_MINEALL, 22;
mes "You turn the key left.";
goto L_Close;
@@ -41,14 +32,12 @@ L_Trigger_2:
"Do nothing.", L_Nothing_2;
L_Right_2:
- set @state, 22;
- callsub S_Update_Var;
+ set QL_MINEALL, 22;
mes "You turn the key right.";
goto L_Close;
L_Left_2:
- set @state, 25;
- callsub S_Update_Var;
+ set QL_MINEALL, 25;
set FLAGS, FLAGS | FLAG_OPENED_UNDERGROUND;
mes "You turn the key left. A clicking sound echoes throughout the mine, followed by a loud thump.";
goto L_Close;
@@ -58,10 +47,5 @@ L_Nothing_2:
goto L_Close;
L_Close:
- set @state, 0;
close;
-
-S_Update_Var:
- set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(BYTE_2_MASK) | (@state << BYTE_2_SHIFT));
- return;
}
diff --git a/world/map/npc/002-4/naem.txt b/world/map/npc/002-4/naem.txt
index 34e43b49..a918f4c8 100644
--- a/world/map/npc/002-4/naem.txt
+++ b/world/map/npc/002-4/naem.txt
@@ -1,34 +1,27 @@
-// Variables used:
-// - nibble 4 and 5 of QUEST_SouthTulimshar
-// - in FLAGS, bits FLAG_GOT_NAEM_GLOVES and FLAG_OPENED_UNDERGROUND
-
002-4,91,96,6|script|Naem|109
{
- set @state, ((QUEST_SouthTulimshar & BYTE_2_MASK) >> BYTE_2_SHIFT);
-
if (FLAGS & FLAG_GOT_NAEM_GLOVES) goto L_Naem_Complete;
if (FLAGS & FLAG_OPENED_UNDERGROUND) goto L_Naem_Gloves;
- if (@state == 22) goto L_Naem_Code;
- if (@state == 21) goto L_Naem_Lt;
- if (@state == 20) goto L_Naem_Memory;
- if ((@state > 17) && (@state < 19))
+ if (QL_MINEALL == 22) goto L_Naem_Code;
+ if (QL_MINEALL == 21) goto L_Naem_Lt;
+ if (QL_MINEALL == 20) goto L_Naem_Memory;
+ if ((QL_MINEALL > 17) && (QL_MINEALL < 19))
goto L_Naem_Great;
- if (@state == 17) goto L_Naem_Waits_3;
- if (@state == 16) goto L_Naem_Help_3;
- if (@state == 15) goto L_Naem_Waits_2;
- if (@state == 14) goto L_Naem_Help_2;
- if (@state == 13) goto L_Naem_Waits_1;
- if (@state == 12) goto L_Naem_Help_1;
- if (@state == 10) goto L_Naem_Cool;
- if (@state == 9) goto L_Naem_Okay;
+ if (QL_MINEALL == 17) goto L_Naem_Waits_3;
+ if (QL_MINEALL == 16) goto L_Naem_Help_3;
+ if (QL_MINEALL == 15) goto L_Naem_Waits_2;
+ if (QL_MINEALL == 14) goto L_Naem_Help_2;
+ if (QL_MINEALL == 13) goto L_Naem_Waits_1;
+ if (QL_MINEALL == 12) goto L_Naem_Help_1;
+ if (QL_MINEALL == 10) goto L_Naem_Cool;
+ if (QL_MINEALL == 9) goto L_Naem_Okay;
mes "[Naem]";
mes "\"I'm just mining away here. Lots of work to do.\"";
goto L_Close;
L_Naem_Okay:
- set @state, 10;
- callsub S_Update_Var;
+ set QL_MINEALL, 10;
mes "[Naem]";
mes "\"Oh, hello there. Nickos wanted you to check on me? Yeah, you can tell him I'm okay.\"";
goto L_Close;
@@ -39,8 +32,7 @@ L_Naem_Cool:
goto L_Close;
L_Naem_Help_1:
- set @state, 13;
- callsub S_Update_Var;
+ set QL_MINEALL, 13;
mes "[Naem]";
mes "\"Oh, you are here to help move my bags? Cool, I've got a few ready to go. Go ahead and take this one!\"";
next;
@@ -56,8 +48,7 @@ L_Naem_Waits_1:
goto L_Close;
L_Naem_Help_2:
- set @state, 15;
- callsub S_Update_Var;
+ set QL_MINEALL, 15;
mes "Naem gives you a bag of ore.";
next;
mes "[Naem]";
@@ -70,8 +61,7 @@ L_Naem_Waits_2:
goto L_Close;
L_Naem_Help_3:
- set @state, 17;
- callsub S_Update_Var;
+ set QL_MINEALL, 17;
mes "[Naem]";
mes "Hands a bag of ore to you.";
next;
@@ -103,8 +93,7 @@ L_Naem_Duh:
goto L_Close;
L_Naem_Palace_No:
- set @state, 21;
- callsub S_Update_Var;
+ set QL_MINEALL, 21;
mes "[Naem]";
mes "\"Oh no! I lost the key! Don't worry though, talk to Lieutenant Dausen about getting the spare key.\"";
goto L_Close;
@@ -140,10 +129,5 @@ L_Naem_TooMany:
goto L_Close;
L_Close:
- set @state, 0;
close;
-
-S_Update_Var:
- set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(BYTE_2_MASK) | (@state << BYTE_2_SHIFT));
- return;
}
diff --git a/world/map/npc/002-4/underground_palace_barrier.txt b/world/map/npc/002-4/underground_palace_barrier.txt
index 6c9d096a..a3e747ca 100644
--- a/world/map/npc/002-4/underground_palace_barrier.txt
+++ b/world/map/npc/002-4/underground_palace_barrier.txt
@@ -1,10 +1,6 @@
-//underground palace barrier
-
002-4,68,98,0|script|#UGP_Barrier|45,0,0
{
- set @state, ((QUEST_SouthTulimshar & BYTE_2_MASK) >> BYTE_2_SHIFT);
-
- if (@state >= 25) goto L_Barrier_Open;
+ if (QL_MINEALL >= 25) goto L_Barrier_Open;
message strcharinfo(0), "Some force seems to block your entrance.";
goto L_End;
@@ -14,6 +10,5 @@ L_Barrier_Open:
goto L_End;
L_End:
- set @state, 0;
end;
}
diff --git a/world/map/npc/002-5/chest.txt b/world/map/npc/002-5/chest.txt
index 2cdda691..5673bbde 100644
--- a/world/map/npc/002-5/chest.txt
+++ b/world/map/npc/002-5/chest.txt
@@ -1,10 +1,6 @@
-// Variables used: nibble 4 and 5 of QUEST_SouthTulimshar
-
002-5,93,37,0|script|Supply Chest|378
{
- set @state, ((QUEST_SouthTulimshar & BYTE_2_MASK) >> BYTE_2_SHIFT);
-
- if (@state >= 26) goto L_Finished;
+ if (QL_MINEALL >= 26) goto L_Finished;
mes "Hrmm... A supply chest.";
mes "Do you want to try to open it?";
@@ -22,8 +18,7 @@ L_Yes:
mes "You opened the chest and found a short bow!";
delitem "TreasureKey", 3;
getitem "ShortBow", 1;
- set @state, 26;
- callsub S_Update_Var;
+ set QL_MINEALL, 26;
goto L_Close;
L_Not_Enough:
@@ -39,10 +34,5 @@ L_TooMany:
goto L_Close;
L_Close:
- set @state, 0;
close;
-
-S_Update_Var:
- set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(BYTE_2_MASK) | (@state << BYTE_2_SHIFT));
- return;
}
diff --git a/world/map/npc/002-5/sema.txt b/world/map/npc/002-5/sema.txt
index c80e9660..32da7044 100644
--- a/world/map/npc/002-5/sema.txt
+++ b/world/map/npc/002-5/sema.txt
@@ -1,12 +1,8 @@
-// Variables used: nibble 4 and 5 of QUEST_SouthTulimshar
-
002-5,43,91,6|script|Sema|340
{
- set @state, ((QUEST_SouthTulimshar & BYTE_2_MASK) >> BYTE_2_SHIFT);
-
- if (@state >= 28) goto L_Sema_Done;
- if (@state == 27) goto L_Sema_Happy;
- if (@state == 26) goto L_Sema_GCM;
+ if (QL_MINEALL >= 28) goto L_Sema_Done;
+ if (QL_MINEALL == 27) goto L_Sema_Happy;
+ if (QL_MINEALL == 26) goto L_Sema_GCM;
mes "[Sema the Miner]";
mes "\"Hello adventurer. I do not know exactly where, but somewhere in this cave there is a supply chest. And wouldn't you know it! The archants have eaten all the spare keys for the chest. Go and do what you must do.\"";
@@ -25,8 +21,7 @@ L_Sema_No:
goto L_Close;
L_Sema_Yes:
- set @state, 27;
- callsub S_Update_Var;
+ set QL_MINEALL, 27;
monster "002-5", 70, 90, "", 1059, 1;
mes "[Sema the Miner]";
mes "\"Good luck. To prove you killed it, please bring the Iten it swallowed when it ate the miner. Be careful, there could be more than one.\"";
@@ -40,8 +35,7 @@ L_Sema_Happy:
goto L_Sema_TooMany;
delitem "Iten", 1;
getitem "DesertShirt", 1;
- set @state, 28;
- callsub S_Update_Var;
+ set QL_MINEALL, 28;
set BOSS_POINTS, BOSS_POINTS + 10;
message strcharinfo(0), "You gain 10 Boss Points giving you a total of " + BOSS_POINTS + ".";
mes "[Sema the Miner]";
@@ -54,8 +48,7 @@ L_Sema_TooMany:
goto L_Close;
L_Sema_Not_Happy:
- set @state, 26;
- callsub S_Update_Var;
+ set QL_MINEALL, 26;
heal -Hp, 0;
mes "A stone falls on your head.";
goto L_Close;
@@ -66,10 +59,5 @@ L_Sema_Done:
goto L_Close;
L_Close:
- set @state, 0;
close;
-
-S_Update_Var:
- set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(BYTE_2_MASK) | (@state << BYTE_2_SHIFT));
- return;
}
diff --git a/world/map/npc/006-2/npcs.txt b/world/map/npc/006-2/npcs.txt
index d8ead479..cb44a066 100644
--- a/world/map/npc/006-2/npcs.txt
+++ b/world/map/npc/006-2/npcs.txt
@@ -3,8 +3,7 @@
006-2,49,25,0|script|Falkurn|178
{
set @run, ((QUEST_NorthTulimshar & TWOBIT_8_MASK) >> TWOBIT_8_SHIFT);
- set @state, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT);
- if ((@run == 1) && (@state == 13))
+ if ((@run == 1) && (QL_KYLIAN == 13))
goto L_Deliver;
goto L_Start;
@@ -15,8 +14,7 @@ L_Deliver:
L_Delivery:
mes "[Falkurn]";
mes "\"Good now we can get to work on making some more leather goods.\"";
- set @state, 14;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 14;
goto L_Close;
L_Start:
diff --git a/world/map/npc/008-1/banu.txt b/world/map/npc/008-1/banu.txt
index 4c3a2e7f..37881ca0 100644
--- a/world/map/npc/008-1/banu.txt
+++ b/world/map/npc/008-1/banu.txt
@@ -1,18 +1,12 @@
-// Old woman working on a field, asks the player to get her some water
-// after that she asks for a knife
-// Using bit 10 and 11 of QUEST_NorthTulimshar (second half of nibble 2)
-// author: Jenalya
-
008-1,70,42,0|script|Banu|154
{
- set @state, ((QUEST_NorthTulimshar & TWOBIT_5_MASK) >> TWOBIT_5_SHIFT);
set @EXP, 100;
set @money_water, 250;
set @money_knife, 100;
- if (@state >= 3) goto L_Done;
- if (@state == 2) goto L_Knife;
- if (@state == 1) goto L_Water;
+ if (QL_BANU >= 3) goto L_Done;
+ if (QL_BANU == 2) goto L_Knife;
+ if (QL_BANU == 1) goto L_Water;
mes "[Banu]";
mes "\"Ah, hello. You've come at just the right moment. The field work is hard and the sun is burning.";
@@ -30,8 +24,7 @@ L_Next:
mes "[Banu]";
mes "\"Here is my Empty Bottle. There is a well right over there at Hurnscald.\"";
getitem "EmptyBottle", 1;
- set @state, 1;
- callsub S_Update_Mask;
+ set QL_BANU, 1;
goto L_Close;
L_Water:
@@ -44,8 +37,7 @@ L_Water:
mes "She grabs the Bottle of Water and drinks.";
getexp @EXP, 0;
set Zeny, Zeny + @money_water;
- set @state, 2;
- callsub S_Update_Mask;
+ set QL_BANU, 2;
mes "[Banu]";
mes "\"Ah, that's refreshing. Thank you. You're a good kid. Have this for your expenses.";
mes "Maybe you can do me another favor?\"";
@@ -67,8 +59,7 @@ L_Next1:
delitem "Knife", 1;
getexp @EXP, 0;
set Zeny, Zeny + @money_knife;
- set @state, 3;
- callsub S_Update_Mask;
+ set QL_BANU, 3;
mes "[Banu]";
mes "\"Thank you! You're a darling. Please take this for your effort.\"";
goto L_Close;
@@ -102,11 +93,6 @@ L_FullInv:
L_Close:
set @inventorylist_count, 0;
set @EXP, 0;
- set @state, 0;
set @rand, 0;
close;
-
-S_Update_Mask:
- set QUEST_NorthTulimshar, (QUEST_NorthTulimshar & ~(TWOBIT_5_MASK)) | (@state << TWOBIT_5_SHIFT);
- return;
}
diff --git a/world/map/npc/008-1/mikhail.txt b/world/map/npc/008-1/mikhail.txt
index 98a58d12..aca28beb 100644
--- a/world/map/npc/008-1/mikhail.txt
+++ b/world/map/npc/008-1/mikhail.txt
@@ -1,12 +1,8 @@
-// Variables used: nibble 0 of QUEST_SouthTulimshar
-
008-1,135,25,0|script|Mikhail|120
{
- 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 (QL_SOUP >= 6) goto L_Done;
+ if (QL_SOUP == 5) goto L_Progress;
+ if (QL_SOUP == 4) goto L_Start;
goto L_Con_Mik_First;
L_Con_Mik_First:
@@ -30,8 +26,7 @@ L_Start:
L_accept:
mes "[Mikhail]";
mes "\"Thank you so much! I'll wait for you here.\"";
- set @state, 5;
- callsub S_Update_Var;
+ set QL_SOUP, 5;
close;
L_Progress:
@@ -52,8 +47,7 @@ L_try:
L_get:
delitem "MaggotSlime", 5;
getexp 100, 0;
- set @state, 6;
- callsub S_Update_Var;
+ set QL_SOUP, 6;
mes "[Mikhail]";
mes "\"Ooh! Thank you so much! I can get back to Bernard now!\"";
goto L_Close;
@@ -64,10 +58,5 @@ L_Done:
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;
}
diff --git a/world/map/npc/009-2/bernard.txt b/world/map/npc/009-2/bernard.txt
index 1d6b4229..2a085e61 100644
--- a/world/map/npc/009-2/bernard.txt
+++ b/world/map/npc/009-2/bernard.txt
@@ -1,14 +1,10 @@
-// Variables used: nibble 0 of QUEST_SouthTulimshar
-
009-2,67,79,0|script|Bernard|117
{
- set @state, ((QUEST_SouthTulimshar & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
-
- if (@state >= 6) goto L_Done3;
- if (@state >= 4) goto L_Done2;
- if (@state == 3) goto L_Progress2;
- if (@state == 2) goto L_Done1;
- if (@state == 1) goto L_Progress;
+ if (QL_SOUP >= 6) goto L_Done3;
+ if (QL_SOUP >= 4) goto L_Done2;
+ if (QL_SOUP == 3) goto L_Progress2;
+ if (QL_SOUP == 2) goto L_Done1;
+ if (QL_SOUP == 1) goto L_Progress;
set @TEMP, rand(2);
if(@TEMP == 1) goto L_Opening1;
@@ -51,8 +47,7 @@ L_Req1:
goto L_Set;
L_Set:
- set @state, 1;
- callsub S_Update_Var;
+ set QL_SOUP, 1;
mes "[Bernard]";
mes "\"Please bring it to me!\"";
goto L_Close;
@@ -67,8 +62,7 @@ L_Progress:
delitem "RoastedMaggot", 1;
getexp 100, 0;
getitem "CherryCake", 5;
- set @state, 2;
- callsub S_Update_Var;
+ set QL_SOUP, 2;
next;
mes "\"Now let's see...\"";
goto L_Close;
@@ -83,8 +77,7 @@ L_Progress2:
delitem "MaggotSlime", 3;
getexp 100, 0;
getitem "Beer", 3;
- set @state, 4;
- callsub S_Update_Var;
+ set QL_SOUP, 4;
goto L_Close;
L_NotEnough:
@@ -104,8 +97,7 @@ L_Done1:
next;
mes "\"I need 3 Maggot Slimes for that.\"";
mes "\"Bring them to me, and I'll give you something nice.\"";
- set @state, 3;
- callsub S_Update_Var;
+ set QL_SOUP, 3;
goto L_Close;
L_Done2:
@@ -123,7 +115,6 @@ L_Done3:
L_Close:
set @TEMP, 0;
- set @state, 0;
close;
L_TooMany:
@@ -131,8 +122,4 @@ 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/013-2/wizard.txt b/world/map/npc/013-2/wizard.txt
index 93905600..ced2865b 100644
--- a/world/map/npc/013-2/wizard.txt
+++ b/world/map/npc/013-2/wizard.txt
@@ -4,8 +4,7 @@
set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_KNOWS_OLD_WIZARD;
set @run, ((QUEST_NorthTulimshar & TWOBIT_8_MASK) >> TWOBIT_8_SHIFT);
- set @state, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT);
- if ((@run == 2) && (@state == 13))
+ if ((@run == 2) && (QL_KYLIAN == 13))
goto L_Deliver;
goto L_Start;
@@ -16,8 +15,7 @@ L_Deliver:
L_Delivery:
mes "[Old Wizard]";
mes "\"Good now I can get to work on some stronger brew..\"";
- set @state, 14;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 14;
goto L_Close;
L_Start:
diff --git a/world/map/npc/020-2/baktar.txt b/world/map/npc/020-2/baktar.txt
index 9f0a878c..b769e1e9 100644
--- a/world/map/npc/020-2/baktar.txt
+++ b/world/map/npc/020-2/baktar.txt
@@ -54,8 +54,7 @@
set @XP_BUGLEG, 130;
set @run, ((QUEST_NorthTulimshar & TWOBIT_8_MASK) >> TWOBIT_8_SHIFT);
- set @state, ((QUEST_NorthTulimshar & NIBBLE_5_MASK) >> NIBBLE_5_SHIFT);
- if ((@run == 3) && (@state == 13))
+ if ((@run == 3) && (QL_KYLIAN == 13))
goto L_Deliver;
goto L_Start;
@@ -66,8 +65,7 @@ L_Deliver:
L_Delivery:
mes "[Baktar]";
mes "\"Ahh my delivery from Tulimshar, how nice it is to get some comforts from back home.\"";
- set @state, 14;
- callfunc "SetKylianQuest";
+ set QL_KYLIAN, 14;
goto L_Close;
L_Start:
diff --git a/world/map/npc/029-1/vincent.txt b/world/map/npc/029-1/vincent.txt
index ab157e25..e36b52c2 100644
--- a/world/map/npc/029-1/vincent.txt
+++ b/world/map/npc/029-1/vincent.txt
@@ -1,5 +1,3 @@
-// Variables used: nibble 2 of QUEST_SouthTulimshar
-
029-1,108,108,0|script|Vincent Debug|113
{
mes "[Vincent Debug]";