summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-01-07 01:31:46 -0200
committerJesusaves <cpntb1@ymail.com>2019-01-07 01:31:46 -0200
commit59ae0abf13954721d1f9bfa4309f158ba513b2de (patch)
treeba649aac5bb98868a183a915794f8cda510ce34f
parent9d5db4c9b4bbb05153b29ee7340acbd35ed226bf (diff)
downloadserverdata-59ae0abf13954721d1f9bfa4309f158ba513b2de.tar.gz
serverdata-59ae0abf13954721d1f9bfa4309f158ba513b2de.tar.bz2
serverdata-59ae0abf13954721d1f9bfa4309f158ba513b2de.tar.xz
serverdata-59ae0abf13954721d1f9bfa4309f158ba513b2de.zip
Now, everyone can start Hungry Quirin Arena PVP Event.
But it can only be done hourly.
-rw-r--r--npc/001-8/hub.txt4
-rw-r--r--npc/003-1/quirino.txt93
2 files changed, 82 insertions, 15 deletions
diff --git a/npc/001-8/hub.txt b/npc/001-8/hub.txt
index 0fb6795f0..454ead469 100644
--- a/npc/001-8/hub.txt
+++ b/npc/001-8/hub.txt
@@ -421,5 +421,9 @@ OnPCLogoutEvent:
@qhub_died=0;
end;
+OnCancel:
+ setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_ITEM|PCBLOCK_MOVE|PCBLOCK_COMMANDS, false);
+ warp "Save", 0, 0;
+ end;
}
diff --git a/npc/003-1/quirino.txt b/npc/003-1/quirino.txt
index d2e5019ec..c47046bff 100644
--- a/npc/003-1/quirino.txt
+++ b/npc/003-1/quirino.txt
@@ -6,27 +6,51 @@
// Hunger Games™ version for The Mana World Brazil v2, created by Ernando Quirino.
// Entrance to Hungry Quirin Arena
// Variables:
+// EQ - Ernando Quirino
+// $@EQ_TIMER
+// < gettimetick(2): Can be open!
+// > gettimetick(2): Registration open!
+// = gettimetick(2): Event start!
// $@EQ_STATUS
// 0: Register open
// 1: Fight happening
// 2: Event finished
003-1,48,73,0 script Quirin NPC_ERNANDO,{
- if (is_gm()) goto L_Hub;
- if ($EVENT$ != "Hunger") goto L_NoSeason;
- if ($@EQ_STATUS == 0)
- goto L_Register;
+ if (is_admin())
+ goto L_Hub;
+
+ if ($@EQ_STATUS) goto L_NoSeason;
+ if ($@EQ_STATUS == 0) {
+ if ($@EQ_TIMER < gettimetick(2))
+ goto L_Hub;
+ else
+ goto L_Register;
+ }
- hello;
+ npctalk3 l("Bug, report me!");
end;
L_NoSeason:
- npctalkonce l("Heya!");
+ // If it finished, it can be done again in one hour
+ if ($@EQ_STATUS == 2) {
+ if ($@EQ_TIMER+3600 < gettimetick(2)) {
+ $@EQ_STATUS=0;
+ npctalkonce l("A sec... And... Done! I just finished cleaning it up!");
+ } else {
+ npctalkonce l("I'm currently cleaning the arena, wait just @@ more.", FuzzyTime($@EQ_TIMER+3600));
+ } else {
+ npctalkonce l("I'm currently hosting a fight.");
+ }
end;
L_Register:
mesn;
mesq l("Hello player, do you want to participate on HUNGRY QUIRIN event?!");
+ if ($@EQ_TIMER+180 < gettimetick(2))
+ mesc l("Event will start in @@", FuzzyTime($@EQ_TIMER));
+ else
+ mesc l("Event will start in @@", FuzzyTime($@EQ_TIMER)), 1;
next;
select
l("Yeah, sign me up!"),
@@ -85,20 +109,39 @@ L_Full:
L_Hub:
mesn;
mesc l("Welcome to HUNGRY QUIRIN ARENA mangment panel.");
- mesc l("Current Event: "+$EVENT$);
- mesc l("Event stage: "+$@EQ_STATUS);
+ next;
+ mesn;
+ mesq l("I am Quirino Voraz, and my arena is the coolest PVP Arena on all Mana Worlds.");
+ mesq l("However, I need a tax to start, and you need to arrange players. There are no refunds.");
+ next;
mes l("Current player count: @@/5 must be online.", getusers(1));
mes l("Current arena player count: @@ on map. (Min. 3 to begin event)", getmapusers("001-8"));
// Open event? Minimum 5 connections or GM_OVERRIDE flag.
- if ($EVENT$ == "" && (getusers(1) >= 5 || $@GM_OVERRIDE)) {
+ if ($@EQ_TIMER < gettimetick(2) && !$@EQ_STATUS && (getusers(1) >= 5 || $@GM_OVERRIDE)) {
next;
mesc l("Activate event?"), 1;
- if (askyesno() == ASK_YES) {
- $EVENT$="Hunger";
+ mesc l("It'll cost @@ GP", .price);
+ if (Zeny < .price)
+ close;
+ menuint
+ l("NO"), -1,
+ l("Give players 5 minutes"), 300,
+ l("Give players 10 minutes"), 600,
+ l("Give players 15 minutes"), 900,
+ l("Give players 20 minutes"), 1200,
+ l("Give players 25 minutes"), 1500,
+ l("Give players 30 minutes"), 1800,
+ l("NO"), -1;
+ mes "";
+ if (@menuret > 0)
+ Zeny=Zeny-.price;
+ $@EQ_TIMER=gettimetick(2)+@menuret;
+ initnpctimer;
setcells "001-8", 41, 58, 41, 43, 6, "qhubN";
setcells "001-8", 41, 58, 56, 58, 6, "qhubS";
- announce("##1HUNGRY QUIRIN EVENT: ##3##BRegister is now open! Talk to Quirin, on Tulimshar Guardhouse!", bc_all|bc_npc);
+ announce("##1HUNGRY QUIRIN EVENT: ##3##BRegister is now open! Talk to Quirin, on Tulimshar Councilroom!", bc_all|bc_npc);
+ channelmes("#world", strcharinfo(0)+" invites everyone to HUNGER QUIRIN PVP ARENA in Tulimshar. It'll start in "+FuzzyTime($@EQ_TIMER));
}
close;
}
@@ -106,10 +149,10 @@ L_Hub:
// Main Control menu. Not using l() on purpose.
select
- rif($@EQ_STATUS == 0 && (getmapusers("001-8") >= 3 || $@GM_OVERRIDE), "Start Event!"),
- rif($@EQ_STATUS == 1, "Send wave of items and monsters!"),
+ rif($@EQ_STATUS == 0 && (getmapusers("001-8") >= 3 || $@GM_OVERRIDE) && is_admin(), "Start Event at once!"),
+ rif($@EQ_STATUS == 1 && is_admin(), "Send wave of items and monsters!"),
rif($@EQ_STATUS == 0 && $@GM_OVERRIDE && is_admin(), "[DEBUG] Join Event"),
- rif($@EQ_STATUS == 0 && $@GM_OVERRIDE && is_admin(), "[DEBUG] Join & Start Event"),
+ rif($@EQ_STATUS == 0 && $@GM_OVERRIDE && is_admin(), "[DEBUG] Join & Start Event Now"),
"I'm done.";
if (@menu == 1)
@@ -129,7 +172,27 @@ OnDebugReg:
donpcevent("#QuirinoHUB::OnStart");
end;
+// Each minute
+OnTimer60000:
+ // We must autostart event now
+ if ($@EQ_TIMER <= gettimetick(2)) {
+ if (getmapusers("001-8") >= 3 || $@GM_OVERRIDE) {
+ donpcevent("#QuirinoHUB::OnStart");
+ } else {
+ delcells "qhubN";
+ delcells "qhubS";
+ maptimer("001-8", 1000, "#QuirinoHUB::OnCancel");
+ announce("##1HUNGRY QUIRIN EVENT: ##3##BCancelled due lack of players!", bc_all|bc_npc);
+ }
+ end;
+ }
+ mapannounce "003-1", "Hungry Quirin starts in " + FuzzyTime($@EQ_TIMER) + " and there are " + getmapusers("001-8") + "/3 player(s) standing by." , 0;
+ mapannounce "001-8", "Hungry Quirin starts in " + FuzzyTime($@EQ_TIMER), 0;
+ initnpctimer;
+ end;
+
OnInit:
+ .price=570;
.sex=G_MALE;
.distance=5;
end;