summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/constants.conf1
-rw-r--r--npc/functions/hub.txt7
-rw-r--r--npc/functions/treasure.txt2
3 files changed, 9 insertions, 1 deletions
diff --git a/db/constants.conf b/db/constants.conf
index 354e33333..5581e6d2b 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -4441,6 +4441,7 @@ constants_db: {
comment__: "Configuration constants"
MAX_CYCLE_PC: 40
+ CHEST_WAITTIME: 900 // 15 minutes
BCONFN_SPAWN: 70
BCONFD_SPAWN: 100
BCONFN_MOBHP: 100
diff --git a/npc/functions/hub.txt b/npc/functions/hub.txt
index 2a1bb9fed..d95a18c0d 100644
--- a/npc/functions/hub.txt
+++ b/npc/functions/hub.txt
@@ -14,6 +14,10 @@ function script HUB_Login {
addtimer(1000, "#BlueSageHUB::OnCycle");
}
+ // Random Treasure cleaning
+ if (CLEANUP < gettimetick(2)-CHEST_WAITTIME)
+ deletearray RNGTREASURE_DATE;
+
return;
}
@@ -169,6 +173,9 @@ function script HUB_Logout {
addtimer(300, "#QuirinoHUB::OnNoPenaltyCommand");
}
+ // Register logout time
+ if (!.@dead)
+ CLEANUP=gettimetick(2);
return;
}
diff --git a/npc/functions/treasure.txt b/npc/functions/treasure.txt
index 46434eaad..8b4df9e98 100644
--- a/npc/functions/treasure.txt
+++ b/npc/functions/treasure.txt
@@ -21,7 +21,7 @@ function script TreasureBox {
delitem TreasureKey, 1;
mesc l("You open the chest!");
- RNGTREASURE_DATE[.@id]=gettimetick(2)+60*15; // Minimum 15 minutes
+ RNGTREASURE_DATE[.@id]=gettimetick(2)+CHEST_WAITTIME; // Minimum 15 minutes
.@empty=getvariableofnpc(.empty, strnpcinfo(0));
if (!.@empty) {