forked from 2009Scape/Server
Allow Ancient Magick spells to work up to level 48 wilderness.
This commit is contained in:
parent
a361915281
commit
ee3a71a5d0
1 changed files with 27 additions and 1 deletions
|
|
@ -238,7 +238,7 @@ public final class ZoneMonitor {
|
|||
* @return {@code True} if so.
|
||||
*/
|
||||
public boolean teleport(int type, Node node) {
|
||||
if (type != -1 && entity.isTeleBlocked() && !canTeleportByJewellery(type, node)) {
|
||||
if (type != -1 && entity.isTeleBlocked() && !canTeleportByJewellery(type, node)&& !canTeleportByAncient(type)) {
|
||||
if (entity.isPlayer()) {
|
||||
entity.asPlayer().sendMessage("A magical force has stopped you from teleporting.");
|
||||
}
|
||||
|
|
@ -278,6 +278,32 @@ public final class ZoneMonitor {
|
|||
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Snowscape custom allowing teleports with Ancient Magicks in >= 1 <= 30 wilderness level
|
||||
* @return {@code True} if so.
|
||||
*/
|
||||
private boolean canTeleportByAncient(int type) {
|
||||
if (type != 0) {
|
||||
return false;
|
||||
}
|
||||
if (entity.timers.getTimer("teleblock") != null)
|
||||
return false;
|
||||
|
||||
if (entity.getZoneMonitor().isRestricted(ZoneRestriction.TELEPORT)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (entity.getLocks().isTeleportLocked()) {
|
||||
if (entity.isPlayer()) {
|
||||
Player p = entity.asPlayer();
|
||||
if (p.getSpellBookManager().getSpellBook() == 193 && p.getSkullManager().getLevel() >= 1 && p.getSkullManager().getLevel() <= 48) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the death should start for an entity.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue