From 32b98f594ebf693e79946c14637f22fa5f12a9ca Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 29 Apr 2019 11:36:34 -0300 Subject: siege_boss() will help me out. --- npc/functions/siege.txt | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'npc/functions') diff --git a/npc/functions/siege.txt b/npc/functions/siege.txt index bf8d8ce0b..0ca53f45d 100644 --- a/npc/functions/siege.txt +++ b/npc/functions/siege.txt @@ -161,6 +161,54 @@ function script siege_revert { return; } +// Create the Siege Boss for #SiegeCtrl utility, DO NEVER CAST TWICE +// siege_boss ( map, difficulty ) +function script siege_boss { + .@m$=getarg(0); + .@s=getarg(1,0); + + // If Difficulty is 0: There is no boss + if (!.@s) + return; + + // We will now prepare the boss + // It must be stronger than players in at least 15 levels, so the mob group + // is different. The siege difficulty, as usual, gives an extra level to them. + .@val=siege_calcdiff(.@m$)+15; + .@val+=.@s; + + // We must cap this at 100 to prevent running out of monsters + // Also, .@val can NEVER be less than 50, to prevent cheating :< + if (.@val > 100) + .@val=100; + else if (.@val < 50) + .@val=50; + + // Get their event/designation + if (.@val >= 80) + .@ts$="Colonel"; + else + .@ts$="Lieutenant"; + + // Select a type for them (saved as .@mobId) + siege_selectmob(siege_calcdiff(.@m$, .@val), .@s); + array_remove($@SIEGE_TMPMOBS, Bif); + array_remove($@SIEGE_TMPMOBS, CandiedSlime); + array_remove($@SIEGE_TMPMOBS, ManaGhost); + array_remove($@SIEGE_TMPMOBS, SlimeBlast); + if (array_entries($@SIEGE_TMPMOBS) > 0) { + .@mobId=any_of($@SIEGE_TMPMOBS); + } else { + .@mobId=Yetifly; + debugmes "ERROR, TOO FEW MOBS ON DATABASE, whaaaaaaat"; + } + + // Announce and spawn + siege_spawn(.@m$, .@mobId, 1, "#SiegeCtrl::On"+.@ts$+"Death"); + mapannounce(.@m$, "##1The Monster "+.@ts$+" arrived! It is a "+strmobinfo(1, .@mobId), bc_map); + return; +} + // Spawn some monsters // siege_cast ( map, NPCName, {, difficulty{, tpflag}} ) function script siege_cast { -- cgit v1.2.3-70-g09d2