summaryrefslogtreecommitdiff
path: root/npc/functions/treasure.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-03-03 13:10:16 -0300
committerJesusaves <cpntb1@ymail.com>2019-03-03 13:10:16 -0300
commit104c29771e7e44b0794211fa172e9162f8904806 (patch)
tree63403e892f80a5335dc0207c091f919cd206ebbc /npc/functions/treasure.txt
parent53c68501b40ea1f130de7260271e1b25afb4ab11 (diff)
downloadserverdata-104c29771e7e44b0794211fa172e9162f8904806.tar.gz
serverdata-104c29771e7e44b0794211fa172e9162f8904806.tar.bz2
serverdata-104c29771e7e44b0794211fa172e9162f8904806.tar.xz
serverdata-104c29771e7e44b0794211fa172e9162f8904806.zip
Change how treasure boxes are handled
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) {