summaryrefslogtreecommitdiff
path: root/world/map/npc/034-1
diff options
context:
space:
mode:
Diffstat (limited to 'world/map/npc/034-1')
-rw-r--r--world/map/npc/034-1/_import.txt1
-rw-r--r--world/map/npc/034-1/ambushs.txt95
2 files changed, 96 insertions, 0 deletions
diff --git a/world/map/npc/034-1/_import.txt b/world/map/npc/034-1/_import.txt
index e4b39026..e88cbd7a 100644
--- a/world/map/npc/034-1/_import.txt
+++ b/world/map/npc/034-1/_import.txt
@@ -3,3 +3,4 @@
map: 034-1.gat
npc: npc/034-1/_mobs.txt
npc: npc/034-1/_warps.txt
+npc: npc/034-1/ambushs.txt
diff --git a/world/map/npc/034-1/ambushs.txt b/world/map/npc/034-1/ambushs.txt
new file mode 100644
index 00000000..ff01993b
--- /dev/null
+++ b/world/map/npc/034-1/ambushs.txt
@@ -0,0 +1,95 @@
+// This file belongs to the wolvern hunting quest given by 033-1/birrod.txt
+// Author: Jenalya
+// TODO: add more ambushs all over the map
+
+034-1.gat,118,59,0|script|#Ambush0Trigger|45,1,1,{
+ set @Q_Barbarians_MASK, NIBBLE_0_MASK;
+ set @Q_Barbarians_SHIFT, NIBBLE_0_SHIFT;
+ set @state, ((QUEST_Barbarians & @Q_Barbarians_MASK) >> @Q_Barbarians_SHIFT);
+ if (@state != 4)
+ end;
+ if (rand(50) > wolvern_count) // TODO: eventally use different argument for rand
+ end;
+ set $@Ambush0VictimID, getcharid(3);
+ if ($@Ambush0_Active != 0)
+ end;
+ set $@Ambush0_Active, 1;
+ donpcevent "#Ambush0::OnAmbush";
+ end;
+}
+
+034-1.gat,119,60,0|script|#Ambush0|45,{
+end;
+
+OnAmbush:
+ attachrid($@Ambush0VictimID);
+ set @wolvern_amount, 10; // has to be same value as in birrod.txt
+ set $@Ambush0_Spawn, 4 + rand(3);
+ message strcharinfo(0), "An ambush!";
+ areamonster "034-1.gat", 113, 55, 122, 63, "", 1089, $@Ambush0_Spawn, "#Ambush0::OnWolvernDeath";
+ set $@Ambush0VictimID, 0;
+ end;
+
+OnWolvernDeath:
+ set @MobID, 1089; // TODO: adapt
+
+ set @Q_Barbarians_MASK, NIBBLE_0_MASK;
+ set @Q_Barbarians_SHIFT, NIBBLE_0_SHIFT;
+ set @state, ((QUEST_Barbarians & @Q_Barbarians_MASK) >> @Q_Barbarians_SHIFT);
+ if (@state == 4)
+ set wolvern_count, wolvern_count + 1;
+
+ set $@Ambush0_Spawn, $@Ambush0_Spawn - 1;
+ if ($@Ambush0_Spawn == 0)
+ set $@Ambush0_Active, 0;
+
+ if (wolvern_count >= @wolvern_amount)
+ message strcharinfo(0), "You've hunted down a lot of Wolverns. Maybe you should talk to Birrod?";
+ end;
+}
+
+034-1.gat,94,91,0|script|#Ambush1Trigger|45,1,1,{
+ set @Q_Barbarians_MASK, NIBBLE_0_MASK;
+ set @Q_Barbarians_SHIFT, NIBBLE_0_SHIFT;
+ set @state, ((QUEST_Barbarians & @Q_Barbarians_MASK) >> @Q_Barbarians_SHIFT);
+ if (@state != 4)
+ end;
+ if (rand(50) > wolvern_count)
+ end;
+ set $@Ambush1VictimID, getcharid(3);
+ if ($@Ambush1_Active != 0)
+ end;
+ set $@Ambush1_Active, 1;
+ donpcevent "#Ambush1::OnAmbush";
+ end;
+}
+
+034-1.gat,94,92,0|script|#Ambush1|45,{
+end;
+
+OnAmbush:
+ attachrid($@Ambush1VictimID);
+ set @wolvern_amount, 10; // has to be same value as in birrod.txt
+ set $@Ambush1_Spawn, 4 + rand(3);
+ message strcharinfo(0), "An ambush!";
+ areamonster "034-1.gat", 91, 89, 98, 94, "", 1089, $@Ambush1_Spawn, "#Ambush1::OnWolvernDeath";
+ set $@Ambush1VictimID, 0;
+ end;
+
+OnWolvernDeath:
+ set @MobID, 1089; // TODO: adapt
+
+ set @Q_Barbarians_MASK, NIBBLE_0_MASK;
+ set @Q_Barbarians_SHIFT, NIBBLE_0_SHIFT;
+ set @state, ((QUEST_Barbarians & @Q_Barbarians_MASK) >> @Q_Barbarians_SHIFT);
+ if (@state == 4)
+ set wolvern_count, wolvern_count + 1;
+
+ set $@Ambush1_Spawn, $@Ambush1_Spawn - 1;
+ if ($@Ambush1_Spawn == 0)
+ set $@Ambush1_Active, 0;
+
+ if (wolvern_count >= @wolvern_amount)
+ message strcharinfo(0), "You've hunted down a lot of Wolverns. Maybe you should talk to Birrod?";
+ end;
+}