summaryrefslogtreecommitdiff
path: root/world/map/npc/002-1
diff options
context:
space:
mode:
Diffstat (limited to 'world/map/npc/002-1')
-rw-r--r--world/map/npc/002-1/lieutenant_dausen.txt95
-rw-r--r--world/map/npc/002-1/nickos.txt83
-rw-r--r--world/map/npc/002-1/sandstorm_mine_barrier.txt14
-rw-r--r--world/map/npc/002-1/stewen.txt25
4 files changed, 143 insertions, 74 deletions
diff --git a/world/map/npc/002-1/lieutenant_dausen.txt b/world/map/npc/002-1/lieutenant_dausen.txt
index 95e2bb02..1126812e 100644
--- a/world/map/npc/002-1/lieutenant_dausen.txt
+++ b/world/map/npc/002-1/lieutenant_dausen.txt
@@ -1,41 +1,52 @@
// Lieutenant in charge of monitoring the monster threat surrounding the city.
+// Variables used: nibble 4 and 5 of QUEST_SouthTulimshar
002-1.gat,54,27,0|script|Lieutenant Dausen|122,{
- if (TMW_Quest == 33) goto L_LD_Key;
- if (TMW_Quest == 19) goto L_LD_Miners;
- if (TMW_Quest == 18) goto L_LD_Orders;
- if (TMW_Quest == 17) goto L_LD_Nickos_Waits;
- if (TMW_Quest == 16) goto L_LD_Nickos;
- if (TMW_Quest == 15) goto L_LD_Waits;
- if (TMW_Quest == 14) goto L_LD_Woe_Is_Me;
- if (TMW_Quest == 13) goto L_LD_Drinks;
- if (TMW_Quest == 12) goto L_LD_Start;
- if (TMW_Quest < 12) goto L_LD_Get_Rep_First;
+ // This NPC previously used the variable TMW_Quest
+ callfunc "ClearVarTMW_Quest";
- mes "[Lieutenant Dausen]";
- mes "\"Hello. I am Lieutenant Dausen. I monitor the monster threat around the city to ensure the safety of its citizens.\"";
- close;
+ 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;
+
+ set @bermik, ((QUEST_SouthTulimshar & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
+ set @sarah, ((QUEST_SouthTulimshar & NIBBLE_1_MASK) >> NIBBLE_1_SHIFT);
+ set @vincent, ((QUEST_SouthTulimshar & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT);
+ set @sandra, ((QUEST_SouthTulimshar & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);
+
+ if ((@bermik >= 6) && (@sarah >= 2) && (@vincent >= 2) && (@sandra >= 2))
+ goto L_LD_Start;
-L_LD_Get_Rep_First:
mes "[Lieutenant Dausen]";
mes "\"Hello. I am Lieutenant Dausen. I monitor the monster threat around the city to ensure the safety of its citizens.\"";
next;
mes "[Lieutenant Dausen]";
mes "\"I may have a job for you, stranger, but first I would like to learn more about you. Go walk among the citizens of Tulimshar, see if any of them could use some help. Once you have established a good reputation, word will get to me.\"";
- close;
+ goto L_Close;
L_LD_Start:
- set TMW_Quest, 13;
+ set @state, 1;
+ callsub S_Update_Var;
mes "[Lieutenant Dausen]";
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.\"";
- close;
+ goto L_Close;
L_LD_Drinks:
- if (countitem ("CactusDrink") < 10) goto L_LD_NotEnough_Drink;
+ if (countitem ("CactusDrink") < 10)
+ goto L_LD_NotEnough_Drink;
getinventorylist;
- if (@inventorylist_count - (countitem("CactusDrink") == 10) > 99) goto L_LD_TooMany;
- set TMW_Quest, 14;
+ if (@inventorylist_count - (countitem("CactusDrink") == 10) > 99)
+ goto L_LD_TooMany;
+ set @state, 2;
+ callsub S_Update_Var;
delitem "CactusDrink", 10;
getitem "Boots", 1;
mes "[Lieutenant Dausen]";
@@ -47,17 +58,16 @@ L_LD_Drinks:
menu
"I can help you out, since you helped me too.", L_LD_Help,
"Thanks for the boots, gotta run now.", L_LD_NoHelp;
- close;
L_LD_NotEnough_Drink:
mes "[Lieutenant Dausen]";
mes "\"Hi again. My men and I sure are thirsty for our favorite drink, the Cactus Drink. If we had about 10, it would help us out a great deal in this sandstorm.\"";
- close;
+ goto L_Close;
L_LD_TooMany:
mes "[Lieutenant Dausen]";
mes "\"Oh, it seems you have too many items for me to give you a reward. Come back after you drop or sell some items.\"";
- close;
+ goto L_Close;
L_LD_Woe_Is_Me:
mes "[Lieutenant Dausen]";
@@ -65,54 +75,69 @@ L_LD_Woe_Is_Me:
menu
"I can help you out, since you helped me out too.", L_LD_Help,
"Bye-bye.", L_LD_NoHelp;
- close;
L_LD_Help:
- set TMW_Quest, 15;
+ set @state, 3;
+ callsub S_Update_Var;
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!\"";
- close;
+ goto L_Close;
L_LD_NoHelp:
mes "[Lieutenant Dausen]";
mes "\"See you later then.\"";
- close;
+ goto L_Close;
L_LD_Waits:
mes "[Lieutenant Dausen]";
mes "\"I do hope Stewen holds his post. If you could tell them to do so, it would help me out a great deal.\"";
- close;
+ goto L_Close;
L_LD_Nickos:
- set TMW_Quest, 17;
+ set @state, 5;
+ callsub S_Update_Var;
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.\"";
- close;
+ goto L_Close;
L_LD_Nickos_Waits:
mes "[Lieutenant Dausen]";
mes "\"Could you let Nickos know to hold his post? It would be very helpful. He is guarding the mine south of here.\"";
- close;
+ goto L_Close;
L_LD_Orders:
- set TMW_Quest, 19;
+ set @state, 7;
+ callsub S_Update_Var;
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.\"";
next;
mes "\"If you think you can handle the monsters lurking out here, I'm sure Nickos and the miners could use some help. Talk to you later.\"";
- close;
+ goto L_Close;
L_LD_Miners:
mes "[Lieutenant Dausen]";
mes "\"I monitor the monster threat around the city to ensure the safety of its citizens.\"";
next;
mes "\"If you think you can handle the monsters lurking out here, I'm sure Nickos and the miners could use some help. Talk to you later.\"";
- close;
+ goto L_Close;
L_LD_Key:
- set TMW_Quest, 34;
+ set @state, 22;
+ callsub S_Update_Var;
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;
+ set @bermik, 0;
+ set @sarah, 0;
+ set @vincent, 0;
+ set @sandra, 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/nickos.txt b/world/map/npc/002-1/nickos.txt
index 011fc5ad..67ac2d63 100644
--- a/world/map/npc/002-1/nickos.txt
+++ b/world/map/npc/002-1/nickos.txt
@@ -1,21 +1,27 @@
// Sandstorm mine guard
+// Variables used: nibble 4 and 5 of QUEST_SouthTulimshar
002-1.gat,28,94,0|script|Nickos|123,{
- if (TMW_Quest == 32) goto L_Nickos_UGQ;
- if (TMW_Quest == 31) goto L_Nickos_AS_Done;
- if (TMW_Quest == 30) goto L_Nickos_AS_Start;
- if (TMW_Quest >= 23) && (TMW_Quest < 30) goto L_Nickos_Guards;
- if (TMW_Quest == 22) goto L_Nickos_Check_Happy;
- if (TMW_Quest > 19) && (TMW_Quest < 22) goto L_Nickos_Waits;
- if (TMW_Quest == 19) goto L_Nickos_Mine;
- if (TMW_Quest == 18) goto L_Nickos_Orders_Received;
- if (TMW_Quest == 17) goto L_Nickos_Orders;
- if (TMW_Quest < 17) goto L_Nickos_See_Dausen_First;
+ // This NPC previously used the variable TMW_Quest
+ callfunc "ClearVarTMW_Quest";
+
+ set @state, ((QUEST_SouthTulimshar & BYTE_2_MASK) >> BYTE_2_SHIFT);
+
+ if (@state == 20) goto L_Nickos_UGQ;
+ if (@state == 19) goto L_Nickos_AS_Done;
+ if (@state == 18) goto L_Nickos_AS_Start;
+ if (@state >= 11) && (@state < 18) goto L_Nickos_Guards;
+ if (@state == 10) goto L_Nickos_Check_Happy;
+ if (@state > 7) && (@state < 10) goto L_Nickos_Waits;
+ if (@state == 7) goto L_Nickos_Mine;
+ if (@state == 6) goto L_Nickos_Orders_Received;
+ if (@state == 5) goto L_Nickos_Orders;
+ if (@state < 5) goto L_Nickos_See_Dausen_First;
mes "[Nickos]";
mes "\"I'm watching this mine to make sure the monsters don't harm the miners.\"";
- close;
+ goto L_Close;
L_Nickos_See_Dausen_First:
mes "[Nickos]";
@@ -23,19 +29,19 @@ L_Nickos_See_Dausen_First:
next;
mes "[Nickos]";
mes "\"The mines are closed from tourists due to the monster threat. If you want to get in you will need to prove yourself first. Talk to Lieutenant Dausen, my superior, if you want to make a formal complaint.\"";
- close;
-
+ goto L_Close;
L_Nickos_Orders:
- set TMW_Quest, 18;
+ set @state, 6;
+ callsub S_Update_Var;
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.\"";
- close;
+ goto L_Close;
L_Nickos_Orders_Received:
mes "[Nickos]";
mes "\"Thanks for letting me know Lieutenant Dausen wants me to stick it out for a while longer. Even though I would've liked my break, I'm sure these miners could use my watchful eye.\"";
- close;
+ goto L_Close;
L_Nickos_Mine:
mes "[Nickos]";
@@ -46,68 +52,81 @@ L_Nickos_Mine:
menu
"Yes.", L_Nickos_Mine_Open,
"No.", L_Nickos_Disappoint;
- close;
L_Nickos_Disappoint:
mes "Nickos looks disappointed.";
- close;
+ goto L_Close;
L_Nickos_Mine_Open:
- set TMW_Quest, 20;
+ set @state, 8;
+ callsub S_Update_Var;
mes "[Nickos]";
mes "\"Excellent! You now have my permission to enter the mine. Your assistance helps ease my worries.\"";
- close;
+ goto L_Close;
L_Nickos_Waits:
mes "[Nickos]";
mes "\"Please be sure to get word from Nathan and Naem to make sure everthing is okay down there. Your assistance helps ease my worries.\"";
- close;
+ goto L_Close;
L_Nickos_Check_Happy:
- set TMW_Quest, 23;
+ set @state, 11;
+ callsub S_Update_Var;
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.\"";
- close;
+ goto L_Close;
L_Nickos_Guards:
mes "[Nickos]";
mes "\"I'm watching this mine to make sure the monsters don't harm the miners.\"";
next;
mes "\"Talk to Nathan the miner, I'm sure the miners could use some help down there.\"";
- close;
+ goto L_Close;
L_Nickos_AS_Start:
- set TMW_Quest, 31;
+ set @state, 19;
+ callsub S_Update_Var;
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.\"";
- close;
+ goto L_Close;
L_Nickos_AS_Done:
- if (countitem ("AngryScorpionStinger") < 10) goto L_Nickos_AS_NotDone;
+ if (countitem ("AngryScorpionStinger") < 10)
+ goto L_Nickos_AS_NotDone;
getinventorylist;
- if (@inventorylist_count - (countitem("AngryScorpionStinger") == 10) > 99) goto L_Nickos_TooMany;
- set TMW_Quest, 32;
+ if (@inventorylist_count - (countitem("AngryScorpionStinger") == 10) > 99)
+ goto L_Nickos_TooMany;
+ set @state, 20;
+ callsub S_Update_Var;
delitem "AngryScorpionStinger", 10;
getitem "LeatherShield", 1;
mes "[Nickos]";
mes "\"Ah, you are a fine combatant! Take this Leather Shield, it might be useful for your future battles.\"";
next;
mes "\"You might be ready to take on the underground palace. If you are interested, go talk to Naem about unlocking the barrier, he's got the key and the code to open it.\"";
- close;
+ goto L_Close;
L_Nickos_AS_NotDone:
mes "[Nickos]";
mes "\"Bring me 10 Angry Scorpion Stingers and I'll know their numbers are down. You will be rewarded for your efforts.\"";
- close;
+ goto L_Close;
L_Nickos_TooMany:
mes "[Nickos]";
mes "\"Oh, it seems you have too many items. Please get rid some some and I'll give you a reward.\"";
- close;
+ goto L_Close;
L_Nickos_UGQ:
mes "[Nickos]";
mes "\"You might be ready to take on the underground palace. If you are interested, talk to the miners about unlocking the barrier, they've got the key to open it.\"";
+ 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/sandstorm_mine_barrier.txt b/world/map/npc/002-1/sandstorm_mine_barrier.txt
index 9814ffb9..49c9b733 100644
--- a/world/map/npc/002-1/sandstorm_mine_barrier.txt
+++ b/world/map/npc/002-1/sandstorm_mine_barrier.txt
@@ -2,11 +2,21 @@
002-1.gat,20,94,0|script|#Sandstorm_Mine_Barrier|45,0,0,{
- if (TMW_Quest >= 20) goto L_Sandstorm_Barrier_Open;
+ // This NPC previously used the variable TMW_Quest
+ callfunc "ClearVarTMW_Quest";
+
+ set @state, ((QUEST_SouthTulimshar & BYTE_2_MASK) >> BYTE_2_SHIFT);
+
+ if (@state >= 8) goto L_Sandstorm_Barrier_Open;
+
message strcharinfo(0), "Some force seems to block your entrance.";
- end;
+ goto L_End;
L_Sandstorm_Barrier_Open:
warp "002-3.gat",37,31;
+ goto L_End;
+
+L_End:
+ set @state, 0;
end;
}
diff --git a/world/map/npc/002-1/stewen.txt b/world/map/npc/002-1/stewen.txt
index b0c98ebe..0aa04b34 100644
--- a/world/map/npc/002-1/stewen.txt
+++ b/world/map/npc/002-1/stewen.txt
@@ -1,22 +1,37 @@
// East sandstorm guard
+// Variables used: nibble 4 and 5 of QUEST_SouthTulimshar
002-1.gat,106,76,0|script|Stewen|123,{
- if (TMW_Quest == 16) goto L_TMW_Quest_Received;
- if (TMW_Quest == 15) goto L_TMW_Quest;
+ // This NPC previously used the variable TMW_Quest
+ callfunc "ClearVarTMW_Quest";
+
+ 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;
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.\"";
- close;
+ goto L_Close;
L_TMW_Quest:
- set TMW_Quest, 16;
+ set @state, 4;
+ callsub S_Update_Var;
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.\"";
- close;
+ goto L_Close;
L_TMW_Quest_Received:
mes "[Stewen]";
mes "\"Thanks again for letting me know Lieutenant Dausen isn't letting me take a break. Once I get out of here, I'll let him know I want a raise!\"";
+ 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;
}