summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/042-10/ctrl.txt63
-rw-r--r--npc/soren/main.txt6
2 files changed, 64 insertions, 5 deletions
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;
+}
+
diff --git a/npc/soren/main.txt b/npc/soren/main.txt
index db098f63f..df05b8aec 100644
--- a/npc/soren/main.txt
+++ b/npc/soren/main.txt
@@ -188,7 +188,7 @@ OnTimer31000:
.@uy=.y+.distance;
// Core function
- areamonster .map$, .@lx, .@ly, .@ux, .@uy, strmobinfo(1, .@monsterId), .@monsterId, .@amount; makeitem(.@itemId, 1, .map$, rand(.@lx, .@ux), rand(.@ly, .@uy)); ++.st;
+ areamonster .map$, .@lx, .@ly, .@ux, .@uy, strmobinfo(1, .@monsterId), .@monsterId, .@amount; makeitem(.@itemId, 1, .map$, rand2(.@lx, .@ux), rand2(.@ly, .@uy)); ++.st;
specialeffect(54);
// If we're done with waves
@@ -341,7 +341,7 @@ OnTimer30900:
.@ly=141; .@uy=141;
// Core function
- areamonster .map$, .@lx, .@ly, .@ux, .@uy, strmobinfo(1, .@monsterId), .@monsterId, .@amount; makeitem(.@itemId, 1, .map$, rand(.@lx, .@ux), rand(.@ly, .@uy)); ++.st;
+ areamonster .map$, .@lx, .@ly, .@ux, .@uy, strmobinfo(1, .@monsterId), .@monsterId, .@amount; makeitem(.@itemId, 1, .map$, rand2(.@lx, .@ux), rand2(.@ly, .@uy)); ++.st;
// If we're done with waves
if (.st >= 7) {
@@ -495,7 +495,7 @@ OnTimer31200:
.@uy=.y+.distance;
// Core function
- areamonster .map$, .@lx, .@ly, .@ux, .@uy, strmobinfo(1, .@monsterId), .@monsterId, .@amount; makeitem(.@itemId, 1, .map$, rand(.@lx, .@ux), rand(.@ly, .@uy)); ++.st;
+ areamonster .map$, .@lx, .@ly, .@ux, .@uy, strmobinfo(1, .@monsterId), .@monsterId, .@amount; makeitem(.@itemId, 1, .map$, rand2(.@lx, .@ux), rand2(.@ly, .@uy)); ++.st;
// If we're done with waves
if (.st >= 7) {