diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-04-29 11:36:34 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-04-29 11:36:34 -0300 |
commit | 32b98f594ebf693e79946c14637f22fa5f12a9ca (patch) | |
tree | 1a6a8c6c29887c9eb0d58b0f7af075d6610e5397 /npc/functions/siege.txt | |
parent | 3d09c81da1d9940c1682333ee07c293d00a7be24 (diff) | |
download | serverdata-32b98f594ebf693e79946c14637f22fa5f12a9ca.tar.gz serverdata-32b98f594ebf693e79946c14637f22fa5f12a9ca.tar.bz2 serverdata-32b98f594ebf693e79946c14637f22fa5f12a9ca.tar.xz serverdata-32b98f594ebf693e79946c14637f22fa5f12a9ca.zip |
siege_boss() will help me out.
Diffstat (limited to 'npc/functions/siege.txt')
-rw-r--r-- | npc/functions/siege.txt | 48 |
1 files changed, 48 insertions, 0 deletions
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 { |