summaryrefslogtreecommitdiff
path: root/world/map/npc/013-3
diff options
context:
space:
mode:
authorJessica Tölke <jtoelke@mail.upb.de>2013-02-12 23:06:27 +0100
committerJessica Tölke <jtoelke@mail.upb.de>2013-02-12 23:06:27 +0100
commit627a802f4eeb0872ab84d32ef952ca8884cea795 (patch)
treeb62300599d9f82f986769d0b501d9b18c83123f6 /world/map/npc/013-3
parent776515d46c6ffe47334537c32fc1b55f26fe47e4 (diff)
parente0e679a8a695641d1845c28bebe1c7e83c21a39f (diff)
downloadserverdata-627a802f4eeb0872ab84d32ef952ca8884cea795.tar.gz
serverdata-627a802f4eeb0872ab84d32ef952ca8884cea795.tar.bz2
serverdata-627a802f4eeb0872ab84d32ef952ca8884cea795.tar.xz
serverdata-627a802f4eeb0872ab84d32ef952ca8884cea795.zip
Merge branch 'variables'
Several older scripts were changed to use bitmasking for the player variables. Variables that are or became unused were added to the clear_vars function.
Diffstat (limited to 'world/map/npc/013-3')
-rw-r--r--world/map/npc/013-3/barrier.txt27
-rw-r--r--world/map/npc/013-3/mask_chest.txt63
-rw-r--r--world/map/npc/013-3/sword_chest.txt9
3 files changed, 63 insertions, 36 deletions
diff --git a/world/map/npc/013-3/barrier.txt b/world/map/npc/013-3/barrier.txt
index 6de45440..63c5eae9 100644
--- a/world/map/npc/013-3/barrier.txt
+++ b/world/map/npc/013-3/barrier.txt
@@ -1,17 +1,30 @@
//
013-3.gat,71,21,0|script|#DemonMineBarrier1#_M|45,1,1,{
- if (QUEST_demon_mines >= 2) close;
- if (QUEST_demon_mines == 1 && countitem("JackOSoul") >= 1) goto L_Has_Jack_O_Soul;
+ callfunc "ClearVariables";
- mes "A barrier around the opening pushes you back as you approach.";
+ set @state, ((QUEST_Hurnscald & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT);
+
+ if (@state >= 2) goto L_Close;
+ if (@state == 1 && countitem("JackOSoul") >= 1) goto L_Has_Jack_O_Soul;
+
+ message strcharinfo(0), "A barrier around the opening pushes you back as you approach.";
warp "013-3.gat", 71, 25;
- close;
+ goto L_End;
L_Has_Jack_O_Soul:
- mes "The barrier around the opening allows you passage.";
- set QUEST_demon_mines, 2;
+ message strcharinfo(0), "The barrier around the opening allows you passage.";
+ set @state, 2;
+ callsub S_Update_Mask;
delitem "JackOSoul", 1;
- close;
+ goto L_End;
+
+L_End:
+ set @state, 0;
+ end;
+
+S_Update_Mask:
+ set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_2_MASK)) | (@state << NIBBLE_2_SHIFT);
+ return;
}
diff --git a/world/map/npc/013-3/mask_chest.txt b/world/map/npc/013-3/mask_chest.txt
index 59aa0819..4a15bc0b 100644
--- a/world/map/npc/013-3/mask_chest.txt
+++ b/world/map/npc/013-3/mask_chest.txt
@@ -1,8 +1,12 @@
//
013-3.gat,28,27,0|script|Chest#DemonMask|111,{
- if (QUEST_demon_mines < 2) goto L_This_shouldn_t_happen;
- if (QUEST_demon_mines == 3) goto L_Finished;
+ callfunc "ClearVariables";
+
+ set @state, ((QUEST_Hurnscald & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT);
+
+ if (@state < 2) goto L_This_shouldn_t_happen;
+ if (@state == 3) goto L_Finished;
if (countitem("MaggotSlime") == 0)
goto L_No_maggot_slime;
@@ -112,97 +116,106 @@
mes "You managed to perform the ritual and open the chest.";
getitem "DemonMask", 1;
mes "You found a demon mask inside.";
- set QUEST_demon_mines, 3;
- close;
+ set @state, 3;
+ callsub S_Update_Mask;
+ goto L_Close;
L_No_maggot_slime:
mes "You do not have any maggot slime.";
- close;
+ goto L_Close;
L_No_mushroom:
mes "You do not have a mushroom, neither big, nor small.";
- close;
+ goto L_Close;
L_No_pink_petal:
mes "You can't seem to find that pink petal you had.";
- close;
+ goto L_Close;
L_No_pearl:
mes "You do not have a pearl, let alone one from the sea.";
- close;
+ goto L_Close;
L_No_hard_spike:
mes "You weren't able to find a hard spike in the stuff you brought.";
- close;
+ goto L_Close;
L_No_raw_log:
mes "You don't have any wood.";
- close;
+ goto L_Close;
L_No_pink_antenna:
mes "You aren't carrying any antenna.";
- close;
+ goto L_Close;
L_No_tongues:
mes "You don't have four different snake tongues.";
- close;
+ goto L_Close;
L_No_treasure_key:
mes "No treasure chest key, no opening ritual.";
- close;
+ goto L_Close;
L_No_ash:
mes "You still need a pile of ash.";
- close;
+ goto L_Close;
L_No_herbs:
mes "Four different herbs are needed to get this thing open.";
- close;
+ goto L_Close;
L_No_bug_leg:
mes "You do not have part of a bug on you. That is rather odd considering what you went through to get here.";
- close;
+ goto L_Close;
L_No_lamp:
mes "You do not have a lamp. Yet, somehow, you were able to get this far into this dark cave.";
- close;
+ goto L_Close;
L_No_iron_ore:
mes "\"Rock and metal, as one.\" You don't seem to have anything that fits the bill.";
- close;
+ goto L_Close;
L_No_stingers:
mes "Three scorpion deaths are still missing.";
- close;
+ goto L_Close;
L_No_silk:
mes "You could not find the womb for a butterfly among your stuff.";
- close;
+ goto L_Close;
L_No_fur:
mes "You wonder how you can carry the \"gentle caress of a creature without blemish.\" But you need it to get this thing open.";
- close;
+ goto L_Close;
L_No_dark_crystal:
mes "A piece of darkness is missing.";
- close;
+ goto L_Close;
L_No_water:
mes "Just one bottle of water and you can start the ritual.";
- close;
+ goto L_Close;
L_This_shouldn_t_happen:
warp "013-3.gat", 71, 25;
// You need to go through the barrier to get to the chest, so this shouldn't happen. So just warp them like the barrier does.
- close;
+ goto L_Close;
L_Finished:
mes "[Chest]";
mes "You already opened this chest.";
- close;
+ goto L_Close;
L_TooMany:
mes "[Chest]";
mes "You don't have room for what ever is inside. Maybe you should try again later.";
+ goto L_Close;
+
+L_Close:
+ set @state, 0;
close;
+
+S_Update_Mask:
+ set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_2_MASK)) | (@state << NIBBLE_2_SHIFT);
+ return;
}
diff --git a/world/map/npc/013-3/sword_chest.txt b/world/map/npc/013-3/sword_chest.txt
index bb89e3f3..8c89b52d 100644
--- a/world/map/npc/013-3/sword_chest.txt
+++ b/world/map/npc/013-3/sword_chest.txt
@@ -1,14 +1,15 @@
//
013-3.gat,177,22,0|script|Chest|111,{
- if( ChestQuest & 2) goto L_Finished;
+ callfunc "ClearVariables";
+ if (FLAGS & FLAG_HURNSMINE_CHEST) goto L_Finished;
mes "[Chest]";
mes "Would you try to open it?";
next;
menu
- "Yes", L_Yes,
- "No", -;
+ "Yes.", L_Yes,
+ "No.", -;
close;
L_Yes:
@@ -22,7 +23,7 @@ L_Yes:
getitem "ShortSword", 1;
mes "[Chest]";
mes "You opened it and found a short sword!";
- set ChestQuest, ChestQuest | 2;
+ set FLAGS, FLAGS | FLAG_HURNSMINE_CHEST;
close;
L_Not_Enough: