summaryrefslogtreecommitdiff
path: root/npc/items
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-02-25 11:38:00 -0300
committerJesusaves <cpntb1@ymail.com>2020-02-25 11:38:00 -0300
commit2f027d167ac60736563a737aad0a82bd2e3663a8 (patch)
tree65165eef508cd86f9e4b5b1d965f5361d9f365a1 /npc/items
parent172f760b4b9851c3a445b62cb5b1d27200d0da66 (diff)
downloadserverdata-2f027d167ac60736563a737aad0a82bd2e3663a8.tar.gz
serverdata-2f027d167ac60736563a737aad0a82bd2e3663a8.tar.bz2
serverdata-2f027d167ac60736563a737aad0a82bd2e3663a8.tar.xz
serverdata-2f027d167ac60736563a737aad0a82bd2e3663a8.zip
Make crystal break rate code more robust
Diffstat (limited to 'npc/items')
-rw-r--r--npc/items/teleporter.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/npc/items/teleporter.txt b/npc/items/teleporter.txt
index c947000c8..658f198c4 100644
--- a/npc/items/teleporter.txt
+++ b/npc/items/teleporter.txt
@@ -34,7 +34,8 @@ OnUse:
// It have at least 20% chance to break
// Chances begin at 100%, and lower in 0.01% each second
// It will never be below 20%, which happens after 8000 seconds
- .@adj_breakrate=limit(2000, 10000-(gettimetick(2)-TELEPORTER_TIME), 9500 );
+ .@timet=limit(0, gettimetick(2)-TELEPORTER_TIME, 8000);
+ .@adj_breakrate=limit(2000, 10000-(.@timet), 9500 );
//debugmes "Adjusted break ratio: %d", .@adj_breakrate;
if (rand(0,10000) > .@adj_breakrate)
getitem @itemid, 1;