summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-01-21 20:58:29 -0300
committerJesusaves <cpntb1@ymail.com>2020-01-21 20:58:29 -0300
commit923ab97088750d49f50aca1f33230ad79affb995 (patch)
tree3a2076e6202b6cab51698343dc99ff7899bbf774
parentf48edef881fc4245f1c5e76f503ceb50b0279c7a (diff)
downloadserverdata-923ab97088750d49f50aca1f33230ad79affb995.tar.gz
serverdata-923ab97088750d49f50aca1f33230ad79affb995.tar.bz2
serverdata-923ab97088750d49f50aca1f33230ad79affb995.tar.xz
serverdata-923ab97088750d49f50aca1f33230ad79affb995.zip
Optimize is_night() as it is now more intesively used.
-rw-r--r--npc/005-7/trainer.txt3
-rw-r--r--npc/functions/weather.txt10
2 files changed, 11 insertions, 2 deletions
diff --git a/npc/005-7/trainer.txt b/npc/005-7/trainer.txt
index a7fc492bc..10f1a324a 100644
--- a/npc/005-7/trainer.txt
+++ b/npc/005-7/trainer.txt
@@ -486,6 +486,9 @@ L_Temporada:
mes l("I also hear fisherman likes to fish at night. They say the catch is bigger, if you understand me.");
next;
mesn;
+ mes l("Not only that, but at night monsters are stronger! They also give more experience and drop more often to compensate, though.");
+ next;
+ mesn;
mes l("There's also weather, meaning it can rain, snow, or even happen a sandstorm. They are usually cosmetic, but...");
mes l("...who knows if there isn't a secret in that?");
next;
diff --git a/npc/functions/weather.txt b/npc/functions/weather.txt
index 10ac73e97..8179f9ef3 100644
--- a/npc/functions/weather.txt
+++ b/npc/functions/weather.txt
@@ -4,8 +4,14 @@
// Description:
// Controls world seasons. RESPECT MASK_* VARS ON CONSTANTS DB
-// is_night()
+// is_night(set=False)
function script is_night {
+ // If we're not configuring, retrieve the variable
+ // It is more efficient this way
+ .@set=getarg(0, false);
+ if (!.@set)
+ return $@WEATHER_NIGHT;
+
// Night time depends on season.
// Summer: Day > Night
// Winter: Night > Day
@@ -213,7 +219,7 @@ OnMinute45:
donpcevent("@exprate::OnReload");
donpcevent("@droprate::OnReload");
}
- $@WEATHER_NIGHT=is_night();
+ $@WEATHER_NIGHT=is_night(true);
//debugmes "[Weather.sys] Weather reloaded";
end;