From 47f6fad94cdb287805992192ed3553751a3307d6 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Tue, 8 Jan 2019 21:59:56 -0200 Subject: CoD --- npc/001-10-1/scripts.txt | 77 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 npc/001-10-1/scripts.txt (limited to 'npc/001-10-1/scripts.txt') 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; +} + + -- cgit v1.2.3-70-g09d2