From 37ed4776ef995b9edc9bcec0f9ea08d862431125 Mon Sep 17 00:00:00 2001 From: "Hello=)" Date: Sun, 15 Dec 2024 09:50:31 +0300 Subject: 1) Add Blanc1 -> Blanc2 spawn. 2) If only 1 mob requested to spawn, spawn on exact spot. Rationale: if its just 1 mob, it likely important, yet areaspawn can spawn fewer mobs than requested if e.g. some collisions are in area. Idea is that if mob can be killed on X,Y its certainly not collision so single important mob better off using use this location. --- world/map/npc/functions/spawns_on_mobkill.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/world/map/npc/functions/spawns_on_mobkill.txt b/world/map/npc/functions/spawns_on_mobkill.txt index a3677601..1a1d03e8 100644 --- a/world/map/npc/functions/spawns_on_mobkill.txt +++ b/world/map/npc/functions/spawns_on_mobkill.txt @@ -8,8 +8,9 @@ function|script|spawns_on_mobkill if (@mobID == SeaSlimeMother) goto L_SplitSea; if (@mobID == GreenSlimeMother) goto L_SplitGreen; if (@mobID == Tormenta) goto L_TorWitchDead; + if (@mobID == Blanc1) goto L_Blanc1Dead; if ((@mobID == Luvia) && (getmap() != "052-2")) goto L_LuvWitchDead; // Skip spawns if its Illia - return; + return; // Not mob of interest -> do nothing L_SplitSea: void call("spawn_mobs_around", getmap(), @mobX, @mobY, AngrySeaSlime, rand(8, 20)); @@ -29,6 +30,10 @@ L_LuvWitchDead: void call("spawn_mobs_around", getmap(), @mobX, @mobY, VoidBat, rand(6, 10)); void call("spawn_mobs_around", getmap(), @mobX, @mobY, DemonicSpirit, rand(4, 8)); return; + +L_Blanc1Dead: + void call("spawn_mobs_around", getmap(), @mobX, @mobY, Blanc2, 1); + return; } // Spawns mobs around spot, if it can - or stacks mobs on spot if no room for 3x3 area @@ -44,11 +49,13 @@ function|script|spawn_mobs_around set .@mobQTY, getarg(4, -1); // Amount. if ((.@map$ == "") || (.@mobX < 1) || (.@mobY < 1) || (.@mobID < 1002) || (.@mobX > getmapmaxx(.@map$)) || (.@mobX > getmapmaxy(.@map$)) || - (.@mobQTY < 1)) goto L_Abort; - if ((.@mobX > 1) && (.@mobY > 1) && (.@mobX < getmapmaxx(.@map$)) && (.@mobY < getmapmaxy(.@map$))) //Enough room for 3x3 + (.@mobQTY < 1)) // Invalid parameters given? + goto L_Abort; // Yell and return + if ((.@mobX > 1) && (.@mobY > 1) && (.@mobX < getmapmaxx(.@map$)) && + (.@mobY < getmapmaxy(.@map$)) && (.@mobQTY > 1)) //Enough room for 3x3 && "mass" spawn areamonster .@map$, (.@mobX-1), (.@mobY-1), (.@mobX+1), (.@mobY+1), "", .@mobID, .@mobQTY; else - monster .@map$, .@mobX, .@mobY, "", .@mobID, .@mobQTY; // 3x3 wouldnt fit -> use spot. + monster .@map$, .@mobX, .@mobY, "", .@mobID, .@mobQTY; // 3x3 wouldnt fit or just 1 mob. return; L_Abort: -- cgit v1.2.3-70-g09d2