From 104c29771e7e44b0794211fa172e9162f8904806 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 3 Mar 2019 13:10:16 -0300 Subject: Change how treasure boxes are handled --- npc/functions/treasure.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'npc/functions/treasure.txt') 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) { -- cgit v1.2.3-60-g2f50