Merge remote-tracking branch 'upstream/master'

This commit is contained in:
skelsoft
2021-07-10 11:01:34 +10:00
12 changed files with 65 additions and 29 deletions
@@ -0,0 +1,9 @@
package core.game.content.global.action;
import core.game.node.entity.player.Player;
interface LadderAchievementCheck {
default void checkAchievement(Player player) {
return;
}
}
@@ -21,8 +21,8 @@ public enum SpecialLadders implements LadderAchievementCheck {
INTRO_LEAVE(Location.create(2522, 4999, 0),Location.create(3230, 3240, 0)), INTRO_LEAVE(Location.create(2522, 4999, 0),Location.create(3230, 3240, 0)),
JATIZSO_MINE_UP(Location.create(2406,10188,0),Location.create(2397, 3811, 0)), JATIZSO_MINE_UP(Location.create(2406,10188,0),Location.create(2397, 3811, 0)),
JATIZSO_MINE_DOWN(Location.create(2397, 3812, 0), Location.create(2405, 10188, 0)), JATIZSO_MINE_DOWN(Location.create(2397, 3812, 0), Location.create(2405, 10188, 0)),
JATIZSO_TOWER_UP(Location.create(2373, 3800, 2),Location.create(2374, 3800, 0)), JATIZSO_SHOUT_TOWER_UP(Location.create(2373, 3800, 2),Location.create(2374, 3800, 0)),
JATIZSO_TOWER_DOWN(Location.create(2373, 3800, 0),Location.create(2374, 3800, 2)), JATIZSO_SHOUT_TOWER_DOWN(Location.create(2373, 3800, 0),Location.create(2374, 3800, 2)),
DRAYNOR_SEWER_SOUTHEAST_DOWN(new Location(3118, 3244, 0), new Location(3118, 9643, 0)), DRAYNOR_SEWER_SOUTHEAST_DOWN(new Location(3118, 3244, 0), new Location(3118, 9643, 0)),
DRAYNOR_SEWER_SOUTHEAST_UP(new Location(3118, 9643, 0), new Location(3118, 3243, 0)), DRAYNOR_SEWER_SOUTHEAST_UP(new Location(3118, 9643, 0), new Location(3118, 3243, 0)),
@@ -77,10 +77,4 @@ public enum SpecialLadders implements LadderAchievementCheck {
return ladderMap.get(loc); return ladderMap.get(loc);
} }
}
interface LadderAchievementCheck {
default void checkAchievement(Player player) {
return;
}
} }
+11
View File
@@ -4,6 +4,7 @@ import core.cache.def.impl.ItemDefinition
import core.cache.def.impl.SceneryDefinition import core.cache.def.impl.SceneryDefinition
import core.game.component.Component import core.game.component.Component
import core.game.content.dialogue.FacialExpression import core.game.content.dialogue.FacialExpression
import core.game.content.global.action.SpecialLadders
import core.game.node.Node import core.game.node.Node
import core.game.node.`object`.Scenery import core.game.node.`object`.Scenery
import core.game.node.`object`.SceneryBuilder import core.game.node.`object`.SceneryBuilder
@@ -1125,4 +1126,14 @@ object ContentAPI {
fun animateInterface(player: Player, iface: Int, child: Int, anim: Int){ fun animateInterface(player: Player, iface: Int, child: Int, anim: Int){
player.packetDispatch.sendAnimationInterface(anim,iface,child) player.packetDispatch.sendAnimationInterface(anim,iface,child)
} }
/**
* Adds a climb destination to the ladder handler.
* @param ladderLoc the location of the ladder/stairs object you want to climb.
* @param dest the destination for the climb.
*/
@JvmStatic
fun addClimbDest(ladderLoc: Location, dest: Location){
SpecialLadders.add(ladderLoc,dest)
}
} }
@@ -1,4 +1,4 @@
package rs09.game.content.dialogue.area.jatizso package rs09.game.content.dialogue.region.jatizso
import core.game.content.dialogue.DialoguePlugin import core.game.content.dialogue.DialoguePlugin
import core.game.content.dialogue.FacialExpression import core.game.content.dialogue.FacialExpression
@@ -1,4 +1,4 @@
package rs09.game.content.dialogue.area.jatizso package rs09.game.content.dialogue.region.jatizso
import core.game.content.dialogue.DialoguePlugin import core.game.content.dialogue.DialoguePlugin
import core.game.content.dialogue.FacialExpression import core.game.content.dialogue.FacialExpression
@@ -1,4 +1,4 @@
package rs09.game.content.dialogue.area.jatizso package rs09.game.content.dialogue.region.jatizso
import core.game.content.dialogue.DialoguePlugin import core.game.content.dialogue.DialoguePlugin
import core.game.content.dialogue.FacialExpression import core.game.content.dialogue.FacialExpression
@@ -1,4 +1,4 @@
package rs09.game.content.dialogue.area.jatizso package rs09.game.content.dialogue.region.jatizso
import api.DialUtils import api.DialUtils
import core.game.content.dialogue.FacialExpression import core.game.content.dialogue.FacialExpression
@@ -1,4 +1,4 @@
package rs09.game.content.dialogue.area.jatizso package rs09.game.content.dialogue.region.jatizso
import core.game.content.dialogue.DialoguePlugin import core.game.content.dialogue.DialoguePlugin
import core.game.content.dialogue.FacialExpression import core.game.content.dialogue.FacialExpression
@@ -1,4 +1,4 @@
package rs09.game.content.dialogue.area.jatizso package rs09.game.content.dialogue.region.jatizso
import core.game.content.dialogue.DialoguePlugin import core.game.content.dialogue.DialoguePlugin
import core.game.content.dialogue.FacialExpression import core.game.content.dialogue.FacialExpression
@@ -1,4 +1,4 @@
package rs09.game.content.dialogue.area.jatizso package rs09.game.content.dialogue.region.jatizso
import core.game.content.dialogue.DialoguePlugin import core.game.content.dialogue.DialoguePlugin
import core.game.content.dialogue.FacialExpression import core.game.content.dialogue.FacialExpression
@@ -1,6 +1,8 @@
package rs09.game.interaction.region.rellekka package rs09.game.interaction.region.rellekka
import api.ContentAPI import api.ContentAPI
import core.game.content.dialogue.FacialExpression
import core.game.content.global.action.SpecialLadders
import core.game.node.entity.npc.NPC import core.game.node.entity.npc.NPC
import core.game.node.entity.player.link.audio.Audio import core.game.node.entity.player.link.audio.Audio
import core.game.system.task.Pulse import core.game.system.task.Pulse
@@ -8,7 +10,7 @@ import core.game.world.map.Direction
import core.game.world.map.Location import core.game.world.map.Location
import core.game.world.map.zone.ZoneBorders import core.game.world.map.zone.ZoneBorders
import org.rs09.consts.NPCs import org.rs09.consts.NPCs
import rs09.game.content.dialogue.area.jatizso.LeftieRightieDialogue import rs09.game.content.dialogue.region.jatizso.LeftieRightieDialogue
import rs09.game.interaction.InteractionListener import rs09.game.interaction.InteractionListener
class JatizsoListeners : InteractionListener() { class JatizsoListeners : InteractionListener() {
@@ -18,6 +20,7 @@ class JatizsoListeners : InteractionListener() {
val SOUTH_GAE_ZONE = ZoneBorders(2411,3795,2414,3799) val SOUTH_GAE_ZONE = ZoneBorders(2411,3795,2414,3799)
val BELL = 21394 val BELL = 21394
val GUARDS = intArrayOf(NPCs.GUARD_5491, NPCs.GUARD_5492) val GUARDS = intArrayOf(NPCs.GUARD_5491, NPCs.GUARD_5492)
val KING_CHEST = intArrayOf(21299,21300)
val LINES = arrayOf( val LINES = arrayOf(
arrayOf( arrayOf(
"YOU WOULDN'T KNOW HOW TO FIGHT A TROLL IF IT CAME UP AND BIT YER ARM OFF", "YOU WOULDN'T KNOW HOW TO FIGHT A TROLL IF IT CAME UP AND BIT YER ARM OFF",
@@ -40,32 +43,32 @@ class JatizsoListeners : InteractionListener() {
if(NORTH_GATE_ZONE.insideBorder(player)){ if(NORTH_GATE_ZONE.insideBorder(player)){
if(node.id == GATES_CLOSED.first()){ if(node.id == GATES_CLOSED.first()){
val other = ContentAPI.getScenery(node.location.transform(1, 0, 0)) ?: return@on true val other = ContentAPI.getScenery(node.location.transform(1, 0, 0)) ?: return@on true
ContentAPI.replaceScenery(node.asScenery(), node.id + 1, 10, Direction.EAST) ContentAPI.replaceScenery(node.asScenery(), node.id + 1, -1, Direction.EAST)
ContentAPI.replaceScenery(other.asScenery(), other.id - 1, 10, Direction.NORTH_EAST) ContentAPI.replaceScenery(other.asScenery(), other.id - 1, -1, Direction.NORTH_EAST)
} else { } else {
val other = ContentAPI.getScenery(node.location.transform(-1, 0, 0)) ?: return@on true val other = ContentAPI.getScenery(node.location.transform(-1, 0, 0)) ?: return@on true
ContentAPI.replaceScenery(node.asScenery(), node.id + 1, 10, Direction.NORTH_EAST) ContentAPI.replaceScenery(node.asScenery(), node.id + 1, -1, Direction.NORTH_EAST)
ContentAPI.replaceScenery(other.asScenery(), other.id, 10, Direction.EAST) ContentAPI.replaceScenery(other.asScenery(), other.id, -1, Direction.EAST)
} }
} else if(WEST_GATE_ZONE.insideBorder(player)){ } else if(WEST_GATE_ZONE.insideBorder(player)){
if(node.id == GATES_CLOSED.first()){ if(node.id == GATES_CLOSED.first()){
val other = ContentAPI.getScenery(node.location.transform(0, 1, 0)) ?: return@on true val other = ContentAPI.getScenery(node.location.transform(0, 1, 0)) ?: return@on true
ContentAPI.replaceScenery(node.asScenery(), node.id + 1, 10, Direction.WEST) ContentAPI.replaceScenery(node.asScenery(), node.id + 1, -1, Direction.WEST)
ContentAPI.replaceScenery(other.asScenery(), other.id + 1, 10, Direction.NORTH) ContentAPI.replaceScenery(other.asScenery(), other.id + 1, -1, Direction.NORTH)
} else { } else {
val other = ContentAPI.getScenery(node.location.transform(0, -1, 0)) ?: return@on true val other = ContentAPI.getScenery(node.location.transform(0, -1, 0)) ?: return@on true
ContentAPI.replaceScenery(node.asScenery(), node.id + 1, 10, Direction.NORTH) ContentAPI.replaceScenery(node.asScenery(), node.id + 1, -1, Direction.NORTH)
ContentAPI.replaceScenery(other.asScenery(), other.id + 1, 10, Direction.WEST) ContentAPI.replaceScenery(other.asScenery(), other.id + 1, -1, Direction.WEST)
} }
} else if(SOUTH_GAE_ZONE.insideBorder(player)){ } else if(SOUTH_GAE_ZONE.insideBorder(player)){
if(node.id == GATES_CLOSED.first()){ if(node.id == GATES_CLOSED.first()){
val other = ContentAPI.getScenery(node.location.transform(-1, 0, 0)) ?: return@on true val other = ContentAPI.getScenery(node.location.transform(-1, 0, 0)) ?: return@on true
ContentAPI.replaceScenery(node.asScenery(), node.id + 1, 10, Direction.SOUTH) ContentAPI.replaceScenery(node.asScenery(), node.id + 1, -1, Direction.SOUTH)
ContentAPI.replaceScenery(other.asScenery(), other.id - 1, 10, Direction.EAST) ContentAPI.replaceScenery(other.asScenery(), other.id - 1, -1, Direction.EAST)
} else { } else {
val other = ContentAPI.getScenery(node.location.transform(1, 0, 0)) ?: return@on true val other = ContentAPI.getScenery(node.location.transform(1, 0, 0)) ?: return@on true
ContentAPI.replaceScenery(node.asScenery(), node.id + 1, 10, Direction.EAST) ContentAPI.replaceScenery(node.asScenery(), node.id + 1, -1, Direction.EAST)
ContentAPI.replaceScenery(other.asScenery(), other.id, 10, Direction.SOUTH) ContentAPI.replaceScenery(other.asScenery(), other.id, -1, Direction.SOUTH)
} }
} }
ContentAPI.playAudio(player, ContentAPI.getAudio(81)) ContentAPI.playAudio(player, ContentAPI.getAudio(81))
@@ -128,8 +131,23 @@ class JatizsoListeners : InteractionListener() {
return@on true return@on true
} }
on(KING_CHEST, SCENERY, "open"){player, node ->
ContentAPI.sendPlayerDialogue(player, "I probably shouldn't mess with that.", FacialExpression.HALF_THINKING)
return@on true
}
setDest(NPC, NPCs.MAGNUS_GRAM_5488){_ -> setDest(NPC, NPCs.MAGNUS_GRAM_5488){_ ->
return@setDest Location.create(2416, 3801, 0) return@setDest Location.create(2416, 3801, 0)
} }
//Climb handling for the ladders in the towers around the city walls.
ContentAPI.addClimbDest(Location.create(2388, 3804, 0),Location.create(2387, 3804, 2))
ContentAPI.addClimbDest(Location.create(2388, 3804, 2),Location.create(2387, 3804, 0))
ContentAPI.addClimbDest(Location.create(2388, 3793, 0),Location.create(2387, 3793, 2))
ContentAPI.addClimbDest(Location.create(2388, 3793, 2),Location.create(2387, 3793, 0))
ContentAPI.addClimbDest(Location.create(2410, 3823, 0),Location.create(2410, 3824, 2))
ContentAPI.addClimbDest(Location.create(2410, 3823, 2),Location.create(2410, 3824, 0))
ContentAPI.addClimbDest(Location.create(2421, 3823, 0),Location.create(2421, 3824, 2))
ContentAPI.addClimbDest(Location.create(2421, 3823, 2),Location.create(2421, 3824, 0))
} }
} }
@@ -11,15 +11,19 @@ object PacketWriteQueue {
@JvmStatic @JvmStatic
fun <T> handle(packet: OutgoingPacket<T>, context: T){ fun <T> handle(packet: OutgoingPacket<T>, context: T){
when(packet){ when(packet){
//Dynamic packets need to be sent immediately
is UpdateSceneGraph, is UpdateSceneGraph,
is BuildDynamicScene, is BuildDynamicScene,
is InstancedLocationUpdate -> packet.send(context) is InstancedLocationUpdate,
is ClearRegionChunk -> packet.send(context)
//Rest get queued up and sent at the end of the tick (authentic)
else -> queue(packet,context) else -> queue(packet,context)
} }
} }
@JvmStatic @JvmStatic
fun <T> queue(packet: OutgoingPacket<T>, context: T){ fun <T> queue(packet: OutgoingPacket<T>, context: T){
SystemLogger.logInfo("Queueing ${packet.javaClass.simpleName}")
PacketsToWrite.add(QueuedPacket(packet,context)) PacketsToWrite.add(QueuedPacket(packet,context))
} }