summaryrefslogtreecommitdiff
path: root/world/map/npc/042-2/barrels_config.txt
diff options
context:
space:
mode:
Diffstat (limited to 'world/map/npc/042-2/barrels_config.txt')
-rw-r--r--world/map/npc/042-2/barrels_config.txt39
1 files changed, 17 insertions, 22 deletions
diff --git a/world/map/npc/042-2/barrels_config.txt b/world/map/npc/042-2/barrels_config.txt
index 85c78e41..0b45af21 100644
--- a/world/map/npc/042-2/barrels_config.txt
+++ b/world/map/npc/042-2/barrels_config.txt
@@ -6,40 +6,34 @@
end;
OnInit:
- set $@BarrelStartBit, (1 << 16);
- set $@BarrelEndBit, (1 << 23);
- set $@ZegasMetBit, (1 << 30);
- setarray $@BarrelBits, (1 << 17), (1 << 18), (1 << 19), (1 << 20), (1 << 21), (1 << 22);
+ setarray $@BarrelBits, (1 << 20), (1 << 21), (1 << 22), (1 << 23), (1 << 24), (1 << 25), (1 << 26), (1 << 27);
setarray $@BarrelRewards, 533, 507, 505, 518, 537, 526;
set $@BarrelSpawnCnt, 1;
set $@BarrelSpawnId, 1050;
set $@BarrelSpawnName$, "House Maggot";
set $@BarrelMax, getarraysize($@BarrelBits);
end;
-
+}
+function|script|SetBarrelMask|,
+{
+ set STARTAREA, (STARTAREA & ~(NIBBLE_4_MASK) | (@barrel_tmp << NIBBLE_4_SHIFT));
+ set @barrel_tmp, 0;
+ return;
}
function|script|CheckBarrelQuest|,
{
callfunc "CountBarrels";
- set @barrel_quest, 0;
- if (TUTORIAL & $@ZegasMetBit)
- set @barrel_quest, 1;
- if (TUTORIAL & $@BarrelStartBit)
- set @barrel_quest, 2;
- if (!(TUTORIAL & $@BarrelStartBit) && (@barrel_count))
- set @barrel_quest, 3;
- if (TUTORIAL & $@BarrelEndBit)
- set @barrel_quest, 4;
+ set @barrel_quest, ((STARTAREA & NIBBLE_4_MASK) >> NIBBLE_4_SHIFT);
return;
}
function|script|CountBarrels|,
{
set @barrel_count, 0;
- set @barrel_tmp, 0;
+ set @count_tmp, 0;
goto L_Loop;
L_Loop:
- if (TUTORIAL & $@BarrelBits[@barrel_tmp])
+ if (STARTAREA & $@BarrelBits[@barrel_tmp])
goto L_AddOne;
goto L_LoopAgain;
@@ -48,8 +42,8 @@ L_AddOne:
goto L_LoopAgain;
L_LoopAgain:
- set @barrel_tmp, (@barrel_tmp + 1);
- if (@barrel_tmp == getarraysize($@BarrelBits))
+ set @count_tmp, (@count_tmp + 1);
+ if (@count_tmp == getarraysize($@BarrelBits))
goto L_BarrelTally;
goto L_Loop;
@@ -62,11 +56,11 @@ function|script|CheckBarrel|,
if (@npc_check)
goto L_Range;
callfunc "CheckBarrelQuest";
- if (!(@barrel_quest))
+ if (!(@barrel_quest == 2))
goto L_NoI;
- if (TUTORIAL & $@BarrelBits[@barrel])
+ if (STARTAREA & $@BarrelBits[@barrel])
goto L_Empty;
- set TUTORIAL, TUTORIAL | $@BarrelBits[@barrel];
+ set STARTAREA, STARTAREA | $@BarrelBits[@barrel];
callfunc "CountBarrels";
if (@barrel_count == $@BarrelMax)
@@ -92,7 +86,8 @@ L_Empty:
L_QuestReward:
message strcharinfo(0), "You found the bug bomb.";
misceffect 33;
- set TUTORIAL, TUTORIAL &~ $@BarrelStartBit;
+ set @barrel_tmp, 3;
+ callfunc "SetBarrelMask";
killmonster getmap() + ".gat", "Barrel#0::OnMaggotDeath";
goto L_Return;