From 74a89b8b3accc2d88fca0d2f568d28a3de29ca70 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 2 May 2020 02:36:10 -0300 Subject: This should handle spawns and Dark Petals on 042-10 --- npc/042-10/ctrl.txt | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) (limited to 'npc/042-10') diff --git a/npc/042-10/ctrl.txt b/npc/042-10/ctrl.txt index b5b9fe63e..d1abd2585 100644 --- a/npc/042-10/ctrl.txt +++ b/npc/042-10/ctrl.txt @@ -81,8 +81,7 @@ L_NoAccessBlock: } //////////////////////////////////////////////////////////////////// -// TODO: Catazuli spots -// TODO: Spawn monsters +// TODO: Catazuli info monument // KatazuliInfo( ) function script KatazuliInfo { mes ".:: Magical Seal ::."; @@ -184,6 +183,7 @@ function script KatazuliCore { } // TODO: Spawn monsters, drop Dark Petal + // (Probably spawn Dark Rose Field) // Set cooldown on start if (.@start) { @@ -441,3 +441,62 @@ OnInit: 042-10,100,79,0 duplicate(#K4210Switch_1) #K4210Switch_8 NPC_HIDDEN,0,0 // E 042-10,82,64,0 duplicate(#K4210Switch_1) #K4210Switch_16 NPC_HIDDEN,0,0 // C + +/////////////////////////////////////////////////////////////////// +// THIS CONTROLS EVERYTHING ELSE ON THIS ROOM +// TODO: Spawn monsters +042-10,0,0,0 script #Kamelot4210 NPC_HIDDEN,{ + end; + +OnKillMob: + if (!playerattached()) + goto OnRespawn; + // Handle Dark Petal + // TODO: How MX/PC should affect drop rates? + // I imagine a higher MX will increase DR.... (Right now, level 100 = +10% DR) + .@r=rand2(1000); + if (.@r < 100+$KAMELOT_MX[.@g]) { + getmapxy(.@m$, .@x, .@y, 0); + makeitem(DarkPetal, 1, .@m$, rand2(.@x-1, .@x+1), rand2(.@y-1, .@y+1)); + } + + // Maybe a reward is due + .@g=getcharid(2); + if (.@g < 1) percentheal -100, -100; + getexp $KAMELOT_MX[.@g]*10, $KAMELOT_MX[.@g]*5; + .@delay=max(5000, 30000-$KAMELOT_PC[.@g]*1250); + // FALLTHROUGH + +OnRespawn: + .@delay=(.@delay ? .@delay : 5000); + 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, 160, 140, $KAMELOT_MX[.@g]+10); + end; + +OnInstanceInit: + explode(.@map$, .map$, "@"); + .@g=atoi(.@map$[1]); + if (.@g < 1) { + debugmes "[ERROR] [KAMELOT] Unable to spawn for Kamelot %s", .map$; + .@g=0; + } + .@pc=$KAMELOT_PC[.@g]+1; + .@avg=$KAMELOT_MX[.@g]+15; // Monsters will be at least 15 levels stronger + .@m$="042-10"; // or .@map$[0] + + // Spawns + KamelotCaveSpawn(.@pc*15/10, 60, 24, 115, 85, .@avg, .@m$); // Central Chambers (150% of player population) + + // Fill the whole cave with at least, 1 per 1000 tiles + // There are 16800 tiles, so = 18 guards should do the trick + KamelotCaveSpawn(18, 20, 20, 160, 140, .@avg, .@m$); + end; +} + -- cgit v1.2.3-60-g2f50