summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-01-08 21:59:56 -0200
committerJesusaves <cpntb1@ymail.com>2019-01-08 21:59:56 -0200
commit47f6fad94cdb287805992192ed3553751a3307d6 (patch)
tree1b8ac3be5258b82268a6f220c3cd9915caf4af00 /npc
parent9777343e4371e660d79f24e023130d1bb4e2cda8 (diff)
downloadserverdata-47f6fad94cdb287805992192ed3553751a3307d6.tar.gz
serverdata-47f6fad94cdb287805992192ed3553751a3307d6.tar.bz2
serverdata-47f6fad94cdb287805992192ed3553751a3307d6.tar.xz
serverdata-47f6fad94cdb287805992192ed3553751a3307d6.zip
CoD
Diffstat (limited to 'npc')
-rw-r--r--npc/001-10-1/_import.txt2
-rw-r--r--npc/001-10-1/mapflags.txt2
-rw-r--r--npc/001-10-1/scripts.txt77
-rw-r--r--npc/001-10/mapflags.txt1
-rw-r--r--npc/001-10/scripts.txt18
-rw-r--r--npc/018-2-1/dustman.txt98
6 files changed, 158 insertions, 40 deletions
diff --git a/npc/001-10-1/_import.txt b/npc/001-10-1/_import.txt
index f1ee86539..6f5c2b5df 100644
--- a/npc/001-10-1/_import.txt
+++ b/npc/001-10-1/_import.txt
@@ -1,2 +1,4 @@
// Map 001-10-1: Dust Boss Cave
// This file is generated automatically. All manually added changes will be removed when running the Converter.
+"npc/001-10-1/mapflags.txt",
+"npc/001-10-1/scripts.txt",
diff --git a/npc/001-10-1/mapflags.txt b/npc/001-10-1/mapflags.txt
new file mode 100644
index 000000000..48d99d981
--- /dev/null
+++ b/npc/001-10-1/mapflags.txt
@@ -0,0 +1,2 @@
+001-10-1 mapflag zone MMO
+001-10-1 mapflag pvp
diff --git a/npc/001-10-1/scripts.txt b/npc/001-10-1/scripts.txt
new file mode 100644
index 000000000..0038e9281
--- /dev/null
+++ b/npc/001-10-1/scripts.txt
@@ -0,0 +1,77 @@
+// TMW2 scripts.
+// Authors:
+// Jesusalva
+// Dusty in a Bottle (aka. Dustynator, Dustman, mr. willbelz)
+// Description:
+// Scripts for 001-10-1: Boss Fight!
+
+001-10-1,0,0,0 script #COD_BossManager NPC_HIDDEN,{
+ end;
+
+// Spawn the Dust Boss
+OnEventStart:
+ areamonster("001-10-1", 34, 29, 59, 52, strmobinfo(1, DustBoss), DustBoss, 1, "#COD_BossManager::OnVictory");
+ initnpctimer;
+ end;
+
+// Dust boss was killed, add timers
+OnVictory:
+ if (getcharid(1) > 0)
+ .pwin=getcharid(1);
+ else
+ .win$=strcharinfo(0);
+
+ maptimer("001-10-1", 100, "#COD_BossManager::OnReward1");
+ maptimer("001-10-1", 100, "#COD_BossManager::OnReward2");
+ donpcevent("Colonel DUSTMAN::OnCoDEnd");
+ end;
+
+// Handle rewards: 10 dust for winner party on boss room, 1 dust for everyone else
+// on boss room, 1 dust for winner party outside boss room
+OnReward1:
+ if ((.pwin > 0 && getcharid(1) == .pwin) || strcharinfo(0) == .awin$)
+ getitem BottledDust, 10;
+ else
+ getitem BottledDust, 1;
+OnReward2:
+ if (.pwin && getcharid(1) == .pwin)
+ getitem BottledDust, 1;
+ warp "018-2-1", 24, 29;
+ end;
+
+// You ran out of time
+OnTimeDefeat:
+ @COD_CHECKPOINT=0;
+ if (getmap() ~= "001-10") {
+ warp "018-2-1", 24, 29;
+ dispbottom l("COD: Ran out of time!");
+ }
+ end;
+
+// Must reset for next challenge
+OnCleanUp:
+ .pwin=0; // party winner
+ .win$=""; // fallback, if char not in party
+ killmonsterall("001-10-1");
+ initnpctimer;
+ stopnpctimer;
+ end;
+
+// Every 20 seconds mobs are created if needed
+OnTimer20000:
+ .@mi=mobcount("001-10-1", "all");
+ .@pl=getmapusers("001-10-1");
+ .@monsterId=any(DustRifle, DustGatling, DustRevolver);
+ if (.@pl > (.@mi-2))
+ areamonster("001-10-1", 34, 29, 59, 52, strmobinfo(1, .@monsterId), .@monsterId, (.@pl-.@mi+2));
+ initnpctimer;
+ end;
+
+// Setup
+OnInit:
+ .pwin=0; // party winner
+ .win$=""; // fallback, if char not in party
+ end;
+}
+
+
diff --git a/npc/001-10/mapflags.txt b/npc/001-10/mapflags.txt
index ac4e7b798..b67365957 100644
--- a/npc/001-10/mapflags.txt
+++ b/npc/001-10/mapflags.txt
@@ -1 +1,2 @@
001-10 mapflag zone MMO
+001-10 mapflag pvp
diff --git a/npc/001-10/scripts.txt b/npc/001-10/scripts.txt
index b144fe178..09bb4f0c9 100644
--- a/npc/001-10/scripts.txt
+++ b/npc/001-10/scripts.txt
@@ -5,19 +5,33 @@
// Description:
// Scripts for 001-10: Snipers, Bottles and Warps
+// Boss room
001-10,89,43,0 script #COD_BossRoomCheck NPC_NO_SPRITE,0,0,{
end;
OnTouch:
if (!@COD_CHECKPOINT) {
dispbottom l("Magic Barrier is active. You must give a whole circle on the desert to break it.");
} else {
- // warp
+ deltimer("#COD_BossRoomCheck::OnTimeDefeat");
+ addtimer(300000,"#COD_BossManager::OnTimeDefeat");
+ // You can't return now!
+ warp "001-10-1", any(57, 58, 59), any(74, 75);
dispbottom l("A dangerous boss room, keep your guard up!");
}
end;
+
+OnTimeDefeat:
+ @COD_CHECKPOINT=0;
+ if (getmap() ~= "001-10") {
+ warp "018-2-1", 24, 29;
+ dispbottom l("COD: Ran out of time!");
+ }
+ end;
+
}
-001-10,132,106,0 script #COD_Checkpoint106 NPC_NO_SPRITE,0,0,{
+// Magic Barrier
+001-10,132,106,0 script #COD_Checkpoint106 NPC_NO_SPRITE,0,7,{
end;
OnTouch:
@COD_CHECKPOINT=1;
diff --git a/npc/018-2-1/dustman.txt b/npc/018-2-1/dustman.txt
index c6b24dcf7..455aedd9c 100644
--- a/npc/018-2-1/dustman.txt
+++ b/npc/018-2-1/dustman.txt
@@ -93,6 +93,7 @@
L_COD:
mes "";
+ // First time you're hearing about?
if (BaseLevel >= 50 && .@cod < 1) {
mesn;
mesq l("Hey, do you know the ##BCall Of Dusty##b event?");
@@ -104,11 +105,16 @@ L_COD:
getitem BottledDust, 1;
}
setq LoFQuest_COD, 1;
+ goto L_InformationCOD;
}
+
+ // Begin here
mesn;
mesq l("Just @@ ago, thieves stole Pihro & Pyndragon weapons.", FuzzyTime(1542570030));
next;
- if (BaseLevel >= 50 && .@cod < 2) {
+
+ // Handle initial message
+ if (BaseLevel >= 50) {
mesn;
mesq l("Pyndragon said he'll craft a @@ to whoever reduces them to dust. Interested?", getitemlink(Dustynator)); // BottledDust, Dustynator
mesc l("Note: Dustynator is a high level weapon. You might not have enough level to use it yet.");
@@ -118,53 +124,65 @@ L_COD:
mesq l("It was a real problem, threatening them to go out of business. I think they are trying to recover the lost weapons.");
mesc l("Attain level 50 to try this quest.");
close;
- } else {
- mesn;
- mesq l("You should kill them and collect @@ to obtain the @@.", getitemlink(BottledDust), getitemlink(Dustynator));
- mesc l("Note: Killing enemies there with the Dustynator grants more dusty in a bottle.");
- next;
}
+L_SkipIntro:
mes "";
- // TODO check if active
+ // Is the event currently active? Or is it exchange time?
+ if (.state == 0) {
+ mesn;
+ mesq l("The event starts hourly, when the minute clock hits zero. I'll tell everyone on this room when it starts and ends.");
+ close;
+ }
+
+ // Do you want to participate?
if (askyesno() == ASK_YES) {
mes "";
mesn;
mesq l("Do you need a refresher of the rules?");
if (askyesno() == ASK_YES) {
- mes "";
- mesn;
- mesc l("Call Of Dusty is a timed event quest. It begins hourly, when the minute clock marks zero.");
- mesc l("When the boss is defeated, or the minute clock marks fifteen, event ends.");
- next;
- mesn;
- mesc l("This is a @@, meaning only the victor party will receive the great prize.", b(l("Party Quest")));
- mesc l("You will get @@ which can then be exchanged for items once CoD event quest ends.");
- next;
- mesn;
- mesc l("You need be at minimum level 50 to participate. It is PVP, so watch out!");
- mesc l("The first stage is on the desert canyons. You must give a full circle on the canyon in 90 seconds.");
- mesc l("The second stage is in the first cave to northwest you can find.");
- // The full circle have about 268 tiles in distance. You have the needed time to do 2.2 circles in the most efficient fashion.
- // This means you have a time worth of 590 tiles, at 150ms, granting you 90 seconds to do this quest. (everything rounded up)
- next;
- mesn;
- mesc l("Once inside the BOSS Cave, you get a five minutes time limit to slay the boss with your party.");
- mesc l("@@. PK, however, is allowed!", b(l("Only the party from the MVP will get the reward.")));
- next;
- mesc l("The MVP is the player who did more damage to the boss.");
- mesc l("The title is transferred when the MVP is killed (either in PVP or by the boss), or when time runs out.");
- next;
- mesn;
- mesc l("The boss can blind players. Blind will reduce hit rate and evasion in 25%.");
- mesc l("Form the strongest party and win! Remember that if you don't kill the boss, you'll never win!");
- next;
+ goto L_InformationCOD;
}
- mes "";
- mesc l("ERROR: NYI: Not Yet Implemented"), 1;
+ closeclientdialog;
+ @COD_CHECKPOINT=0;
+ warp "001-10", rand(163,171), rand(119,124);
+ addtimer(90000,"#COD_BossRoomCheck::OnTimeDefeat");
+ dispbottom l("Good luck!");
+ close;
}
close;
+// Information about COD
+L_InformationCOD:
+ mes "";
+ mesn;
+ mesc l("Call Of Dusty is a timed event quest. It begins hourly, when the minute clock marks zero.");
+ mesc l("When the boss is defeated, or the minute clock marks fifteen, event ends.");
+ next;
+ mesn;
+ mesc l("This is a @@, meaning only the victor party will receive the great prize.", b(l("Party Quest")));
+ mesc l("You will get @@ which can then be exchanged for items once CoD event quest ends.");
+ next;
+ mesn;
+ mesc l("You need be at minimum level 50 to participate. It is PVP, so watch out!");
+ mesc l("The first stage is on the desert canyons. You must give a full circle on the canyon in 90 seconds.");
+ mesc l("The second stage is in the first cave to northwest you can find.");
+ // The full circle have about 268 tiles in distance. You have the needed time to do 2.2 circles in the most efficient fashion.
+ // This means you have a time worth of 590 tiles, at 150ms, granting you 90 seconds to do this quest. (everything rounded up)
+ next;
+ mesn;
+ mesc l("Once inside the BOSS Cave, you get a five minutes time limit to slay the boss with your party.");
+ mesc l("@@. PK, however, is allowed!", b(l("Only the party from the MVP will get the reward.")));
+ next;
+ mesc l("The MVP is the player who did more damage to the boss.");
+ mesc l("The title is transferred when the MVP is killed (either in PVP or by the boss), or when time runs out.");
+ next;
+ mesn;
+ mesc l("The boss can blind players. Blind will reduce hit rate and evasion in 25%.");
+ mesc l("Form the strongest party and win! Remember that if you don't kill the boss, you'll never win!");
+ next;
+ goto L_SkipIntro;
+
OnInit:
.sex=G_MALE;
.distance=5;
@@ -173,15 +191,19 @@ OnInit:
OnMinute00:
.state=1;
- // TODO: spawn
+ donpcevent("#COD_BossManager::OnEventStart");
+ npctalk l("Call Of Dusty: Event Start!");
end;
+OnCoDEnd:
OnMinute15:
.state=0;
+ npctalk l("Call Of Dusty: Event End!");
end;
OnMinute30:
- debugmes "CoD Cleanup";
+ .state=0; // fail-safe
+ donpcevent("#COD_BossManager::OnCleanUp");
end;
}