From b7e223c55e272e99cd0a01a60979e3e79a888f62 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 26 Apr 2019 00:50:51 -0300 Subject: Game Storyline Interface, past event transitions accounted! --- npc/functions/gmbot.txt | 62 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 5 deletions(-) (limited to 'npc/functions') diff --git a/npc/functions/gmbot.txt b/npc/functions/gmbot.txt index f47562a2c..1b6516d90 100644 --- a/npc/functions/gmbot.txt +++ b/npc/functions/gmbot.txt @@ -3,6 +3,30 @@ // Jesusalva // Description: // GM Bot for the Monster King. +// VARIABLES +// $GAME_STORYLINE - Current Storyline status +// $@MK - Monster King Game ID +// $@MK_SCENE - Current event being handled by the Monster King +// $MK_TEMPVAR - Temporary Variable +// +// Storyline statuses: +// 0 - The Monster King is inactive (leading sieges to Hurnscald and Nivalis) +// 1 - The Monster King is known by players and is giving them a month break +// 2 - The Monster King is currently sieging towns at random +// 3 - The Monster King is preparing to perfom the Rite +// 4 - The Rite is in progress. Players must walk to MK evil lair. +// +// $MK_TEMPVAR meaning depends on GAME STORYLINE +// GS 0 +// Ignored +// GS 1 +// Tracks the day since 1970 when the town was cleared. A month break. +// GS 2 +// Player score (1pt per Lieutenant, 10pts per Colonel) +// Affects the end of Game Story 2 and begin of Game Story 3 +// Because we must wait players... +// GS 3 +// Stage TBD 000-0,0,0,0 script Monster King NPC_HIDDEN,{ OnSlaveDie: @@ -63,6 +87,14 @@ OnTimer90000: if (.mp$ == "011-1") enablenpc "Mana Stone"; + // The Monster King will not move anymore because story + if ($GAME_STORYLINE == 0 || + $GAME_STORYLINE == 4) { + if (.mp$ != "boss") + unitwarp($@MK, "boss", 45, 45); + initnpctimer; + } + // Select a random map. Never shows up at Candor and cities, nor indoors. Not all maps either. setarray .@m$, "boss", "boss", "001-1", "001-3", "001-4", "001-5", "001-6", "001-7", "001-10", "003-1", "003-1-3", "004-1", "004-2", "007-1", "010-1", "010-1-1", "010-2", "011-1", @@ -102,8 +134,9 @@ OnTimer90000: end; } - // Siege events (req. 80 aggro, 3 users, and 70% chances to begin) - if ($@MK_AGGRO >= 80 && .users >= 3 && rand(0,100) < 70) { + // Siege events (req. 300 aggro, 3 users, and 70% chances to begin) + if ($@MK_AGGRO >= 300 && .users >= 3 && rand(0,100) < 70 && + $GAME_STORYLINE == 2){ // Tulimshar if (.mp$ ~= "003-*") { announce ("Monster King: I smell humans! Humans must die!"), bc_map|bc_npc; @@ -118,9 +151,10 @@ OnTimer90000: } } - // If a player is nearby, MK might randomly make an event for said player - // Of course, this is unlikely, unless we have too few players - if (.nearby > 1 && $@MK_AGGRO >= 120){ + // If a player is nearby while the Monster King prepares, event may happen + // Minimum 60 Aggro + if (.nearby > 1 && $@MK_AGGRO >= 80 && + ($GAME_STORYLINE == 1 || $GAME_STORYLINE == 3)){ // We should decide event kind, but that's NYI announce ("Monster King: I smell humans! Humans must die!"), bc_map|bc_npc; @@ -134,6 +168,24 @@ OnTimer90000: $@MK_AGGRO=$@MK_AGGRO/5; } + // Maybe, just maybe, game storyline must be updated here + if ($GAME_STORYLINE == 1 && $MK_TEMP && + $MK_TEMP <= gettimeparam(GETTIME_DAYOFMONTH)) { + // Game Story Change: Idle MK -> Active MK + kamibroadcast("I can't handle it anymore! NO MORE!", "Monster King"); + sleep(2500); + kamibroadcast("Come, my minions! Lay siege to towns! LEAVE NO OPPOSITION TO ME!", "Monster King"); + sleep(2500); + kamibroadcast("Burn, destroy, do whatever you need, until your last breath, my lieutenants and colonels!", "Monster King"); + sleep(2500); + kamibroadcast("##4 .:: Game Story Instructions on #world ::."); + channelmes("#world", "##1 **GAME STORY CHANGE** - The Monster King minions will now attack cities and lay waste to them."); + channelmes("#world", "##1 Players must defeat the lieutenants and colonels in order to prevent sieges from continuing."); + + // Apply the changes + $GAME_STORYLINE=2; + } + // We're done, restart loop timer initnpctimer; end; -- cgit v1.2.3-60-g2f50