From 2d3c0f251927ef6770a604592ede36bc60afbc56 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 1 May 2020 04:13:58 -0300 Subject: West Chamber of Kamelot =D --- npc/042-9/_import.txt | 1 + npc/042-9/_warps.txt | 1 - npc/042-9/ctrl.txt | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 npc/042-9/ctrl.txt (limited to 'npc') diff --git a/npc/042-9/_import.txt b/npc/042-9/_import.txt index 1de7c272a..cfd445a38 100644 --- a/npc/042-9/_import.txt +++ b/npc/042-9/_import.txt @@ -1,3 +1,4 @@ // Map 042-9: Camelot Sewer West Path // This file is generated automatically. All manually added changes will be removed when running the Converter. "npc/042-9/_warps.txt", +"npc/042-9/ctrl.txt", diff --git a/npc/042-9/_warps.txt b/npc/042-9/_warps.txt index 3bc111250..6766d0bc9 100644 --- a/npc/042-9/_warps.txt +++ b/npc/042-9/_warps.txt @@ -1,4 +1,3 @@ // This file is generated automatically. All manually added changes will be removed when running the Converter. // Map 042-9: Camelot Sewer West Path warps 042-9,99,21,0 warp #042-9_99_21 0,4,042-10,21,79 -042-9,99,80,0 warp #042-9_99_80 0,6,042-5,21,43 diff --git a/npc/042-9/ctrl.txt b/npc/042-9/ctrl.txt new file mode 100644 index 000000000..8a5696dca --- /dev/null +++ b/npc/042-9/ctrl.txt @@ -0,0 +1,115 @@ +// TMW 2 Script +// Author: +// Jesusalva +// Micksha +// Description: +// Controls sewers. +// FIXME: People should not be able to return here once they leave to 042-10 +// Spawn monsters and respawns them. + +// A simple random treasure chest - to be sure players were introduced to this +// awesome system. Same rules as any treasure box still applies. +042-9,48,76,0 script #chest_0429 NPC_CHEST,{ + KamelotTreasure(1); + specialeffect(.dir == 0 ? 24 : 25, AREA, getnpcid()); // closed ? opening : closing + close; + +OnInit: + .distance = 2; + end; + +OnInstanceInit: + // Yes, we just hope it works out of box + explode(.@map$, .map$, "@"); + .@g=atoi(.@map$[1]); + if (.@g < 1) { + debugmes "[ERROR] [KAMELOT] Unable to spawn for Kamelot %s", .map$; + debugmes "[ERROR] [KAMELOT] Using dummy data (returned: %d)", .@g; + .@g=0; + } + debugmes "Spawning monsters for guild %d", .@g; + .@mx=getguildavg(.@g); + + // Corritors + KamelotCaveSpawn(3, 67, 60, 100, 85, .@mx, "042-9"); // Sewer + KamelotCaveSpawn(12, 20, 20, 100, 50, .@mx, "042-9"); // West+Exit + KamelotCaveSpawn(3, 28, 50, 67, 67, .@mx, "042-9"); // East + + // Boss Chamber + KamelotCaveSpawn(5, 21, 60, 51, 80, .@mx, "042-9"); + KamelotBoss("042-9", 40, 74, .@mx+1, .name$); + + // Boss monster + // TODO + + // Neutral monsters + areamonster(.map$, 20, 20, 100, 85, strmobinfo(1, YellowSlime), YellowSlime, 5); + areamonster(.map$, 20, 20, 100, 85, strmobinfo(1, ManaGhost), ManaGhost, max(1, .@mx/10)); + areamonster(.map$, 20, 20, 100, 85, strmobinfo(1, CaveMaggot), CaveMaggot, 30); + + // Bonus monsters + if (!rand2(2)) + areamonster(.map$, 45, 20, 100, 85, strmobinfo(1, MagicBif), MagicBif, 2); + if (!rand2(2)) + areamonster(.map$, 20, 20, 100, 85, strmobinfo(1, GoldenChest), GoldenChest, 1); + if (!rand2(2)) + areamonster(.map$, 20, 20, 100, 85, strmobinfo(1, SilverChest), SilverChest, 2); + if (!rand2(2)) + areamonster(.map$, 20, 20, 100, 85, strmobinfo(1, BronzeChest), BronzeChest, 3); + end; + +OnKillBoss: + if (!playerattached()) + goto OnRespawn; + // Maybe a reward is due + .@g=getcharid(2); + if (.@g < 1) percentheal -100, -100; + getitem GuildCoin, 2+min(13, $KAMELOT_MX[.@g]/10); + getexp $KAMELOT_MX[.@g]*14, $KAMELOT_MX[.@g]*8; + mapannounce getmap(), strcharinfo(0)+" has defeated the boss!", 0; + .@delay=max(3000, 21000-$KAMELOT_PC[.@g]*1000); + goto OnRespawn; + +OnKillMob: + if (!playerattached()) + goto OnRespawn; + // Maybe a reward is due + .@g=getcharid(2); + if (.@g < 1) percentheal -100, -100; + getexp $KAMELOT_MX[.@g]*7, $KAMELOT_MX[.@g]*4; + .@delay=max(3000, 21000-$KAMELOT_PC[.@g]*1000); + // FALLTHROUGH + +OnRespawn: + .@delay=(.@delay ? .@delay : 3000); + sleep(.@delay); + // Yes, we just hope it works out of box + explode(.@map$, .map$, "@"); + .@g=atoi(.@map$[1]); + if (.@g < 1) { + debugmes "[ERROR] [KAMELOT] Unable to respawn for Kamelot %s", .map$; + .@g=0; + } + KamelotCaveSpawn(1, 20, 20, 115, 100, $KAMELOT_MX[.@g], "042-9"); + end; + +} + + +// The exit only works before chest is looted +042-9,99,80,0 script #KDoor0429 NPC_HIDDEN,0,6,{ + end; + +OnTouch: + .@g=getcharid(2); + if (.@g < 1) percentheal -100, -100; + if ($KAMELOT_KEYMASK[.@g] & 1) goto L_NoAccess; + warp "042-5@"+.@g, 21, 43; + end; + + +L_NoAccess: + dispbottom l("OH NOES! The ceiling seems to have collapsed when the chest was open! We are forced to go forward!!"); + end; +} + -- cgit v1.2.3-70-g09d2