mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-12 01:21:20 -07:00
Fixed incorrect message when trying to use teleport levers while teleblocked
This commit is contained in:
parent
f8cdb5cff5
commit
7a585796be
4 changed files with 33 additions and 14 deletions
|
|
@ -68,8 +68,12 @@ public final class WildernessLeverPlugin extends OptionHandler {
|
||||||
GameWorld.getPulser().submit(new Pulse(2, player) {
|
GameWorld.getPulser().submit(new Pulse(2, player) {
|
||||||
@Override
|
@Override
|
||||||
public boolean pulse() {
|
public boolean pulse() {
|
||||||
|
if (player.timers.getTimer("teleblock") == null) {
|
||||||
lever.message(player, index);
|
lever.message(player, index);
|
||||||
lever.teleport(player, lever.getLocation(index));
|
lever.teleport(player, lever.getLocation(index));
|
||||||
|
} else {
|
||||||
|
player.getPacketDispatch().sendMessage("A magical force has stopped you from teleporting.");
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import core.game.world.GameWorld
|
||||||
/**
|
/**
|
||||||
* This class covers some listeners for the Lost City quest
|
* This class covers some listeners for the Lost City quest
|
||||||
* @author lila
|
* @author lila
|
||||||
|
* @author Player Name
|
||||||
*/
|
*/
|
||||||
@Initializable
|
@Initializable
|
||||||
class LostCityListeners : InteractionListener {
|
class LostCityListeners : InteractionListener {
|
||||||
|
|
@ -36,9 +37,13 @@ class LostCityListeners : InteractionListener {
|
||||||
override fun pulse(): Boolean {
|
override fun pulse(): Boolean {
|
||||||
when (count++) {
|
when (count++) {
|
||||||
0 -> {
|
0 -> {
|
||||||
|
if (player.isTeleBlocked()) {
|
||||||
|
sendMessage(player,"A magical force has stopped you from teleporting.")
|
||||||
|
} else {
|
||||||
sendMessage(player,"The world starts to shimmer...")
|
sendMessage(player,"The world starts to shimmer...")
|
||||||
teleport(player, Location(2452, 4473, 0), TeleportType.FAIRY_RING)
|
teleport(player, Location(2452, 4473, 0), TeleportType.FAIRY_RING)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
1 -> return isQuestComplete(player,quest)
|
1 -> return isQuestComplete(player,quest)
|
||||||
2 -> {
|
2 -> {
|
||||||
finishQuest(player,quest)
|
finishQuest(player,quest)
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,9 @@ import core.tools.RandomFunction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the wilderness obelisk plugin.
|
* Represents the wilderness obelisk plugin.
|
||||||
* @author 'Vexia, small changes by Player Name
|
* @author 'Vexia
|
||||||
* @version 1.1
|
* @author Player Name
|
||||||
|
* @version 1.2
|
||||||
*/
|
*/
|
||||||
@Initializable
|
@Initializable
|
||||||
public final class WildernessObeliskPlugin extends OptionHandler {
|
public final class WildernessObeliskPlugin extends OptionHandler {
|
||||||
|
|
@ -103,10 +104,14 @@ public final class WildernessObeliskPlugin extends OptionHandler {
|
||||||
Obelisk newObelisk = newObelisks[index];
|
Obelisk newObelisk = newObelisks[index];
|
||||||
// Teleport players standing within a 3-by-3 bounding box
|
// Teleport players standing within a 3-by-3 bounding box
|
||||||
for (Player player : RegionManager.getLocalPlayersBoundingBox(center, 1, 1)) {
|
for (Player player : RegionManager.getLocalPlayersBoundingBox(center, 1, 1)) {
|
||||||
|
if (player.timers.getTimer("teleblock") == null) {
|
||||||
player.getPacketDispatch().sendMessage("Ancient magic teleports you somewhere in the wilderness.");
|
player.getPacketDispatch().sendMessage("Ancient magic teleports you somewhere in the wilderness.");
|
||||||
int xOffset = player.getLocation().getX() - center.getX();
|
int xOffset = player.getLocation().getX() - center.getX();
|
||||||
int yOffset = player.getLocation().getY() - center.getY();
|
int yOffset = player.getLocation().getY() - center.getY();
|
||||||
player.getTeleporter().send(Location.create(newObelisk.getLocation().getX() + xOffset, newObelisk.getLocation().getY() + yOffset, 0), TeleportType.OBELISK, 2);
|
player.getTeleporter().send(Location.create(newObelisk.getLocation().getX() + xOffset, newObelisk.getLocation().getY() + yOffset, 0), TeleportType.OBELISK, 2);
|
||||||
|
} else {
|
||||||
|
player.getPacketDispatch().sendMessage("A magical force has stopped you from teleporting.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
super.setDelay(1);
|
super.setDelay(1);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,8 @@ public final class WildernessPlugin extends OptionHandler {
|
||||||
* Represents the plugin used to handle kbd nodes.
|
* Represents the plugin used to handle kbd nodes.
|
||||||
*
|
*
|
||||||
* @author 'Vexia
|
* @author 'Vexia
|
||||||
* @version 1.0
|
* @author Player Name
|
||||||
|
* @version 1.1
|
||||||
*/
|
*/
|
||||||
public static final class KBDPlugin extends OptionHandler {
|
public static final class KBDPlugin extends OptionHandler {
|
||||||
|
|
||||||
|
|
@ -123,10 +124,14 @@ public final class WildernessPlugin extends OptionHandler {
|
||||||
if (player.getLocation().withinDistance(LOCATIONS[5])) {
|
if (player.getLocation().withinDistance(LOCATIONS[5])) {
|
||||||
animate(player, 2140, false);
|
animate(player, 2140, false);
|
||||||
playAudio(player, Sounds.LEVER_2400);
|
playAudio(player, Sounds.LEVER_2400);
|
||||||
|
if (player.isTeleBlocked()) {
|
||||||
|
player.getPacketDispatch().sendMessage("A magical force has stopped you from teleporting.");
|
||||||
|
} else {
|
||||||
player.getPacketDispatch().sendMessage("You pull the lever...");
|
player.getPacketDispatch().sendMessage("You pull the lever...");
|
||||||
player.getTeleporter().send(LOCATIONS[4], TeleportType.NORMAL);
|
player.getTeleporter().send(LOCATIONS[4], TeleportType.NORMAL);
|
||||||
player.getPacketDispatch().sendMessage("... and teleport into the lair of the King Black Dragon!", 5);
|
player.getPacketDispatch().sendMessage("... and teleport into the lair of the King Black Dragon!", 5);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 1817:
|
case 1817:
|
||||||
if (player.getLocation().withinDistance(LOCATIONS[4])) {
|
if (player.getLocation().withinDistance(LOCATIONS[4])) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue