summaryrefslogtreecommitdiff
path: root/npc/items
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-09-15 17:49:30 -0300
committerJesusaves <cpntb1@ymail.com>2018-09-15 17:49:30 -0300
commit3a44eacd66fbf863d74b8017f725bdae5cecc7ef (patch)
tree19a50a1af481c7dff29c567274b86e3997cd2195 /npc/items
parent65afaafc7b0d1db1cc136d64c9829b057563df6a (diff)
downloadserverdata-3a44eacd66fbf863d74b8017f725bdae5cecc7ef.tar.gz
serverdata-3a44eacd66fbf863d74b8017f725bdae5cecc7ef.tar.bz2
serverdata-3a44eacd66fbf863d74b8017f725bdae5cecc7ef.tar.xz
serverdata-3a44eacd66fbf863d74b8017f725bdae5cecc7ef.zip
In other hand, you can use teleporter even while hurt - as long that you're in
a TOWN mapflagged town - I'm not sure if all towns use this mapflag but anyway.
Diffstat (limited to 'npc/items')
-rw-r--r--npc/items/teleporter.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/npc/items/teleporter.txt b/npc/items/teleporter.txt
index 90deb80c1..85da81188 100644
--- a/npc/items/teleporter.txt
+++ b/npc/items/teleporter.txt
@@ -8,6 +8,12 @@
- script LoF Teleporter NPC_HIDDEN,{
close;
+ // Checks if you can warp
+ function loftel_check {
+ getmapxy(.@m$, .@x, .@y);
+ return (readparam(Hp) < readparam(MaxHp) && !getmapflag(.@m$, mf_town));
+ }
+
L_Cooldown:
mesn;
mesc l("This teleporter is currently recharging.");
@@ -43,7 +49,7 @@ OnUse:
close;
L_Save:
- if (readparam(Hp) < readparam(MaxHp)) {
+ if (loftel_check()) {
dispbottom l("You are hurt, and cannot use this.");
} else {
doevent "shake::OnGM";
@@ -54,7 +60,7 @@ L_Save:
end;
L_LoF:
- if (readparam(Hp) < readparam(MaxHp)) {
+ if (loftel_check()) {
dispbottom l("You are hurt, and cannot use this.");
} else {
doevent "shake::OnGM";