summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJessica Tölke <jtoelke@mail.upb.de>2013-01-27 19:41:44 +0100
committerJessica Tölke <jtoelke@mail.upb.de>2013-02-12 23:05:14 +0100
commitf86e4abea0d82e1e0ed24110101188ef8fccd541 (patch)
treeea8375cf8defff0438d5e5c4510ae554ede7b11a
parentc733dfe82aca9df0f9d5662db4b596339c9cd7e1 (diff)
downloadserverdata-f86e4abea0d82e1e0ed24110101188ef8fccd541.tar.gz
serverdata-f86e4abea0d82e1e0ed24110101188ef8fccd541.tar.bz2
serverdata-f86e4abea0d82e1e0ed24110101188ef8fccd541.tar.xz
serverdata-f86e4abea0d82e1e0ed24110101188ef8fccd541.zip
Restructuring the quests saved in TMW_Quest: Convert Bandit quest NPCs to new variables.
-rw-r--r--world/map/npc/009-2/lena.txt64
-rw-r--r--world/map/npc/011-4/bl_barrier.txt11
-rw-r--r--world/map/npc/011-6/bryant.txt41
3 files changed, 79 insertions, 37 deletions
diff --git a/world/map/npc/009-2/lena.txt b/world/map/npc/009-2/lena.txt
index e458eb74..c959d86f 100644
--- a/world/map/npc/009-2/lena.txt
+++ b/world/map/npc/009-2/lena.txt
@@ -1,20 +1,26 @@
// Quest for Fairy Hat and Forest Armor
+// Variables used: nibble 0 of QUEST_Hurnscald
009-2.gat,146,43,0|script|Lena|182,{
- if (TMW_Quest >= 46) goto L_Lena_Done;
- if (TMW_Quest == 45) goto L_Lena_Success;
- if (TMW_Quest == 44) goto L_Lena_Bandit_Leader_Fail;
- if (TMW_Quest == 43) goto L_Lena_Bandit_Leader_Fail;
- if (TMW_Quest == 42) goto L_Lena_Bandit_Leader;
- if (TMW_Quest == 41) goto L_Lena_Fairy_Hat;
- if (TMW_Quest == 40) && (BaseLevel >= 30) goto L_Lena_Start;
+ // This NPC previously used the variable TMW_Quest
+ callfunc "ClearVarTMW_Quest";
+
+ set @state, ((QUEST_Hurnscald & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
+
+ if (@state >= 6) goto L_Lena_Done;
+ if (@state == 5) goto L_Lena_Success;
+ if (@state == 4) goto L_Lena_Bandit_Leader_Fail;
+ if (@state == 3) goto L_Lena_Bandit_Leader_Fail;
+ if (@state == 2) goto L_Lena_Bandit_Leader;
+ if (@state == 1) goto L_Lena_Fairy_Hat;
+ if (BaseLevel >= 30) goto L_Lena_Start;
mes "[Lena]";
mes "\"I got ambushed by a group of bandits and one of them stabbed me pretty good. Hopefully I heal up soon so I can fight this menace.\"";
next;
mes "\"Ah, I wish my dear friend Nickos could be here. He's one of the guards in Tulimshar and he'd know how to deal with those outlaws!\"";
- close;
+ goto L_Close;
L_Lena_Start:
mes "[Lena]";
@@ -22,20 +28,20 @@ L_Lena_Start:
menu
"Don't worry, I can take out some of these scumbags.", L_Lena_Approves,
"I think I left my courage in another pair of pants. See you later!", L_Lena_No_Fan;
- close;
L_Lena_Approves:
- set TMW_Quest, 41;
+ set @state, 1;
+ callsub S_Update_Var;
mes "[Lena]";
mes "\"You look like you can handle yourself in a fight. If you can take on this scourge I'll reward you with a hat like mine. In order to prove your mettle, bring me 10 Bandit Hoods so I know they've met their match.\"";
areamonster "008-1.gat",25,60,40,65,"Bandit",1064,3, "::";
areamonster "011-1.gat",35,40,65,60,"Bandit",1064,3, "::";
- close;
+ goto L_Close;
L_Lena_No_Fan:
mes "[Lena]";
mes "\"What will Hurnscald do if these bandits overrun the town? I hope you reconsider.\"";
- close;
+ goto L_Close;
L_Lena_Fairy_Hat:
if (countitem("BanditHood") < 10)
@@ -43,7 +49,8 @@ L_Lena_Fairy_Hat:
getinventorylist;
if (@inventorylist_count - (countitem("BanditHood")== 10) > 99)
goto L_TooMany;
- set TMW_Quest, 42;
+ set @state, 2;
+ callsub S_Update_Var;
delitem "BanditHood", 10;
getitem "FairyHat", 1;
mes "[Lena]";
@@ -53,12 +60,11 @@ L_Lena_Fairy_Hat:
menu
"Consider it done!", L_Lena_Bandit_Leader_Yes,
"Woah there, that sounds a bit harder than what I can succeed at.", L_Lena_NoWay;
- close;
L_Lena_NotEnough:
mes "[Lena]";
mes "\"You don't have enough Bandit Hoods to prove you are taking care of this threat. Please come back with 10 Bandit Hoods to show you are taking care of these bandits.\"";
- close;
+ goto L_Close;
L_Lena_Bandit_Leader:
mes "[Lena]";
@@ -66,44 +72,54 @@ L_Lena_Bandit_Leader:
menu
"Consider it done!", L_Lena_Bandit_Leader_Yes,
"Woah there, that sounds a bit harder than what I can succeed at.", L_Lena_NoWay;
- close;
L_Lena_Bandit_Leader_Yes:
- set TMW_Quest, 43;
+ set @state, 3;
+ callsub S_Update_Var;
areamonster "008-1.gat",25,60,40,65,"Bandit",1064,3, "::";
areamonster "011-1.gat",35,40,65,60,"Bandit",1064,3, "::";
mes "[Lena]";
mes "\"You have a brave heart. Though I know you can succeed on your own, I recommend finding others to help you defeat the bandit leader. I believe he could pose a significant threat to solitary individuals seeking to challenge him. Good luck!\"";
- close;
+ goto L_Close;
L_Lena_NoWay:
mes "[Lena]";
mes "\"That is too bad. Feel free to return at any time. This bandit threat needs to be pushed back.\"";
- close;
+ goto L_Close;
L_Lena_Bandit_Leader_Fail:
- set TMW_Quest, 43;
+ set @state, 3;
+ callsub S_Update_Var;
mes "[Lena]";
mes "\"You haven't killed the bandit leader yet. This is a big problem. Please be careful.\"";
- close;
+ goto L_Close;
L_Lena_Success:
getinventorylist;
if (@inventorylist_count == 100)
goto L_TooMany;
- set TMW_Quest, 46;
+ set @state, 6;
+ callsub S_Update_Var;
getitem "ForestArmor", 1;
mes "[Lena]";
mes "\"Excellent! You killed the bandit leader. Here is the armor as I promised you. Safe journeys!\"";
- close;
+ goto L_Close;
L_Lena_Done:
mes "[Lena]";
mes "\"Thank you for all your help. With your efforts, we can only hope this scourge doesn't see a resurgence.\"";
- close;
+ goto L_Close;
L_TooMany:
mes "[Lena]";
mes "\"You have too many items in your inventory. Please get rid of something so I can reward you.\"";
+ goto L_Close;
+
+L_Close:
+ set @state, 0;
close;
+
+S_Update_Var:
+ set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_0_MASK) | (@state << NIBBLE_0_SHIFT));
+ return;
}
diff --git a/world/map/npc/011-4/bl_barrier.txt b/world/map/npc/011-4/bl_barrier.txt
index e7dfd98c..13524ee8 100644
--- a/world/map/npc/011-4/bl_barrier.txt
+++ b/world/map/npc/011-4/bl_barrier.txt
@@ -1,13 +1,20 @@
//bandit lord barrier
011-4.gat,111,121,0|script|#BL_Barrier|45,0,0,{
- if (TMW_Quest >= 44) goto L_Bandit_Lord_Barrier_Open;
+
+ set @state, ((QUEST_Hurnscald & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
+
+ if (@state >= 4) goto L_Bandit_Lord_Barrier_Open;
message strcharinfo(0), "This entrance appears to be locked.";
- end;
+ goto L_End;
L_Bandit_Lord_Barrier_Open:
message strcharinfo(0), "You insert the silver arrow key and unlock the entrance.";
warp "011-6.gat",251,275;
+ goto L_End;
+
+L_End:
+ set @state, 0;
end;
}
diff --git a/world/map/npc/011-6/bryant.txt b/world/map/npc/011-6/bryant.txt
index 9cd2e20a..6d875686 100644
--- a/world/map/npc/011-6/bryant.txt
+++ b/world/map/npc/011-6/bryant.txt
@@ -1,14 +1,20 @@
//NPC to set the state for killing the bandit lord.
+// Variables used: nibble 0 of QUEST_Hurnscald
011-6.gat,27,200,0|script|Bryant|126,{
- if (TMW_Quest >= 45) goto L_Bryant_Quiet;
- if (TMW_Quest == 44) goto L_Bryant_Waits;
- if (TMW_Quest == 43) goto L_Bryant_Summon;
+ // This NPC previously used the variable TMW_Quest
+ callfunc "ClearVarTMW_Quest";
+
+ set @state, ((QUEST_Hurnscald & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
+
+ if (@state >= 5) goto L_Bryant_Quiet;
+ if (@state == 4) goto L_Bryant_Waits;
+ if (@state == 3) goto L_Bryant_Summon;
mes "[Bryant]";
mes "\"I'm looking everywhere for the bandit leader. I can't seem to find him.\"";
- close;
+ goto L_Close;
L_Bryant_Summon:
mes "[Bryant]";
@@ -17,14 +23,20 @@ L_Bryant_Summon:
mes "Bryant gives you a key, shaped to look like a small silver arrow.";
next;
mes "\"I believe I saw him run into a cave south and east of here. There is a red carpet in front of the cave entrance. Be careful and good luck.\"";
- set TMW_Quest, 44;
+ set @state, 4;
+ callsub S_Update_Var;
monster "011-6.gat",260,250,"BanditLord",1065,1, "Bryant::onBanditLordDead";
- close;
+ goto L_Close;
onBanditLordDead:
- if (TMW_Quest<45)
- set TMW_Quest, 45;
message strcharinfo(0), "You killed the bandit lord.";
+ set @state, ((QUEST_Hurnscald & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
+ if (@state != 4)
+ goto L_End;
+ set @state, 5;
+ callsub S_Update_Var;
+L_End:
+ set @state, 0;
end;
L_Bryant_Waits:
@@ -33,24 +45,31 @@ L_Bryant_Waits:
menu
"No.", L_Bryant_No,
"Yes.", L_Bryant_Yes;
- close;
L_Bryant_No:
mes "[Bryant]";
mes "\"Well, maybe he ran off. I'm pretty sure he should be there now.\"";
killmonster "011-6.gat", "Bryant::onBanditLordDead";
monster "011-6.gat",260,250,"BanditLord",1065,1, "Bryant::onBanditLordDead";
- close;
+ goto L_Close;
L_Bryant_Yes:
mes "[Bryant]";
mes "\"I don't think you killed him. Please try to find and kill him. He should be in the cave south and east of here with the red carpet in front of it.\"";
killmonster "011-6.gat", "Bryant::onBanditLordDead";
monster "011-6.gat",260,250,"BanditLord",1065,1, "Bryant::onBanditLordDead";
- close;
+ goto L_Close;
L_Bryant_Quiet:
mes "[Bryant]";
mes "\"Glad that bandit leader got what was coming to him.\"";
+ goto L_Close;
+
+L_Close:
+ set @state, 0;
close;
+
+S_Update_Var:
+ set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_0_MASK) | (@state << NIBBLE_0_SHIFT));
+ return;
}