summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/event.txt43
1 files changed, 43 insertions, 0 deletions
diff --git a/npc/functions/event.txt b/npc/functions/event.txt
index 72e854429..7ba1e802c 100644
--- a/npc/functions/event.txt
+++ b/npc/functions/event.txt
@@ -363,6 +363,48 @@ OnBossDie:
end;
}
+- script sThankAeros NPC_HIDDEN,{
+OnInit:
+ .users=getusers(1);
+ .score=0;
+ .event=0;
+OnTimer90000:
+ if ($EVENT$ != "Thanksgiving")
+ end;
+ .users=getusers(1);
+ .score+=.users;
+
+ // Abort event and reset score
+ if (.event && .event < gettimetick(2)) {
+ .event=0;
+ .score=0;
+ $@GM_EVENT=0;
+ $@MK_SCENE=MK_NONE;
+ killmonsterall("001-1");
+ mapwarp("001-1", "000-1", 22, 22, 0);
+ announce ("The event is over!"), bc_all|bc_npc;
+ }
+
+ // Do event (lasts 30 minutes)
+ if (!.event && !$@MK_SCENE && .score > 300 && .users > 3) {
+ /* Reserve Aeros */
+ $@MK_SCENE=MK_LOCKED;
+ /* Setup the event */
+ $@AEROS_SPWN=(.users > 6 ? 2 : any(0, 1));
+ $@AEROS_AUTOSPAWN=.users+rand2(1, .users);
+ donpcevent("Mana Being#001-1::OnAutoSched");
+ /* Open the event */
+ $@GM_EVENT = 2;
+ .event = gettimetick(2) + 1800;
+ announce ("The mana bridge to Aeros is open! To participate on event, talk to ##BSoul Menhir##b!"), bc_all|bc_npc;
+ announce ("##1THANKSGIVING SPECIAL. TIME LIMIT: ##B30 MINUTES.##b##0"), bc_all|bc_npc;
+ channelmes("#world", "An event is happening on Aeros! Hurry up!");
+ }
+
+ initnpctimer;
+ end;
+}
+
function script sThanksgiving {
// Variables:
// #THANKS_DAY
@@ -966,6 +1008,7 @@ OnClock0000:
if ($EVENT$ != "")
FYStopEvent();
$EVENT$="Thanksgiving";
+ donpcevent("sThankAeros::OnTimer90000");
}
// End the event the day after
else if (.@d == .thanks_endday+1 && .@m == .thanks_endmon) {