summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-08-18 01:26:39 -0300
committerJesusaves <cpntb1@ymail.com>2019-08-18 01:26:39 -0300
commit960dee60bbd65262c951bfed1f8eea067d26a35f (patch)
tree653d0a3277ebbd4eceb9f093e2fdc364b1515e50 /npc
parent7e6b82f9ee252e862e551493dc0836b0d98047f0 (diff)
downloadserverdata-960dee60bbd65262c951bfed1f8eea067d26a35f.tar.gz
serverdata-960dee60bbd65262c951bfed1f8eea067d26a35f.tar.bz2
serverdata-960dee60bbd65262c951bfed1f8eea067d26a35f.tar.xz
serverdata-960dee60bbd65262c951bfed1f8eea067d26a35f.zip
Minor improvements and corrections. This allows sieges to keep happening until
the Fortress is sieged itself.
Diffstat (limited to 'npc')
-rw-r--r--npc/017-10/dispatcher.txt2
-rw-r--r--npc/functions/gmbot.txt4
-rw-r--r--npc/functions/math.txt4
-rw-r--r--npc/functions/siege.txt5
4 files changed, 9 insertions, 6 deletions
diff --git a/npc/017-10/dispatcher.txt b/npc/017-10/dispatcher.txt
index 5dbbf96f5..82be5fd2a 100644
--- a/npc/017-10/dispatcher.txt
+++ b/npc/017-10/dispatcher.txt
@@ -65,7 +65,7 @@ L_Main:
rif(gethominfo(6) >= 15, l("Deploy to Slime Nest [2h]")),
rif(gethominfo(6) >= 30, l("Deploy to Snake Pit [3h]")),
rif(gethominfo(6) >= 55, l("Deploy to Dangerous Area [6h]")),
- rif(gethominfo(6) >= 80 && GAME_STORYLINE >= 4, l("Deploy to Monster King Basement [8h]")),
+ rif(gethominfo(6) >= 80 && $GAME_STORYLINE >= 4, l("Deploy to Monster King Basement [8h]")),
"",
l("Deploy to The Market [1h]"),
l("Don't deploy");
diff --git a/npc/functions/gmbot.txt b/npc/functions/gmbot.txt
index 2fc06044a..8ad416cce 100644
--- a/npc/functions/gmbot.txt
+++ b/npc/functions/gmbot.txt
@@ -141,14 +141,14 @@ OnTimer90000:
debugmes "Monster King (bot): "+.mp$+" ("+.@x+", "+.@y+")";
// If too few players are online, we don't need an event AT ALL!
- if (.users < rand(2,4)) {
+ if (.users < rand2(2,4)) {
initnpctimer;
end;
}
// Siege events (req. 300 aggro, 3 users, and 70% chances to begin)
if ($@MK_AGGRO >= 300 && .users >= 3 && rand(0,100) < 70 &&
- $GAME_STORYLINE == 2 && $@MK_THROTTLE < gettimetick(2)){
+ is_between(1, 3, $GAME_STORYLINE) && $@MK_THROTTLE < gettimetick(2)){
// Tulimshar
if (.mp$ ~= "003-*") {
announce ("Monster King: I smell humans! Humans must die!"), bc_map|bc_npc;
diff --git a/npc/functions/math.txt b/npc/functions/math.txt
index 068d46cba..fc27bec40 100644
--- a/npc/functions/math.txt
+++ b/npc/functions/math.txt
@@ -73,7 +73,9 @@ function script log2 {
// is_between ( lower, higher, target)
function script is_between {
.@val=getarg(2);
- return (getarg(0) < .@val && getarg(1) >= .@val);
+ .@min=getarg(0);
+ .@max=getarg(1);
+ return (.@min < .@val && .@val <= .@max);
}
diff --git a/npc/functions/siege.txt b/npc/functions/siege.txt
index baca59a63..98a600dc8 100644
--- a/npc/functions/siege.txt
+++ b/npc/functions/siege.txt
@@ -191,10 +191,11 @@ function script siege_check {
.@mb+=mobcount(.@m$, "#SiegeCtrl::OnColonelDeath");
.@mb+=mobcount(.@m$, "#SiegeCtrl::OnGeneralDeath");
- // Players failed, so reduce score in 1
+ // Players failed, so reduce score in 1~10 (like Sergeant~General).
+ // In future, it could be inverse proportion (-9 for sergeant, -1 for general)
if (.@mb) {
if ($GAME_STORYLINE == 2)
- $MK_TEMPVAR-=1;
+ $MK_TEMPVAR-=rand2(1, 10);
kamibroadcast("Players failed to defend the city!!");
debugmes "Number of boss grade monsters found: %d", .@mb;
$SIEGE_DIFFICULTY=max(1, ($SIEGE_DIFFICULTY/2));