summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/functions/siege.txt54
1 files changed, 51 insertions, 3 deletions
diff --git a/npc/functions/siege.txt b/npc/functions/siege.txt
index d5ca43c8d..dfe48324f 100644
--- a/npc/functions/siege.txt
+++ b/npc/functions/siege.txt
@@ -196,6 +196,7 @@ function script siege_boss {
if (!.@s)
return;
+ /* Uncomment this to use common monsters as staff
// 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.
@@ -227,19 +228,66 @@ function script siege_boss {
.@mobId=Yetifly;
Exception("[WARNING] Insufficient monsters in database: Highlight @jesusalva - Broken reference: "+siege_calcdiff(.@m$, .@val), RB_DEBUGMES|RB_IRCBROADCAST);
}
+ */
+
+ // We now select based on player average level and a seed of randomness
+ .@val=siege_calcdiff(.@m$)+.@s;
+
+ // Nobody is on map: Be TRULY random
+ if (.@val < 10) {
+ .@val=rand(20,100);
+ }
+
+ // Switch an adequate boss
+ if (.@val < 20) {
+ .@mobId=MonsterSergeant;
+ .@ts$="Sergeant";
+ } else if (.@val < 40) {
+ .@mobId=MonsterLieutenant;
+ .@ts$="Lieutenant";
+ } else if (.@val < 60) {
+ .@mobId=MonsterCaptain;
+ .@ts$="Captain";
+ } else if (.@val < 80) {
+ .@mobId=MonsterColonel;
+ .@ts$="Colonel";
+ } else {
+ .@mobId=MonsterGeneral;
+ .@ts$="General";
+ }
// We want spawn point to be fixed
.@lx=array_find($@LOCMASTER_MAP$, .@m$);
.@xm=$@LOCMASTER_X[.@lx];
.@ym=$@LOCMASTER_Y[.@lx];
+ .@xm=.@xm+rand(-1,1);
+ .@ym=.@ym+rand(-1,1);
+
// Announce and spawn
- areamonster(.@m$, .@xm-1, .@ym-1, .@xm+1, .@ym+1, .@ts$+" "+strmobinfo(1, .@mobId), .@mobId, 1, "#SiegeCtrl::On"+.@ts$+"Death");
+ .@mGID=monster(.@m$, .@xm, .@ym, strmobinfo(1, .@mobId), .@mobId, 1, "#SiegeCtrl::On"+.@ts$+"Death");
+
+ // Boost the boss stats based on difficulty and nÂș of players online
+ .@bhp=getunitdata(.@mGID, UDT_MAXHP);
+ .@bat=getunitdata(.@mGID, UDT_ATKMAX);
+ .@bdf=getunitdata(.@mGID, UDT_DEF);
+ .@bcr=getunitdata(.@mGID, UDT_CRIT);
+
+ .@s+=getusers(1);
+
+ setunitdata(.@mg, UDT_MAXHP, .@bhp+(.@s*45));
+ setunitdata(.@mg, UDT_HP, .@bhp+(.@s*45));
+
+ setunitdata(.@mg, UDT_ATKMAX, .@bat+(.@s*5));
+ setunitdata(.@mg, UDT_DEF, .@bdf+(.@s*4));
+ setunitdata(.@mg, UDT_CRIT, .@bcr+(.@s*3));
// Spawn some scouts
- areamonster(.@m$, .@xm-1, .@ym-1, .@xm+1, .@ym+1, "Scout", any(GreenSlime,RedSlime,AngryYellowSlime), 3);
+ areamonster(.@m$, .@xm-1, .@ym-1, .@xm+1, .@ym+1, "Scout", any(GreenSlime,RedSlime,AngryYellowSlime), 2);
+ areamonster(.@m$, .@xm-1, .@ym-1, .@xm+1, .@ym+1, "Scout", any(GreenSlime,RedSlime,AngryYellowSlime), 2);
+ areamonster(.@m$, .@xm-1, .@ym-1, .@xm+1, .@ym+1, "Scout", any(GreenSlime,RedSlime,AngryYellowSlime), 2);
- announce("##1The Monster "+.@ts$+" arrived! It is a "+strmobinfo(1, .@mobId), bc_all);
+ announce("##1The Monster "+.@ts$+" arrived! Watch out!", bc_all);
return;
}