diff options
Diffstat (limited to 'npc')
-rw-r--r-- | npc/items/teleporter.txt | 10 |
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"; |