summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-10-23 13:05:53 -0300
committerJesusaves <cpntb1@ymail.com>2022-10-23 13:05:53 -0300
commit222f77c45e82f9e11a62b6caae3472ec12a13443 (patch)
tree65f1dab82b47f841c292d77c51cf794095e80a08 /npc
parentf8bbda3f56956a09e90a2da7befd8427404c35dd (diff)
downloadserverdata-222f77c45e82f9e11a62b6caae3472ec12a13443.tar.gz
serverdata-222f77c45e82f9e11a62b6caae3472ec12a13443.tar.bz2
serverdata-222f77c45e82f9e11a62b6caae3472ec12a13443.tar.xz
serverdata-222f77c45e82f9e11a62b6caae3472ec12a13443.zip
Revert the siege conditions. However, no siege will happen if no monster was
killed the past 90 seconds.
Diffstat (limited to 'npc')
-rw-r--r--npc/functions/hub.txt6
-rw-r--r--npc/functions/mkbot.txt45
-rw-r--r--npc/functions/mobpoint.txt3
3 files changed, 18 insertions, 36 deletions
diff --git a/npc/functions/hub.txt b/npc/functions/hub.txt
index 01e2f2b90..f8d15a089 100644
--- a/npc/functions/hub.txt
+++ b/npc/functions/hub.txt
@@ -47,7 +47,7 @@ function script HUB_Login {
*/
// Work only on new chars, or chars which cleared Tulimshar.
if (.@gto == WORLD_ID &&
- (!getq(General_Narrator) ||
+ ((!getq(General_Narrator) && BaseLevel < 5) ||
(getq(General_Narrator) && BaseLevel > 20)))
{
// Warp to the proper Mirror Lake
@@ -59,8 +59,8 @@ function script HUB_Login {
// Send debug information
debugmes("Vault User %d moved to lake %d.", getvaultid(), .@mlp);
- // Handle new user (non-native) accounts
- if (!getq(General_Narrator)) {
+ // TODO: Handle new user (non-native) accounts
+ if (!getq(General_Narrator) && BaseLevel < 5) {
adddefaultskills();
getitembound MirrorLakeArmor, 1, 4;
equip(MirrorLakeArmor);
diff --git a/npc/functions/mkbot.txt b/npc/functions/mkbot.txt
index 1229dfd60..f396d823a 100644
--- a/npc/functions/mkbot.txt
+++ b/npc/functions/mkbot.txt
@@ -140,7 +140,7 @@ OnTimer90000:
}
// Monster King will not warp around for sightseeing if he is threatened
- if ($GAME_STORYLINE > 2 && $@MK_AGGRO < 250) {
+ if ($GAME_STORYLINE > 2 && $@MK_AGGRO < 150) {
.mp$="boss";.@x=45;.@y=45;
}
@@ -162,9 +162,10 @@ OnTimer90000:
end;
}
- // Siege events (req. 700 aggro, 3 users, and 75% chances to begin)
- if ($@MK_AGGRO >= ($GAME_STORYLINE == 2 ? 700 : 2100) && .users >= 3 && rand2(0,100) < 75 &&
- is_between(1, 4, $GAME_STORYLINE) && $@MK_THROTTLE < gettimetick(2)){
+ // Siege events (req. 300 aggro, 3 users, and 70% chances to begin)
+ if ($@MK_AGGRO >= ($GAME_STORYLINE == 2 ? 300 : 900) && .users >= 3 && rand2(0,100) < 70 &&
+ is_between(1, 4, $GAME_STORYLINE) && $@MK_THROTTLE < gettimetick(2) &&
+ $@MK_TRIGGERED){
// Delta handles the compulsory wait time between waves.
// 7 hours normally, 24 hours if the army is in disarray.
.@delta=7;
@@ -202,8 +203,8 @@ OnTimer90000:
}
// If a player is nearby while the Monster King prepares, event may happen
- // Minimum 90 Aggro
- if (.nearby > 1 && $@MK_AGGRO >= 90 &&
+ // Minimum 80 Aggro
+ if (.nearby > 1 && $@MK_AGGRO >= 80 &&
($GAME_STORYLINE == 1 || ($GAME_STORYLINE >= 3 && $@MK_THROTTLE >= gettimetick(2)) )){
// We should decide event kind, but that's NYI
announce ("Monster King: I smell humans! Humans must die!"), bc_map|bc_npc;
@@ -211,9 +212,11 @@ OnTimer90000:
getmapxy(.@m$, .@x, .@y, UNITTYPE_MOB, $@MK);
// Spawn stuff
- areamonster(.@m$, .@x-20, .@y-20, .@x+20, .@y+20, "Monster", ManaGhost, max(60, ($@MK_AGGRO/20))+.nearby, "Monster King::OnSlaveDie");
- //$@MK_AGGRO=($@MK_AGGRO*$GAME_STORYLINE)/5;
- $@MK_AGGRO-=rand2(30, 80); // Reduce aggro, but do not deplete it
+ areamonster(.@m$, .@x-20, .@y-20, .@x+20, .@y+20, "Monster", ManaGhost, min(60, $@MK_AGGRO/10)+.nearby, "Monster King::OnSlaveDie");
+
+ // Remove some aggro. TODO: Do not remove so much aggro if it was high
+ .@diff=($@MK_AGGRO*$GAME_STORYLINE)/5;
+ $@MK_AGGRO=max(.@diff, 0);
}
// Maybe, just maybe, game storyline must be updated here
@@ -249,30 +252,8 @@ OnTimer90000:
}
// We're done, restart loop timer
+ $@MK_TRIGGERED=false;
initnpctimer;
end;
}
-// MKAggro(mobID) → Monster King aggro
-function script MKAggro {
- // Every 30 levels gives +1 to monster king aggro
- // Monsters below level 30 do not generate aggro
- .@aggro=getarg(0, killedrid);
- .@moblv=strmobinfo(3,.@aggro);
- .@aggro=min(5, .@moblv / 30);
-
- // Cycles of 30 seconds
- if (@mkaggra+30 > gettimetick(2)) {
- .@aggro -= @mkaggrb;
- if (.@aggro <= 0)
- return;
- } else {
- @mkaggrb=0;
- }
- // Increase monster king aggro and update ticks
- $@MK_AGGRO += .@aggro;
- @mkaggra=gettimetick(2);
- @mkaggrb=.@aggro + @mkaggrb;
- return;
-}
-
diff --git a/npc/functions/mobpoint.txt b/npc/functions/mobpoint.txt
index 89fd4f37b..36f647e01 100644
--- a/npc/functions/mobpoint.txt
+++ b/npc/functions/mobpoint.txt
@@ -91,9 +91,10 @@ OnNPCKillEvent:
callfunc "CraftmasterDay";
callfunc "CadisQuestCheck";
callfunc "GeminiKill";
- callfunc "MKAggro";
callfunc "SK_drops";
+ // Other updates
+ $@MK_TRIGGERED=true;
// Unset killedrid. This affects multiple calls of this function
// But it is in overall more reliable imao
killedrid=0;