Implemented a new Teleport zone restriction and added a check to the teleport manager to see if the player is teleport zone restricted

The firemaking cape will no longer be deleted when logging out in a darkzone
The Stronghold of Security Gift of Peace, Grain of Plenty, and Box of Health will now add coins to already existing stack of coins if inventory is full
The Cradle of Life will now unlock emotes from all previous Stronghold of Security levels if completed (This was added for older accounts which have completed the stronghold of security but are missing the emotes)
Implemented an Entrana allowed item check
If skillcape perks are active then the player is allowed to bring the runecrafting cape(s) to entrana
The teleport block in fishing trawler now only applies while on the boat and is cleared upon logout/leave
Fixed an issue where you could teleport out of the sunk fishing trawler
Fixed an issue where a logout listener was not being removed after failing the fishing trawler causing the player to be teleported to port khazard after their next login
Added a check to to see if the player has items banned on entrana
Blue dragon scales have had their respawn timer corrected to 18 seconds
Fixed the warriors guild cyclops room logout listener to properly be removed when leaving
Players will no longer get stuck if logging out during agility obstacles
Enchanted jewellery teleports now close any open interface
Players can no longer complete the Falador medium diary goal of pickpocketing a guard without 40 thieving
This commit is contained in:
Zerken
2023-08-31 08:23:39 +00:00
committed by Ryan
parent 8116cae7df
commit 2747eb61ec
16 changed files with 71 additions and 57 deletions
+1 -1
View File
@@ -49,7 +49,7 @@
},
{
"item_id": "243",
"loc_data": "{1,2910,9809,0,196610}-{1,2908,9805,0,196610}-{1,2902,9806,0,196610}-{1,2906,9796,0,196610}-{1,2905,9801,0,196610}"
"loc_data": "{1,2910,9809,0,30}-{1,2908,9805,0,30}-{1,2902,9806,0,30}-{1,2906,9796,0,30}-{1,2905,9801,0,30}"
},
{
"item_id": "245",
@@ -225,6 +225,7 @@ enum class EnchantedJewellery(
visualize(player, ANIMATION, GRAPHICS)
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
player.impactHandler.disabledTicks = 4
closeInterface(player)
}
3 -> {
teleport(player,location)
@@ -176,7 +176,7 @@ class WildernessCourse
val fail = AgilityHandler.hasFailed(player, 1, 0.3)
val origLoc = player.location
registerLogoutListener(player, "steppingstone"){p ->
teleport(p, origLoc)
player.location = origLoc
}
submitWorldPulse(object : Pulse(2, player){
var counter = 0
@@ -10,9 +10,10 @@ import core.game.world.map.zone.impl.DarkZone
import core.plugin.Initializable
import core.game.world.GameWorld
import content.global.skill.farming.*
import core.api.getAttribute
import core.api.sendDialogue
import core.api.hasRequirement
import core.api.*
import core.cache.def.impl.ItemDefinition
import org.rs09.consts.Items
import org.rs09.consts.Sounds
enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)? = null) {
BAREFISTED_SMITHING("cape_perks:barefisted-smithing"),
@@ -257,12 +258,13 @@ enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)?
fun sendAltar(player: Player,altar: Altar){
end()
if (altar == Altar.DEATH && !hasRequirement(player, "Mourning's End Part II"))
return
else if (altar == Altar.ASTRAL && !hasRequirement(player, "Lunar Diplomacy"))
return
else if (altar == Altar.BLOOD && !hasRequirement(player, "Legacy of Seergaze"))
if (altar == Altar.DEATH && !hasRequirement(player, "Mourning's End Part II")) return
if (altar == Altar.ASTRAL && !hasRequirement(player, "Lunar Diplomacy")) return
if (altar == Altar.BLOOD && !hasRequirement(player, "Legacy of Seergaze")) return
if (altar == Altar.LAW && !ItemDefinition.canEnterEntrana(player)) {
sendItemDialogue(player, Items.SARADOMIN_SYMBOL_8055, "No weapons or armour are permitted on holy Entrana.")
return
}
var endLoc = if (altar == Altar.ASTRAL) Location.create(2151, 3864, 0) else altar.ruin.end
@@ -1,9 +1,9 @@
package content.minigame.fishingtrawler
import core.api.clearLogoutListener
import core.game.activity.ActivityManager
import core.game.node.entity.player.Player
import core.game.node.entity.skill.Skills
import core.game.node.item.GroundItemManager
import core.game.node.item.Item
import core.game.system.task.Pulse
import core.game.world.map.Location
@@ -14,7 +14,6 @@ import core.game.interaction.InteractionListener
import core.game.interaction.IntType
import core.game.system.command.sets.FISHING_TRAWLER_LEAKS_PATCHED
import core.game.system.command.sets.STATS_BASE
import core.tools.colorize
import kotlin.math.ceil
/**
@@ -89,6 +88,8 @@ class FishingTrawlerInteractionHandler : InteractionListener {
player.dialogueInterpreter.sendDialogue("You climb onto the floating barrel and begin to kick your way to the","shore.","You make it to the shore tired and weary.")
player.appearance.setDefaultAnimations()
player.appearance.sync()
clearLogoutListener(player, "ft-logout")
player.locks.unlockTeleport()
return@on true
}
@@ -1,6 +1,5 @@
package content.minigame.fishingtrawler
import core.api.LogoutListener
import core.api.MapArea
import core.api.getRegionBorders
import core.api.*
@@ -24,7 +23,6 @@ import org.rs09.consts.Items
import core.game.system.command.sets.FISHING_TRAWLER_GAMES_WON
import core.game.system.command.sets.FISHING_TRAWLER_SHIPS_SANK
import core.game.system.command.sets.STATS_BASE
import core.tools.SystemLogger
import core.tools.secondsToTicks
import core.tools.ticksToSeconds
import java.util.concurrent.TimeUnit
@@ -43,7 +41,7 @@ private const val HOLE_SOUTH_Y = 23
private const val LEAKING_ID = 2167
private const val PATCHED_ID = 2168
class FishingTrawlerSession(val activity: FishingTrawlerActivity? = null) : LogoutListener, MapArea {
class FishingTrawlerSession(val activity: FishingTrawlerActivity? = null) : MapArea {
constructor(region: DynamicRegion, activity: FishingTrawlerActivity) : this(activity) {this.region = region; this.base = region.baseLocation}
var players: ArrayList<Player> = ArrayList()
var netRipped = false
@@ -80,7 +78,12 @@ class FishingTrawlerSession(val activity: FishingTrawlerActivity? = null) : Logo
updateOverlay(player)
player.properties.teleportLocation = base.transform(36,24,0)
player.setAttribute("ft-session",this)
registerTimer (player, spawnTimer("teleblock", timeLeft))
registerLogoutListener(player, "ft-logout") {
val session = player.getAttribute<FishingTrawlerSession?>("ft-session",null) ?: return@registerLogoutListener
player.location = Location.create(2667, 3161, 0)
session.players.remove(player)
player.locks.unlockTeleport()
}
}
zone.register(getRegionBorders(region.id))
}
@@ -104,7 +107,6 @@ class FishingTrawlerSession(val activity: FishingTrawlerActivity? = null) : Logo
player.appearance.setAnimations(Animation(188))
player.properties.teleportLocation = session.base.transform(36,24,0)
player.incrementAttribute("/save:$STATS_BASE:$FISHING_TRAWLER_SHIPS_SANK")
removeTimer(player, "teleblock")
}
return true
}
@@ -136,6 +138,9 @@ class FishingTrawlerSession(val activity: FishingTrawlerActivity? = null) : Logo
session.isActive = false
session.swapBoatType(7755)
session.zone.unregister(getRegionBorders(session.region.id))
for(player in session.players) {
player.locks.lockTeleport(1000000)
}
}
if(RandomFunction.random(100) <= 9){
@@ -148,6 +153,7 @@ class FishingTrawlerSession(val activity: FishingTrawlerActivity? = null) : Logo
player.interfaceManager.closeOverlay()
player.properties.teleportLocation = Location.create(2666, 3162, 0)
player.incrementAttribute("/save:$STATS_BASE:$FISHING_TRAWLER_GAMES_WON")
clearLogoutListener(player, "ft-logout")
}
session.zone.unregister(getRegionBorders(session.region.id))
}
@@ -278,18 +284,12 @@ class FishingTrawlerSession(val activity: FishingTrawlerActivity? = null) : Logo
FishingTrawlerOverlay.sendUpdate(player, ((waterAmount / 500.0) * 100).toInt(), netRipped, fishAmount, TimeUnit.SECONDS.toMinutes(ticksToSeconds(timeLeft).toLong()).toInt() + 1)
}
override fun logout(player: Player) {
val session = player.getAttribute<FishingTrawlerSession?>("ft-session",null) ?: return
player.location = Location.create(2667, 3161, 0)
session.players.remove(player)
}
override fun defineAreaBorders(): Array<ZoneBorders> {
return arrayOf()
}
override fun getRestrictions(): Array<ZoneRestriction> {
return arrayOf(ZoneRestriction.CANNON, ZoneRestriction.FIRES, ZoneRestriction.RANDOM_EVENTS)
return arrayOf(ZoneRestriction.CANNON, ZoneRestriction.FIRES, ZoneRestriction.RANDOM_EVENTS, ZoneRestriction.TELEPORT)
}
override fun areaEnter(entity: Entity) {
@@ -129,7 +129,7 @@ public final class CyclopesRoom extends MapZone implements Plugin<Object> {
@Override
public void configure() {
super.register(new ZoneBorders(2838, 3534, 2876, 3556));
super.register(new ZoneBorders(2838, 3534, 2876, 3556, 2));
}
@Override
@@ -13,10 +13,12 @@ import content.region.asgarnia.falador.dialogue.RisingSunInnBartenderDialogue
import content.global.handlers.iface.FairyRing
import content.global.skill.crafting.lightsources.LightSources
import content.global.skill.farming.FarmingPatch
import core.api.getStatLevel
import core.game.diary.AreaDiaryTask
import core.game.diary.DiaryEventHookBase
import core.game.diary.DiaryLevel
import core.game.event.*
import core.game.node.entity.skill.Skills
class FaladorAchievementDiary : DiaryEventHookBase(DiaryType.FALADOR) {
companion object {
@@ -152,7 +154,7 @@ class FaladorAchievementDiary : DiaryEventHookBase(DiaryType.FALADOR) {
}
}
if (event.option == "pickpocket" && (event.target.id in FALADOR_GUARD && inBorders(player, FALADOR_GENERAL_AREA))) {
if (event.option == "pickpocket" && (event.target.id in FALADOR_GUARD && inBorders(player, FALADOR_GENERAL_AREA) && getStatLevel(player, Skills.THIEVING) >= 40)) {
finishTask(
player,
DiaryLevel.MEDIUM,
@@ -1,9 +1,12 @@
package content.region.misthalin.barbvillage.stronghold;
import core.api.Container;
import core.game.dialogue.DialoguePlugin;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.emote.Emotes;
import core.game.node.item.Item;
import org.rs09.consts.Items;
import static core.api.ContentAPIKt.addItem;
/**
* Represents the dialogue plugin used for the box of health.
@@ -12,11 +15,6 @@ import core.game.node.item.Item;
*/
public final class BoxOfHealthDialogue extends DialoguePlugin {
/**
* Represents the coins to recieve.
*/
private static final Item COINS = new Item(995, 5000);
/**
* Constructs a new {@code BoxOfHealth} {@code Object}.
*/
@@ -50,13 +48,12 @@ public final class BoxOfHealthDialogue extends DialoguePlugin {
public boolean handle(int interfaceId, int buttonId) {
switch (stage) {
case 0:
if (player.getInventory().freeSlots() == 0) {
if (!addItem(player, Items.COINS_995, 5000, Container.INVENTORY)) {
player.getPacketDispatch().sendMessage("You don't have enough inventory space.");
end();
break;
}
stage = 1;
player.getInventory().add(COINS);
interpreter.sendDialogue("...congratulations adventurer, you have been deemed worthy of this", "reward. You have also unlocked the Idea emote!");
player.getEmoteManager().unlock(Emotes.IDEA);
player.getSavedData().getGlobalData().getStrongHoldRewards()[2] = true;
@@ -43,8 +43,11 @@ public final class CradleOfLifeDialogue extends DialoguePlugin {
@Override
public boolean open(Object... args) {
if (player.getSavedData().getGlobalData().getStrongHoldRewards()[3]) {
player.getEmoteManager().unlock(Emotes.STOMP);
if (player.getSavedData().getGlobalData().getStrongHoldRewards()[3] && player.getSavedData().getGlobalData().getStrongHoldRewards()[2] && player.getSavedData().getGlobalData().getStrongHoldRewards()[1] && player.getSavedData().getGlobalData().getStrongHoldRewards()[0]) {
// Unlocks emotes for older accounts who don't have the previous level emotes
player.getEmoteManager().unlock(Emotes.FLAP);
player.getEmoteManager().unlock(Emotes.SLAP_HEAD);
player.getEmoteManager().unlock(Emotes.IDEA);
}
if (player.getInventory().freeSlots() == 0) {
player.getPacketDispatch().sendMessage("You don't have enough inventory space.");
@@ -1,9 +1,13 @@
package content.region.misthalin.barbvillage.stronghold;
import core.api.Container;
import core.game.dialogue.DialoguePlugin;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.emote.Emotes;
import core.game.node.item.Item;
import org.rs09.consts.Items;
import static core.api.ContentAPIKt.addItem;
/**
* Represents the gift of peace dialogue plugin.
@@ -12,11 +16,6 @@ import core.game.node.item.Item;
*/
public final class GiftOfPeaceDialogue extends DialoguePlugin {
/**
* Represents the coins item.
*/
private static final Item COINS = new Item(995, 2000);
/**
* Constructs a new {@code GiftOfPeaceDialogue} {@code Object}.
*/
@@ -50,14 +49,13 @@ public final class GiftOfPeaceDialogue extends DialoguePlugin {
public boolean handle(int interfaceId, int buttonId) {
switch (stage) {
case 0:
if (player.getInventory().freeSlots() == 0) {
if (!addItem(player, Items.COINS_995, 2000, Container.INVENTORY)) {
player.getPacketDispatch().sendMessage("You don't have enough inventory space.");
end();
break;
}
interpreter.sendDialogue("...congratulations adventurer, you have been deemed worthy of this", "reward. You have also unlocked the Flap emote!");
stage = 1;
player.getInventory().add(COINS);
player.getEmoteManager().unlock(Emotes.FLAP);
player.getSavedData().getGlobalData().getStrongHoldRewards()[0] = true;
break;
@@ -1,9 +1,13 @@
package content.region.misthalin.barbvillage.stronghold;
import core.api.Container;
import core.game.dialogue.DialoguePlugin;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.emote.Emotes;
import core.game.node.item.Item;
import org.rs09.consts.Items;
import static core.api.ContentAPIKt.addItem;
/**
* Represents the grain of plenty dialogue plugin.
@@ -12,10 +16,6 @@ import core.game.node.item.Item;
*/
public final class GrainOfPlentyDialogue extends DialoguePlugin {
/**
* Represents the coins item.
*/
private static final Item COINS = new Item(995, 3000);
/**
* Constructs a new {@code GrainOfPlenty} {@code Object}.
@@ -50,7 +50,7 @@ public final class GrainOfPlentyDialogue extends DialoguePlugin {
public boolean handle(int interfaceId, int buttonId) {
switch (stage) {
case 0:
if (player.getInventory().freeSlots() == 0) {
if (!addItem(player, Items.COINS_995, 3000, Container.INVENTORY)) {
player.getPacketDispatch().sendMessage("You don't have enough inventory space.");
end();
break;
@@ -58,7 +58,6 @@ public final class GrainOfPlentyDialogue extends DialoguePlugin {
player.getSavedData().getGlobalData().getStrongHoldRewards()[1] = true;
interpreter.sendDialogue("...congratualtions adventurer, you have been deemed worthy of this", "reward. You have also unlocked the Slap Head emote!");
stage = 1;
player.getInventory().add(COINS);
player.getEmoteManager().unlock(Emotes.SLAP_HEAD);
break;
case 1:
@@ -1,5 +1,6 @@
package core.cache.def.impl;
import core.ServerConstants;
import core.api.EquipmentSlot;
import core.cache.Cache;
import core.cache.def.Definition;
@@ -10,6 +11,7 @@ import core.game.node.entity.player.Player;
import core.game.node.entity.skill.Skills;
import core.game.node.item.Item;
import core.game.node.item.ItemPlugin;
import core.game.world.GameWorld;
import core.net.packet.PacketRepository;
import core.net.packet.out.WeightUpdate;
import core.plugin.Plugin;
@@ -615,6 +617,9 @@ public class ItemDefinition extends Definition<Item> {
if (i == null) {
continue;
}
if (GameWorld.getSettings().getSkillcape_perks() && i.getId() == Items.RUNECRAFT_CAPE_9765 || i.getId() == Items.RUNECRAFT_CAPET_9766) {
continue;
}
if (!i.getDefinition().isAllowedOnEntrana()) {
return false;
}
@@ -1,14 +1,13 @@
package core.game.node.entity.player.link;
import content.region.wilderness.handlers.WildernessObeliskPlugin;
import core.ServerConstants;
import core.game.node.entity.Entity;
import core.game.node.entity.impl.Animator.Priority;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.audio.Audio;
import core.game.system.task.Pulse;
import core.game.world.GameWorld;
import core.game.world.map.Location;
import core.game.world.map.zone.ZoneRestriction;
import core.game.world.update.flag.context.Animation;
import core.game.world.update.flag.context.Graphics;
import org.rs09.consts.Sounds;
@@ -100,7 +99,7 @@ public class TeleportManager {
if (!entity.getZoneMonitor().teleport(teleportType, null)) {
return false;
}
if (teleportType != -1 && entity.isTeleBlocked()) {
if (teleportType != -1 && (entity.isTeleBlocked() || entity.getZoneMonitor().isRestricted(ZoneRestriction.TELEPORT))) {
if (entity.isPlayer())
entity.asPlayer().sendMessage("A magical force has stopped you from teleporting.");
return false;
@@ -34,6 +34,11 @@ public enum ZoneRestriction {
* Do not spawn a grave if a player dies here
*/
GRAVES,
/**
* No teleporting allowed.
*/
TELEPORT,
;
/**
@@ -6,6 +6,7 @@ import core.game.event.UseWithEvent;
import core.game.component.Component;
import content.data.LightSource;
import core.game.interaction.Option;
import core.game.interaction.QueueStrength;
import core.game.node.Node;
import core.game.node.entity.Entity;
import core.game.node.entity.combat.CombatStyle;
@@ -21,8 +22,7 @@ import org.jetbrains.annotations.NotNull;
import core.api.Event;
import core.game.world.GameWorld;
import static core.api.ContentAPIKt.getItemName;
import static core.api.ContentAPIKt.runTask;
import static core.api.ContentAPIKt.*;
/**
* Handles a dark area.
@@ -156,9 +156,11 @@ public final class DarkZone extends MapZone implements EventHook<UseWithEvent>{
public void updateOverlay(Player player) {
LightSource source = LightSource.getActiveLightSource(player);
if(SkillcapePerks.isActive(SkillcapePerks.CONSTANT_GLOW,player)){
queueScript(player, 1, QueueStrength.SOFT, false, (Integer stage) -> {
if(player.getInterfaceManager().getOverlay().getId() == DARKNESS_OVERLAY.getId())
player.getInterfaceManager().closeOverlay();
return;
return stopExecuting(player);
});
}
int overlay = -1;
if (player.getInterfaceManager().getOverlay() != null) {