summaryrefslogtreecommitdiff
path: root/npc/functions/treasure.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/treasure.txt')
-rw-r--r--npc/functions/treasure.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/npc/functions/treasure.txt b/npc/functions/treasure.txt
index 4b2cd4b6d..16f607e30 100644
--- a/npc/functions/treasure.txt
+++ b/npc/functions/treasure.txt
@@ -5,6 +5,12 @@
// Random Treasure Box Utils
function script TreasureBox {
+ .@id=getnpcid();
+ if (RNGTREASURE_DATE[.@id] > gettimetick(2)) {
+ mesc l("The chest is unlocked and empty.");
+ close;
+ }
+
mesc l("Open the chest?");
mesc l("Cost: 1 @@", getitemlink(TreasureKey)), 1;
if (!countitem(TreasureKey))
@@ -15,6 +21,7 @@ function script TreasureBox {
delitem TreasureKey, 1;
mesc l("You open the chest!");
+ RNGTREASURE_DATE[.@id]=gettimetick(2)+60*4; // Minimum 4 hours
.@empty=getvariableofnpc(.empty, strnpcinfo(0));
if (!.@empty) {