summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-05-23 21:50:12 -0300
committerJesusaves <cpntb1@ymail.com>2019-05-23 21:50:12 -0300
commitff47c0a3d923353a66b40f7f460a35871452091a (patch)
tree7198408f7fbdf131674e9c5a9a4af9b39ba8365e
parent887803a8a82649a4408b3856074a0bb3303e1b73 (diff)
downloadserverdata-ff47c0a3d923353a66b40f7f460a35871452091a.tar.gz
serverdata-ff47c0a3d923353a66b40f7f460a35871452091a.tar.bz2
serverdata-ff47c0a3d923353a66b40f7f460a35871452091a.tar.xz
serverdata-ff47c0a3d923353a66b40f7f460a35871452091a.zip
Siege Boss is now fixed, this is good for Tulimshar.
-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;
}