Rewrote some Varrock plugins

Removed duplicated handlers for many Varrock related stairs and ladders
Fixed the Champions' Guild trapdoor being unable to be closed
Changed the model ID for the logs outside of Seth Groats's house when the axe is taken
The drawers in Guidor's house will no longer disappear. There doesn't appear to be a related open object, so they just won't open
The Benny NPC yells about newspapers again
Knocking on the door in the Varrock bank will start the dialogue with the bankers
The Varrock Census object in the Varrock castle will now open the Varrock Census interface
Added sounds for opening/closing drawers, wardrobes, and cupboards and animations for wardrobes
Added the Kudos overlay in the Varrock Museum
Corrected the spawns for archeologists in the Varrock Museum dig site area
Implemented the Varrock museum map interface to open from the objects and item
The tool shelf in the museum dig site area will now give items
Looking at the displays in the in the Natural History area of the museum will open the interface for the exam and provided some notes
This commit is contained in:
Bonesy
2024-10-06 13:12:33 +00:00
committed by Ryan
parent 3982258500
commit cc8dd4edb4
26 changed files with 612 additions and 808 deletions
@@ -114,7 +114,6 @@ class ChampionChallengeListener : InteractionListener, MapArea {
)
private val PORTCULLIS = Scenery.PORTCULLIS_10553
private val LADDER = Scenery.LADDER_10554
private val CHAMPION_STATUE_CLOSED = Scenery.CHAMPION_STATUE_10556
private val CHAMPION_STATUE_OPEN = Scenery.CHAMPION_STATUE_10557
private val TRAPDOOR_CLOSED = Scenery.TRAPDOOR_10558
@@ -124,6 +123,13 @@ class ChampionChallengeListener : InteractionListener, MapArea {
private val ARENA_ZONE = 12696
override fun defineListeners() {
// Champion's Guild Basement Ladder to Main Floor
addClimbDest(Location(3190, 9758, 0), Location(3190, 3356, 0))
// Champion Statue Ladder to Arena
addClimbDest(Location(3184, 9758, 0), Location(3182, 9758, 0))
// Arena Ladder to Champion's Guild Basement
addClimbDest(Location(3183, 9758, 0), Location(3185, 9758, 0))
on(LARXUS, IntType.NPC, "talk-to") { player, _ ->
openDialogue(player, LarxusDialogue(false))
return@on true
@@ -134,18 +140,18 @@ class ChampionChallengeListener : InteractionListener, MapArea {
return@on true
}
on(TRAPDOOR_CLOSED, IntType.SCENERY, "open") { _, node ->
replaceScenery(node.asScenery(), TRAPDOOR_OPEN, 100, node.location)
return@on true
}
onUseWith(IntType.NPC, ChampionScrollsDropHandler.SCROLLS, NPCs.LARXUS_3050) { player, _, _ ->
openDialogue(player, LarxusDialogue(true))
return@onUseWith true
}
on(TRAPDOOR_CLOSED, IntType.SCENERY, "open") { _, node ->
replaceScenery(node.asScenery(), TRAPDOOR_OPEN, 100, node.location)
return@on true
}
on(TRAPDOOR_OPEN, IntType.SCENERY, "close") { _, node ->
replaceScenery(node.asScenery(), TRAPDOOR_CLOSED, 100, node.location)
replaceScenery(node.asScenery(), TRAPDOOR_CLOSED, -1, node.location)
return@on true
}
@@ -154,15 +160,6 @@ class ChampionChallengeListener : InteractionListener, MapArea {
return@on true
}
on(LADDER, IntType.SCENERY, "climb-up") { player, _ ->
teleport(player, Location.create(3185, 9758, 0))
return@on true
}
on(CHAMPION_STATUE_OPEN, IntType.SCENERY, "climb-down") { player, _ ->
teleport(player, Location.create(3182, 9758, 0))
return@on true
}
on(PORTCULLIS, IntType.SCENERY, "open") { player, node ->
if (player.getAttribute("championsarena:start", false) == false) {
sendNPCDialogue(player, NPCs.LARXUS_3050, "You need to arrange a challenge with me before you enter the arena.")
@@ -229,4 +226,4 @@ class ChampionChallengeListener : InteractionListener, MapArea {
ZoneRestriction.RANDOM_EVENTS
)
}
}
}
@@ -1,39 +0,0 @@
package content.global.handlers.scenery;
import core.cache.def.impl.SceneryDefinition;
import core.game.interaction.OptionHandler;
import core.game.node.Node;
import core.game.node.entity.player.Player;
import core.game.node.item.Item;
import core.plugin.Initializable;
import core.plugin.Plugin;
/**
* Represents the doogle leaf plugin for this object.
* @author 'Vexia
* @version 1.0
*/
public class DoogleLeafPlugin extends OptionHandler {
/**
* Represents the leaf item.
*/
private static final Item LEAF = new Item(1573, 1);
@Override
public Plugin<Object> newInstance(Object arg) throws Throwable {
SceneryDefinition.forId(31155).getHandlers().put("option:pick-leaf", this);
return this;
}
@Override
public boolean handle(Player player, Node node, String option) {
if (!player.getInventory().add(LEAF)) {
player.getPacketDispatch().sendMessage("You don't have have enough space in your inventory.");
} else {
player.getPacketDispatch().sendMessage("You pick some doogle leaves.");
}
return true;
}
}
@@ -11,6 +11,9 @@ import core.game.world.map.Location;
import core.game.world.map.RegionManager;
import core.plugin.Initializable;
import core.plugin.Plugin;
import org.rs09.consts.Sounds;
import static core.api.ContentAPIKt.*;
/**
* Plugin used for handling the opening/closing of (double)
@@ -39,6 +42,14 @@ public final class DoorManagingPlugin extends OptionHandler {
if (name.contains("drawers") || name.contains("wardrobe") || name.contains("cupboard")) {
switch(option) {
case "open":
if (name.contains("drawers")) {
playAudio(player, Sounds.DRAWER_OPEN_64);
} else if (name.contains("wardrobe")) {
animate(player, 545, false);
playAudio(player, Sounds.WARDROBE_OPEN_96);
} else if (name.contains("cupboard")) {
playAudio(player, Sounds.CUPBOARD_OPEN_58);
}
case "go-through":
if (object.isActive()) {
SceneryBuilder.replace(object, object.transform(object.getId() + 1), 80);
@@ -46,6 +57,14 @@ public final class DoorManagingPlugin extends OptionHandler {
return true;
case "close":
case "shut":
if (name.contains("drawers")) {
playAudio(player, Sounds.DRAWER_CLOSE_63);
} else if (name.contains("wardrobe")) {
animate(player, 544, false);
playAudio(player, Sounds.WARDROBE_CLOSE_95);
} else if (name.contains("cupboard")) {
playAudio(player, Sounds.CUPBOARD_CLOSE_57);
}
SceneryBuilder.replace(object, object.transform(object.getId() - 1));
return true;
}
@@ -23,6 +23,8 @@ public final class LadderManagingPlugin extends OptionHandler {
SceneryDefinition.setOptionHandler("climb-up", this);
SceneryDefinition.setOptionHandler("climb-down", this);
SceneryDefinition.setOptionHandler("climb", this);
SceneryDefinition.setOptionHandler("walk-up", this);
SceneryDefinition.setOptionHandler("walk-down", this);
return this;
}