summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-07-03 00:01:42 -0300
committerJesusaves <cpntb1@ymail.com>2018-07-03 00:01:42 -0300
commit1fe25d35152dbe2dcb1f451d9fb48641ef9c9a5e (patch)
tree847d08d9f04e461c3e16bcc5b16abea2bcd22248
parent4cf99dfe633b24b65af22e602ec8c92c35a75611 (diff)
downloadserverdata-1fe25d35152dbe2dcb1f451d9fb48641ef9c9a5e.tar.gz
serverdata-1fe25d35152dbe2dcb1f451d9fb48641ef9c9a5e.tar.bz2
serverdata-1fe25d35152dbe2dcb1f451d9fb48641ef9c9a5e.tar.xz
serverdata-1fe25d35152dbe2dcb1f451d9fb48641ef9c9a5e.zip
Sketch for pipelines - Party Dungeon Master
-rw-r--r--db/constants.conf1
-rw-r--r--npc/008-0/_import.txt1
-rw-r--r--npc/008-0/master.txt83
-rw-r--r--npc/functions/timer.txt11
4 files changed, 96 insertions, 0 deletions
diff --git a/db/constants.conf b/db/constants.conf
index 4d70e8f57..717588a5c 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -3956,6 +3956,7 @@ constants_db: {
// TMW-BR Non Animated NPCs
NPC_SHOPPAKEP: 301
+ NPC_BRGUARD_SWORD: 306
NPC_JOURNALMAN: 309
NPC_FISHERMAN_HALI: 311
NPC_MIRAJ: 323
diff --git a/npc/008-0/_import.txt b/npc/008-0/_import.txt
index abdaecd6e..b4c32c2d9 100644
--- a/npc/008-0/_import.txt
+++ b/npc/008-0/_import.txt
@@ -2,3 +2,4 @@
// This file is generated automatically. All manually added changes will be removed when running the Converter.
"npc/008-0/_mobs.txt",
"npc/008-0/_warps.txt",
+"npc/008-0/master.txt",
diff --git a/npc/008-0/master.txt b/npc/008-0/master.txt
new file mode 100644
index 000000000..875789a27
--- /dev/null
+++ b/npc/008-0/master.txt
@@ -0,0 +1,83 @@
+// TMW-2 Script
+// Author:
+// Jesusalva
+// Description:
+// This NPC serves no purpose currently. She is here to make Tulimshar more crowded.
+
+008-0,47,63,0 script Party Master NPC_BRGUARD_SWORD,{
+ mesn;
+ if (getcharid(1) > 0) {
+ mesq l("You're in the \"@@\" party, very good!", getpartyname(getcharid(1)));
+ next;
+ } else {
+ mesq l("I protect a dungeon for PARTIES. You're not on a party, get moving.");
+ close;
+ }
+
+ mesn;
+ mesq l("I protect a very dangerous dungeon, and it is so dangerous, that only parties can go in.");
+ next;
+ if (strcharinfo(0) != getpartyleader(getcharid(1))) goto L_NotYou;
+ mesn;
+ mesq l("There are five floors, and they're all very dangerous. But there are riches to be found.");
+ next;
+ mesn;
+ mesq l("You also can't stay there forever! You will have 25 minutes to entirely clear it out and defeat the last boss.");
+ next;
+ // Get info about your party, and backup it
+ getpartymember(getcharid(1));
+ .@count = $@partymembercount;
+ copyarray(.@name$[0], $@partymembername$[0], $@partymembercount);
+ copyarray(.@aid[0], $@partymemberaid[0], $@partymembercount);
+ copyarray(.@cid[0], $@partymembercid[0], $@partymembercount);
+ .@count_online=0;
+
+ if (.@count < 3 && !$@GM_OVERRIDE) goto L_TooSmall;
+ mesn;
+ mesc l("Are you and your party ready?", 1);
+ if (askyesno() != ASK_YES)
+ close;
+
+ // Loop though party to see if you can start
+ for (.@i = 0; .@i < .@count; ++.@i) {
+ // Online?
+ if (isloggedin(.@aid[.@i], .@cid[.@i])) {
+ getmapxy(.@m$, .@x, .@y, 0, .@name$[.@i]));
+ // Here?
+ if (.@m$ == .map$)
+ .@count_online++;
+ }
+ }
+
+ // How many are logged in and here?
+ if (.@count_online < 3 && !$@GM_OVERRIDE) goto L_TooSmall;
+
+ // Warp everyone and add timers
+ partytimer("008-0", 1000, "Party Master::OnStart", getcharid(1));
+ warpparty("003-1", 41, 48, getcharid(1), "008-0", true);
+ close;
+
+L_NotYou:
+ mesn;
+ mesq l("If you bring me @@, your party leader, I can let you in.", getpartyleader(getcharid(1)));
+ close;
+
+L_TooSmall:
+ mesn;
+ mesq l("However, I need to see at least three volunteers here, to allow you in.");
+ close;
+
+OnStart:
+ @pmloop=0;
+OnLoop:
+ @pmloop+=1;
+ if (@pmloop < 1500)
+ addtimer(1000, "Party Master::OnLoop");
+ close;
+
+OnInit:
+ .sex = G_MALE;
+ .distance = 5;
+ end;
+}
+
diff --git a/npc/functions/timer.txt b/npc/functions/timer.txt
index e79070f3b..1b5fa8c57 100644
--- a/npc/functions/timer.txt
+++ b/npc/functions/timer.txt
@@ -54,3 +54,14 @@ function script mapdeltimer {
}
return .@i;
}
+
+// partytimer("<map>", <tick>, "<npc>::<event>", partyid)
+function script partytimer {
+ .@c = getunits(BL_PC, .@players, false, getarg(0));
+ for (.@i = 0; .@i < .@c; .@i++) {
+ if (getcharid(2, strcharinfo(0,"",.@players[.@i]) ) == getarg(3))
+ addtimer(getarg(1), getarg(2), .@players[.@i]);
+ }
+ return .@i;
+}
+