summaryrefslogtreecommitdiff
path: root/world/map/npc/033-1
diff options
context:
space:
mode:
authorJessica Tölke <jtoelke@mail.upb.de>2012-01-17 20:23:02 +0100
committerJessica Tölke <jtoelke@mail.upb.de>2012-01-17 20:25:09 +0100
commitb9c76c51e9ba9c84a0bee23466901c6166569a67 (patch)
tree8c747da1c21467e7aad8d62002287a97da527b15 /world/map/npc/033-1
parentaf937c6f932cdea5b56f0ee7c4976c7706e986a8 (diff)
downloadserverdata-b9c76c51e9ba9c84a0bee23466901c6166569a67.tar.gz
serverdata-b9c76c51e9ba9c84a0bee23466901c6166569a67.tar.bz2
serverdata-b9c76c51e9ba9c84a0bee23466901c6166569a67.tar.xz
serverdata-b9c76c51e9ba9c84a0bee23466901c6166569a67.zip
Barbarian quest: change some variables that are used as constants to global and put them in an init NPC
Diffstat (limited to 'world/map/npc/033-1')
-rw-r--r--world/map/npc/033-1/_import.txt1
-rw-r--r--world/map/npc/033-1/barbarianinit.txt6
-rw-r--r--world/map/npc/033-1/birrod.txt15
-rw-r--r--world/map/npc/033-1/kimarr.txt15
-rw-r--r--world/map/npc/033-1/yerrnk.txt11
5 files changed, 18 insertions, 30 deletions
diff --git a/world/map/npc/033-1/_import.txt b/world/map/npc/033-1/_import.txt
index 39d37f0a..01328819 100644
--- a/world/map/npc/033-1/_import.txt
+++ b/world/map/npc/033-1/_import.txt
@@ -3,6 +3,7 @@
map: 033-1.gat
npc: npc/033-1/_mobs.txt
npc: npc/033-1/_warps.txt
+npc: npc/033-1/barbarianinit.txt
npc: npc/033-1/birrod.txt
npc: npc/033-1/debug.txt
npc: npc/033-1/kimarr.txt
diff --git a/world/map/npc/033-1/barbarianinit.txt b/world/map/npc/033-1/barbarianinit.txt
new file mode 100644
index 00000000..a8543356
--- /dev/null
+++ b/world/map/npc/033-1/barbarianinit.txt
@@ -0,0 +1,6 @@
+-|script|#barbarian033_1init|-1,{
+OnInit:
+ set $@Q_Barbarians_MASK, NIBBLE_0_MASK;
+ set $@Q_Barbarians_SHIFT, NIBBLE_0_SHIFT;
+ set $@Q_Barbarians_wolvern_amount, 10;
+}
diff --git a/world/map/npc/033-1/birrod.txt b/world/map/npc/033-1/birrod.txt
index 5bcd4f96..52c04d8a 100644
--- a/world/map/npc/033-1/birrod.txt
+++ b/world/map/npc/033-1/birrod.txt
@@ -1,12 +1,8 @@
033-1.gat,72,27,0|script|Birrod|217,{
- set @Q_Barbarians_MASK, NIBBLE_0_MASK;
- set @Q_Barbarians_SHIFT, NIBBLE_0_SHIFT;
-
- set @state, ((QUEST_Barbarians & @Q_Barbarians_MASK) >> @Q_Barbarians_SHIFT);
+ set @state, ((QUEST_Barbarians & $@Q_Barbarians_MASK) >> $@Q_Barbarians_SHIFT);
set @wolvern_level, 40; // minimum level to do the wolvern hunting
- set @wolvern_amount, 10; // number of script spawned wolverns to kill
set @wolvern_exp, 5000;
set @minigame_exp, 5000;
@@ -48,7 +44,7 @@ L_Hunting:
mes "\"I noticed some groups of wolverns in the forest west of here which are unusually aggressive.";
mes "This makes it dangerous for all the small people from the town nearby to go there.\"";
next;
- mes "\"To prove your skills, go to the forest and hunt down " + @wolvern_amount + " of the very aggressive wolverns.\"";
+ mes "\"To prove your skills, go to the forest and hunt down " + $@Q_Barbarians_wolvern_amount + " of the very aggressive wolverns.\"";
next;
mes "\"There are also some wolverns that behave normally and attack you only when you come too close to them.";
mes "Those are not the ones I mean, but those that seek the battle themselves.\"";
@@ -57,7 +53,7 @@ L_Hunting:
goto L_Close;
L_Wolverns:
- if (wolvern_count >= @wolvern_amount)
+ if (wolvern_count >= $@Q_Barbarians_wolvern_amount)
goto L_Wolverns_Done;
mes "[Birrod]";
mes "\"Greetings, my friend.";
@@ -235,17 +231,14 @@ L_Weak:
goto L_Close;
L_Close:
- set @Q_Barbarians_MASK, 0;
- set @Q_Barbarians_SHIFT, 0;
set @state, 0;
set @wolvern_level, 0;
- set @wolvern_amount, 0;
set @wolvern_exp, 0;
set @minigame_exp, 0;
close;
S_Update_Mask:
set QUEST_Barbarians,
- (QUEST_Barbarians & ~(@Q_Barbarians_MASK)) | (@state << @Q_Barbarians_SHIFT);
+ (QUEST_Barbarians & ~($@Q_Barbarians_MASK)) | (@state << $@Q_Barbarians_SHIFT);
return;
}
diff --git a/world/map/npc/033-1/kimarr.txt b/world/map/npc/033-1/kimarr.txt
index 0070089c..c8924df8 100644
--- a/world/map/npc/033-1/kimarr.txt
+++ b/world/map/npc/033-1/kimarr.txt
@@ -37,10 +37,7 @@
if ($@Fluffy_FighterID == getcharid(3))
goto L_Attention;
- set @Q_Barbarians_MASK, NIBBLE_0_MASK;
- set @Q_Barbarians_SHIFT, NIBBLE_0_SHIFT;
-
- set @state, ((QUEST_Barbarians & @Q_Barbarians_MASK) >> @Q_Barbarians_SHIFT);
+ set @state, ((QUEST_Barbarians & $@Q_Barbarians_MASK) >> $@Q_Barbarians_SHIFT);
if (@state >= 3) goto L_Again;
if (@state == 2) goto L_Reward;
@@ -103,9 +100,7 @@ L_AlreadyGotReward:
goto L_Close;
L_Reward1:
- set @Q_Barbarians_MASK, NIBBLE_0_MASK;
- set @Q_Barbarians_SHIFT, NIBBLE_0_SHIFT;
- set @state, ((QUEST_Barbarians & @Q_Barbarians_MASK) >> @Q_Barbarians_SHIFT);
+ set @state, ((QUEST_Barbarians & $@Q_Barbarians_MASK) >> $@Q_Barbarians_SHIFT);
if (@state >= 2)
goto L_AlreadyGotReward;
@@ -344,8 +339,6 @@ S_Clean:
killmonster "033-1.gat", "Kimarr::OnWolvernDeath";
killmonster "033-1.gat", "Kimarr::OnYetiDeath";
killmonster "033-1.gat", "Kimarr::OnFluffyDeath";
- set @Q_Barbarians_MASK, 0;
- set @Q_Barbarians_SHIFT, 0;
set @state, 0;
return;
@@ -420,12 +413,12 @@ L_Close:
// still, I think it's a good precent to ALWAYS exit via L_Close
set @loop, 0;
- // if you unset @state, @Q_Barbarians_MASK or @Q_Barbarians_SHIFT, it might break the script
+ // if you unset @state, it might break the script
// If only we had the concept of "local constants" ...
close;
S_Update_Mask:
set QUEST_Barbarians,
- (QUEST_Barbarians & ~(@Q_Barbarians_MASK)) | (@state << @Q_Barbarians_SHIFT);
+ (QUEST_Barbarians & ~($@Q_Barbarians_MASK)) | (@state << $@Q_Barbarians_SHIFT);
return;
}
diff --git a/world/map/npc/033-1/yerrnk.txt b/world/map/npc/033-1/yerrnk.txt
index 749350af..0ea375da 100644
--- a/world/map/npc/033-1/yerrnk.txt
+++ b/world/map/npc/033-1/yerrnk.txt
@@ -1,8 +1,5 @@
033-1.gat,66,28,0|script|Yerrnk|216,{
- set @Q_Barbarians_MASK, NIBBLE_0_MASK;
- set @Q_Barbarians_SHIFT, NIBBLE_0_SHIFT;
-
- set @state, ((QUEST_Barbarians & @Q_Barbarians_MASK) >> @Q_Barbarians_SHIFT);
+ set @state, ((QUEST_Barbarians & $@Q_Barbarians_MASK) >> $@Q_Barbarians_SHIFT);
set @yeti_level, 70;
@@ -168,15 +165,13 @@ L_Done:
goto L_Close;
L_Close:
- set @Q_Barbarians_MASK, 0;
- set @Q_Barbarians_SHIFT, 0;
set @state, 0;
set @yeti_level, 0;
close;
S_Update_Mask:
set QUEST_Barbarians,
- (QUEST_Barbarians & ~(@Q_Barbarians_MASK))
- | (@state << @Q_Barbarians_SHIFT);
+ (QUEST_Barbarians & ~($@Q_Barbarians_MASK))
+ | (@state << $@Q_Barbarians_SHIFT);
return;
}