diff --git a/Server/data/configs/door_configs.json b/Server/data/configs/door_configs.json index 5220efcdb..3f2bb4890 100644 --- a/Server/data/configs/door_configs.json +++ b/Server/data/configs/door_configs.json @@ -193,7 +193,7 @@ }, { "id": "1553", - "replaceId": "1552", + "replaceId": "1556", "fence": "true", "metal": "false" }, @@ -332,13 +332,13 @@ { "id": "2050", "replaceId": "15511", - "fence": "false", + "fence": "true", "metal": "false" }, { "id": "2051", "replaceId": "15513", - "fence": "false", + "fence": "true", "metal": "false" }, { @@ -1238,12 +1238,12 @@ { "id": "7049", "replaceId": "7051", - "fence": "false", + "fence": "true", "metal": "false" }, { "id": "7050", - "replaceId": "23919", + "replaceId": "7052", "fence": "true", "metal": "false" }, @@ -1340,7 +1340,7 @@ { "id": "8810", "replaceId": "8812", - "fence": "false", + "fence": "true", "metal": "false" }, { @@ -2367,11 +2367,25 @@ "fence": "false", "metal": "true" }, + { + "id": "26081", + "replaceId": "26083", + "fence": "false", + "metal": "true", + "autowalk": "true" + }, + { + "id": "26082", + "replaceId": "26084", + "fence": "false", + "metal": "true", + "autowalk": "true" + }, { "id": "26130", "replaceId": "26132", "fence": "false", - "metal": "false" + "metal": "true" }, { "id": "26131", @@ -2802,7 +2816,7 @@ { "id": "34780", "replaceId": "34778", - "fence": "false", + "fence": "true", "metal": "false" }, { diff --git a/Server/data/configs/music_configs.json b/Server/data/configs/music_configs.json index 876c1e648..336820da0 100644 --- a/Server/data/configs/music_configs.json +++ b/Server/data/configs/music_configs.json @@ -873,15 +873,15 @@ }, { "id": "289", - "borders": "{2560,3648,2623,3711}" + "borders": "{2563,3647,2687,3776}" }, { "id": "290", - "borders": "{2560,3584,2623,3647}" + "borders": "{2560,3584,2689,3647}" }, { "id": "291", - "borders": "{2688,3648,2751,3711}" + "borders": "{2688,3648,2751,3776}" }, { "id": "292", diff --git a/Server/src/main/content/global/handlers/iface/GlassInterface.java b/Server/src/main/content/global/handlers/iface/GlassInterface.java index eedf8158d..dd515ce37 100644 --- a/Server/src/main/content/global/handlers/iface/GlassInterface.java +++ b/Server/src/main/content/global/handlers/iface/GlassInterface.java @@ -13,6 +13,7 @@ import core.game.world.update.flag.context.Animation; import core.plugin.Initializable; import core.plugin.Plugin; import kotlin.Unit; +import org.rs09.consts.Sounds; /** * Represents the glass making interface plugin. @@ -105,6 +106,7 @@ public final class GlassInterface extends ComponentPlugin { return true; } player.animate(ANIMATION); + player.getAudioManager().send(Sounds.GLASSBLOWING_2724); player.getInventory().remove(MOLTEN_GLASS); player.getInventory().add(new Item(glass.getProduct(), 1)); player.getSkills().addExperience(Skills.CRAFTING, glass.getExperience(), true); diff --git a/Server/src/main/content/global/handlers/item/EmptyOptionPlugin.java b/Server/src/main/content/global/handlers/item/EmptyOptionPlugin.java index bb5f01f65..7e5514ff5 100644 --- a/Server/src/main/content/global/handlers/item/EmptyOptionPlugin.java +++ b/Server/src/main/content/global/handlers/item/EmptyOptionPlugin.java @@ -7,6 +7,7 @@ import core.game.node.entity.player.Player; import core.game.node.item.Item; import core.plugin.Initializable; import core.plugin.Plugin; +import org.rs09.consts.Sounds; import java.util.HashMap; @@ -28,6 +29,7 @@ public final class EmptyOptionPlugin extends OptionHandler { } if(EmptyItem.emptyItemMap.get(node.getId()) != null){ player.getInventory().remove(node.asItem()); + player.getAudioManager().send(Sounds.LIQUID_2401, 1); player.getInventory().add(EmptyItem.getEmpty(node.getId())); player.getPacketDispatch().sendMessage(EmptyItem.getEmptyMessage(node.getId())); } else { diff --git a/Server/src/main/content/global/handlers/item/withobject/AmmoMouldOnFurnace.kt b/Server/src/main/content/global/handlers/item/withobject/AmmoMouldOnFurnace.kt index 837d1f774..3ac1f9c45 100644 --- a/Server/src/main/content/global/handlers/item/withobject/AmmoMouldOnFurnace.kt +++ b/Server/src/main/content/global/handlers/item/withobject/AmmoMouldOnFurnace.kt @@ -10,6 +10,7 @@ import org.rs09.consts.Items import core.game.dialogue.SkillDialogueHandler import core.game.interaction.InteractionListener import core.game.interaction.IntType +import org.rs09.consts.Sounds class AmmoMouldOnFurnace : InteractionListener { private val furnaces = intArrayOf(4304, 6189, 11010, 11666, 12100, 12809, 18497, 26814, 30021, 30510, 36956, 37651) // abstract when smelting converted to kotlin @@ -39,6 +40,7 @@ class AmmoMouldOnFurnace : InteractionListener { 0 -> { sendMessage(player,"You heat the steel bar into a liquid state.") animate(player, 3243) // 899 would be preferable but the arms spaz out + player.audioManager.send(Sounds.FURNACE_2725, 1) } 3 -> { sendMessage(player,"You pour the molten metal into your cannonball mould.") diff --git a/Server/src/main/content/global/handlers/item/withobject/WaterSourceListener.kt b/Server/src/main/content/global/handlers/item/withobject/WaterSourceListener.kt index 65dc83bad..6bcbc3148 100644 --- a/Server/src/main/content/global/handlers/item/withobject/WaterSourceListener.kt +++ b/Server/src/main/content/global/handlers/item/withobject/WaterSourceListener.kt @@ -7,6 +7,7 @@ import core.game.world.update.flag.context.Animation import org.rs09.consts.Items import core.game.interaction.InteractionListener import core.game.interaction.IntType +import org.rs09.consts.Sounds /** * Handles filling most water sources. @@ -44,6 +45,13 @@ class WaterSourceListener : InteractionListener { animate(player, animation) sendMessage(player, formatMsgText(used.name, vessel.fillMsg)) addItemOrDrop(player, vessel.output) + if(with.name.contains("well", ignoreCase = true)) { + playAudio(player, getAudio(Sounds.WELL_FILL_2615, 1)) + } + else { + playAudio(player, getAudio(Sounds.TAP_FILL_2609, 1)) + } + } return !vessel.autofill || amountInInventory(player, used.id) == 0 } diff --git a/Server/src/main/content/global/handlers/npc/CowMilkingPlugin.java b/Server/src/main/content/global/handlers/npc/CowMilkingPlugin.java index 452c809bd..822b050de 100644 --- a/Server/src/main/content/global/handlers/npc/CowMilkingPlugin.java +++ b/Server/src/main/content/global/handlers/npc/CowMilkingPlugin.java @@ -13,6 +13,7 @@ import core.game.world.update.flag.context.Animation; import core.plugin.Plugin; import core.plugin.Initializable; import core.plugin.ClassScanner; +import org.rs09.consts.Sounds; /** * Represents the plugin used to milk a cow. @@ -55,6 +56,7 @@ public final class CowMilkingPlugin extends OptionHandler { } player.animate(ANIMATION); + player.getAudioManager().send(Sounds.MILK_COW_372); player.getPulseManager().run(new Pulse(8, player) { @Override public boolean pulse() { diff --git a/Server/src/main/content/global/skill/herblore/HerbCleanPlugin.java b/Server/src/main/content/global/skill/herblore/HerbCleanPlugin.java index 5a7ff46d2..62d8c9ec3 100644 --- a/Server/src/main/content/global/skill/herblore/HerbCleanPlugin.java +++ b/Server/src/main/content/global/skill/herblore/HerbCleanPlugin.java @@ -19,7 +19,6 @@ import core.tools.RandomFunction; */ @Initializable public final class HerbCleanPlugin extends OptionHandler { - private static final int[] SFX_IDS = new int[] { 5153, 5155, 5157 }; @Override public Plugin newInstance(Object arg) throws Throwable { @@ -42,7 +41,7 @@ public final class HerbCleanPlugin extends OptionHandler { if (removeItem(player, node.asItem(), Container.INVENTORY)){ player.getSkills().addExperience(Skills.HERBLORE, exp, true); addItem(player, herb.getProduct().getId(), 1, Container.INVENTORY); - player.getAudioManager().send(SFX_IDS[RandomFunction.random(SFX_IDS.length)], 1); + player.getAudioManager().send(5153, 1); player.getPacketDispatch().sendMessage("You clean the dirt from the " + herb.getProduct().getName().toLowerCase().replace("clean", "").trim() + " leaf."); } player.lock(1); diff --git a/Server/src/main/content/global/skill/smithing/smelting/SmeltingPulse.java b/Server/src/main/content/global/skill/smithing/smelting/SmeltingPulse.java index c1dd2e570..f483a72b7 100644 --- a/Server/src/main/content/global/skill/smithing/smelting/SmeltingPulse.java +++ b/Server/src/main/content/global/skill/smithing/smelting/SmeltingPulse.java @@ -15,6 +15,7 @@ import core.game.world.update.flag.context.Animation; import core.game.world.update.flag.context.Graphics; import core.tools.RandomFunction; import core.tools.StringUtils; +import org.rs09.consts.Sounds; /** * Represents the pulse used to smelt. @@ -110,6 +111,7 @@ public class SmeltingPulse extends SkillPulse { player.visualize(Animation.create(725), new Graphics(148, 96)); } else { player.animate(Animation.create(3243)); // Used to be 899 but that looked wonky and broken + player.getAudioManager().send(Sounds.FURNACE_2725, 1); } } } diff --git a/Server/src/main/content/global/travel/ship/SeamanDialoguePlugin.java b/Server/src/main/content/global/travel/ship/SeamanDialoguePlugin.java index 0ed7ad2c6..f7782c200 100644 --- a/Server/src/main/content/global/travel/ship/SeamanDialoguePlugin.java +++ b/Server/src/main/content/global/travel/ship/SeamanDialoguePlugin.java @@ -10,6 +10,8 @@ import core.game.node.entity.player.Player; import core.game.node.entity.player.link.diary.DiaryType; import core.game.node.item.Item; +import static core.api.ContentAPIKt.*; + /** * Represents the dialogue used to handle the sailing from and to karamja. * @@ -148,6 +150,7 @@ public class SeamanDialoguePlugin extends DialoguePlugin { public void travel() { end(); Ships.PORT_SARIM_TO_KARAMAJA.sail(player); + playJingle(player, 172); } @Override diff --git a/Server/src/main/content/global/travel/ship/ShipCharter.java b/Server/src/main/content/global/travel/ship/ShipCharter.java index e549502b4..99121e375 100644 --- a/Server/src/main/content/global/travel/ship/ShipCharter.java +++ b/Server/src/main/content/global/travel/ship/ShipCharter.java @@ -16,7 +16,7 @@ import core.tools.StringUtils; import java.util.ArrayList; import java.util.List; -import static core.api.ContentAPIKt.requireQuest; +import static core.api.ContentAPIKt.*; /** * Represents a class used to charter ships. @@ -341,6 +341,7 @@ public final class ShipCharter { */ public void sail(final Player player) { player.lock(7); + playJingle(player, 171); Location start = player.getLocation(); GameWorld.getPulser().submit(new Pulse(1) { int count = 0; diff --git a/Server/src/main/content/minigame/pestcontrol/PestControlSquire.java b/Server/src/main/content/minigame/pestcontrol/PestControlSquire.java index d18ffd880..d0e773218 100644 --- a/Server/src/main/content/minigame/pestcontrol/PestControlSquire.java +++ b/Server/src/main/content/minigame/pestcontrol/PestControlSquire.java @@ -8,6 +8,8 @@ import core.game.node.entity.npc.NPC; import core.game.node.entity.player.Player; import core.plugin.Plugin; +import static core.api.ContentAPIKt.*; + /** * Handles a pest control squire's options. * @author Emperor @@ -38,6 +40,7 @@ public final class PestControlSquire extends OptionHandler { case "leave": if (session == null) { Ships.PEST_TO_PORT_SARIM.sail(player); + playJingle(player, 172); return true; } player.getProperties().setTeleportLocation(session.getActivity().getLeaveLocation()); diff --git a/Server/src/main/content/minigame/pestcontrol/SquireDialogue.java b/Server/src/main/content/minigame/pestcontrol/SquireDialogue.java index f5afd6425..f4a7c7773 100644 --- a/Server/src/main/content/minigame/pestcontrol/SquireDialogue.java +++ b/Server/src/main/content/minigame/pestcontrol/SquireDialogue.java @@ -7,6 +7,8 @@ import core.game.node.entity.npc.NPC; import core.plugin.Initializable; import core.game.node.entity.player.Player; +import static core.api.ContentAPIKt.*; + /** * Handles the SquireDialogue dialogue. * @author 'Vexia @@ -94,6 +96,7 @@ public class SquireDialogue extends DialoguePlugin { case 503: end(); Ships.PEST_TO_PORT_SARIM.sail(player); + playJingle(player, 172); break; case 1: switch (buttonId) { @@ -157,6 +160,7 @@ public class SquireDialogue extends DialoguePlugin { case 24: end(); Ships.PORT_SARIM_TO_PEST_CONTROL.sail(player); + playJingle(player, 172); break; case 200: end(); diff --git a/Server/src/main/content/region/asgarnia/portsarim/dialogue/MonkOfEntranaDialogue.java b/Server/src/main/content/region/asgarnia/portsarim/dialogue/MonkOfEntranaDialogue.java index 8b586b36f..87842b4c6 100644 --- a/Server/src/main/content/region/asgarnia/portsarim/dialogue/MonkOfEntranaDialogue.java +++ b/Server/src/main/content/region/asgarnia/portsarim/dialogue/MonkOfEntranaDialogue.java @@ -9,6 +9,8 @@ import core.game.node.entity.player.link.diary.DiaryType; import core.plugin.Initializable; import core.game.node.entity.player.Player; +import static core.api.ContentAPIKt.*; + /** * Represents the dialogue plugin used for the monk of entrana dialogue. * @author 'Vexia @@ -105,6 +107,7 @@ public final class MonkOfEntranaDialogue extends DialoguePlugin { case 25: end(); Ships.PORT_SARIM_TO_ENTRANA.sail(player); + playJingle(player, 172); if (!player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR).isComplete(0, 14)) { player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR).updateTask(player, 0, 14, true); } @@ -132,6 +135,7 @@ public final class MonkOfEntranaDialogue extends DialoguePlugin { case 511: end(); Ships.ENTRANA_TO_PORT_SARIM.sail(player); + playJingle(player, 172); break; case 520: end(); diff --git a/Server/src/main/content/region/desert/dialogue/RugMerchantDialogue.java b/Server/src/main/content/region/desert/dialogue/RugMerchantDialogue.java index 5e9c47995..3f02ee3db 100644 --- a/Server/src/main/content/region/desert/dialogue/RugMerchantDialogue.java +++ b/Server/src/main/content/region/desert/dialogue/RugMerchantDialogue.java @@ -22,7 +22,7 @@ import core.game.world.update.flag.context.Animation; import core.plugin.Plugin; import core.plugin.ClassScanner; import org.rs09.consts.Items; - +import org.rs09.consts.Sounds; /** @@ -295,6 +295,8 @@ public final class RugMerchantDialogue extends DialoguePlugin { player.getInterfaceManager().removeTabs(0,1,2,3,4,5,6,7,8,9,10,11,12,13); player.getEquipment().replace(new Item(Items.MAGIC_CARPET_5614),EquipmentContainer.SLOT_WEAPON); player.getPacketDispatch().sendInterfaceConfig(548,69,true); + player.getAudioManager().send(Sounds.CARPET_RISE_1196); + playJingle(player, 132); registerLogoutListener(player, "magic-carpet", (pl) -> { removeItem(pl, Items.MAGIC_CARPET_5614, Container.EQUIPMENT); @@ -340,6 +342,7 @@ public final class RugMerchantDialogue extends DialoguePlugin { player.unlock(); player.animate(new Animation(-1)); setVarp(player, 499, 0); + player.getAudioManager().send(Sounds.CARPET_DESCEND_1195); clearLogoutListener(player, "magic-carpet"); diff --git a/Server/src/main/content/region/desert/handlers/DesertZone.java b/Server/src/main/content/region/desert/handlers/DesertZone.java index c761fa198..3701c0213 100644 --- a/Server/src/main/content/region/desert/handlers/DesertZone.java +++ b/Server/src/main/content/region/desert/handlers/DesertZone.java @@ -17,6 +17,7 @@ import core.game.world.update.flag.context.Animation; import core.plugin.Plugin; import core.plugin.Initializable; import core.tools.RandomFunction; +import org.rs09.consts.Sounds; /** * The desert zone map. @@ -104,6 +105,7 @@ public final class DesertZone extends MapZone implements Plugin { p.getInventory().add(new Item(i.getId() + 2)); p.animate(ANIMATION); p.getPacketDispatch().sendMessage("You take a drink of water."); + p.getAudioManager().send(Sounds.LIQUID_2401, 1); return true; } } diff --git a/Server/src/main/content/region/fremennik/rellekka/handlers/RellekkaListeners.kt b/Server/src/main/content/region/fremennik/rellekka/handlers/RellekkaListeners.kt index 92f0a0ce1..33fc0d94f 100644 --- a/Server/src/main/content/region/fremennik/rellekka/handlers/RellekkaListeners.kt +++ b/Server/src/main/content/region/fremennik/rellekka/handlers/RellekkaListeners.kt @@ -1,10 +1,10 @@ package content.region.fremennik.rellekka.handlers import core.api.* +import core.game.interaction.IntType +import core.game.interaction.InteractionListener import core.game.world.map.Location import org.rs09.consts.NPCs -import core.game.interaction.InteractionListener -import core.game.interaction.IntType /** * File to be used for anything Rellekka related. @@ -51,11 +51,13 @@ class RellekkaListeners : InteractionListener { if (!hasRequirement(player, "Fremennik Trials")) return@on true RellekkaUtils.sail(player, RellekkaDestination.RELLEKKA_TO_NEITIZNOT) + playJingle(player, 171) return@on true } on(NPCs.MARIA_GUNNARS_5507, IntType.NPC, "ferry-rellekka"){ player, node -> RellekkaUtils.sail(player, RellekkaDestination.NEITIZNOT_TO_RELLEKKA) + playJingle(player, 171) return@on true } @@ -63,11 +65,13 @@ class RellekkaListeners : InteractionListener { if (!hasRequirement(player, "Fremennik Trials")) return@on true RellekkaUtils.sail(player, RellekkaDestination.RELLEKKA_TO_JATIZSO) + playJingle(player, 171) return@on true } on(NPCs.MORD_GUNNARS_5482, IntType.NPC, "ferry-rellekka"){ player, node -> RellekkaUtils.sail(player, RellekkaDestination.JATIZSO_TO_RELLEKKA) + playJingle(player, 171) return@on true } } diff --git a/Server/src/main/content/region/kandarin/ardougne/dialogue/CaptainBarnabyDialogue.java b/Server/src/main/content/region/kandarin/ardougne/dialogue/CaptainBarnabyDialogue.java index cea30040b..8539a1ea3 100644 --- a/Server/src/main/content/region/kandarin/ardougne/dialogue/CaptainBarnabyDialogue.java +++ b/Server/src/main/content/region/kandarin/ardougne/dialogue/CaptainBarnabyDialogue.java @@ -8,6 +8,8 @@ import core.game.node.entity.player.Player; import core.plugin.Initializable; import core.game.node.item.Item; +import static core.api.ContentAPIKt.*; + /** * Represents the captain barnaby dialogue plugin. * @author 'Vexia @@ -82,6 +84,7 @@ public final class CaptainBarnabyDialogue extends DialoguePlugin { if (player.getInventory().remove(COINS)) { end(); player.getPacketDispatch().sendMessage("You pay 30 coins and board the ship."); + playJingle(player, 171); Ships.ARDOUGNE_TO_BRIMHAVEN.sail(player); } break; diff --git a/Server/src/main/content/region/karamja/dialogue/CustomsOfficerDialogue.java b/Server/src/main/content/region/karamja/dialogue/CustomsOfficerDialogue.java index fbb999f17..164df698b 100644 --- a/Server/src/main/content/region/karamja/dialogue/CustomsOfficerDialogue.java +++ b/Server/src/main/content/region/karamja/dialogue/CustomsOfficerDialogue.java @@ -9,6 +9,8 @@ import core.game.node.item.Item; import core.plugin.Initializable; import core.game.world.map.Location; +import static core.api.ContentAPIKt.*; + /** * Represents the dialogue plugin used to handle the customs officer. * @author Vexia @@ -184,6 +186,11 @@ public final class CustomsOfficerDialogue extends DialoguePlugin { } player.getPacketDispatch().sendMessage("You pay " + getPrice() + " coins and board the ship."); ship.sail(player); + if(ship == Ships.BRIMHAVEN_TO_ARDOUGNE) { + playJingle(player, 171); + } else { + playJingle(player, 172); + } break; case 220: end(); diff --git a/Server/src/main/core/api/ContentAPI.kt b/Server/src/main/core/api/ContentAPI.kt index aabc95bcc..9c860eded 100644 --- a/Server/src/main/core/api/ContentAPI.kt +++ b/Server/src/main/core/api/ContentAPI.kt @@ -70,6 +70,9 @@ import core.tools.* import core.game.world.update.flag.* import core.game.world.update.flag.context.* import core.game.requirement.* +import core.net.packet.PacketRepository +import core.net.packet.context.MusicContext +import core.net.packet.out.MusicPacket import java.util.regex.* import java.io.* import kotlin.math.* @@ -553,6 +556,15 @@ fun getAudio(id: Int, volume: Int = 10, delay: Int = 1): Audio { return Audio(id, volume, delay) } +/** + * Plays a jingle by id + * @param player the player to play the jingle for + * @param jingleId the jingle to play + */ +fun playJingle(player: Player, jingleId: Int) { + PacketRepository.send(MusicPacket::class.java, MusicContext(player, jingleId, true)) +} + /** * Impact an enemy with the given amount of damage and the given hitsplat type * @param entity the entity to damage diff --git a/Server/src/main/core/game/global/action/DoorActionHandler.java b/Server/src/main/core/game/global/action/DoorActionHandler.java index dcbda6940..2766685e5 100644 --- a/Server/src/main/core/game/global/action/DoorActionHandler.java +++ b/Server/src/main/core/game/global/action/DoorActionHandler.java @@ -15,6 +15,7 @@ import core.game.world.map.path.Pathfinder; import kotlin.Unit; import core.game.system.config.DoorConfigLoader; import core.game.world.GameWorld; +import org.rs09.consts.Sounds; import static core.api.ContentAPIKt.hasRequirement; @@ -42,7 +43,14 @@ public final class DoorActionHandler { final Scenery second = (object.getId() == 1530 || object.getId() == 1531) ? null : getSecondDoor(object, player); Scenery o = null; if (object instanceof Constructed && (o = ((Constructed) object).getReplaced()) != null) { - player.getAudioManager().send(new Audio(43)); + DoorConfigLoader.Door d = DoorConfigLoader.Companion.forId(object.getId()); + if (d != null && d.isMetal()) { + player.getAudioManager().send(Sounds.IRON_DOOR_CLOSE_70); + } else if (d != null && d.isFence()){ + player.getAudioManager().send(Sounds.GATE_CLOSE_66); + } else { + player.getAudioManager().send(60); + } SceneryBuilder.replace(object, o); if (second instanceof Constructed && (o = ((Constructed) second).getReplaced()) != null) { SceneryBuilder.replace(second, o); @@ -53,11 +61,20 @@ public final class DoorActionHandler { if (object.getDefinition().hasAction("close")) { if (second != null) { player.getPacketDispatch().sendMessage("The doors appear to be stuck."); + player.getAudioManager().send(Sounds.DOOR_CREAK_61); return; } DoorConfigLoader.Door d = DoorConfigLoader.Companion.forId(object.getId()); + if (d != null && d.isMetal()) { + player.getAudioManager().send(Sounds.IRON_DOOR_OPEN_71); + } else if (d != null && d.isFence()){ + player.getAudioManager().send(Sounds.GATE_OPEN_67); + } else { + player.getAudioManager().send(Sounds.DOOR_OPEN_62); + } if (d == null) { player.getPacketDispatch().sendMessage("The door appears to be stuck."); + player.getAudioManager().send(Sounds.DOOR_CREAK_61); return; } int firstDir = (object.getRotation() + 3) % 4; @@ -76,9 +93,11 @@ public final class DoorActionHandler { return; } if (d.isMetal()) { - player.getAudioManager().send(new Audio(71)); + player.getAudioManager().send(Sounds.IRON_DOOR_OPEN_71); + } else if (d.isFence()){ + player.getAudioManager().send(Sounds.GATE_OPEN_67); } else { - player.getAudioManager().send(new Audio(81)); + player.getAudioManager().send(Sounds.DOOR_OPEN_62); } if (second != null) { DoorConfigLoader.Door s = DoorConfigLoader.Companion.forId(second.getId()); @@ -103,7 +122,17 @@ public final class DoorActionHandler { entity.lock(4); final Location loc = entity.getLocation(); if (entity instanceof Player) { - ((Player) entity).getAudioManager().send(new Audio(3419)); + DoorConfigLoader.Door d = DoorConfigLoader.Companion.forId(object.getId()); + if (d != null && d.isMetal()) { + ((Player) entity).getAudioManager().send(Sounds.IRON_DOOR_OPEN_71, 10); + ((Player) entity).getAudioManager().send(Sounds.IRON_DOOR_CLOSE_70, 10, 60); + } else if (d != null && d.isFence()){ + ((Player) entity).getAudioManager().send(Sounds.GATE_OPEN_67, 10); + ((Player) entity).getAudioManager().send(Sounds.GATE_CLOSE_66, 10, 60); + } else { + ((Player) entity).getAudioManager().send(Sounds.DOOR_OPEN_62,10); + ((Player) entity).getAudioManager().send(60,10,60); + } entity.asPlayer().logoutListeners.put("autowalk", player -> { player.setLocation(loc); return Unit.INSTANCE; diff --git a/Server/src/main/core/game/node/entity/player/link/music/MusicPlayer.java b/Server/src/main/core/game/node/entity/player/link/music/MusicPlayer.java index f77732802..b9874f71b 100644 --- a/Server/src/main/core/game/node/entity/player/link/music/MusicPlayer.java +++ b/Server/src/main/core/game/node/entity/player/link/music/MusicPlayer.java @@ -169,10 +169,12 @@ public final class MusicPlayer { * @param entry The song. */ public void play(MusicEntry entry) { - PacketRepository.send(MusicPacket.class, new MusicContext(player, entry.getId())); - PacketRepository.send(StringPacket.class, new StringContext(player, entry.getName() + (player.isDebug() ? (" (" + entry.getId() + ")") : ""), 187, 14)); - currentMusicId = entry.getId(); - playing = true; + if (!looping || currentMusicId == entry.getId()) { + PacketRepository.send(MusicPacket.class, new MusicContext(player, entry.getId())); + PacketRepository.send(StringPacket.class, new StringContext(player, entry.getName() + (player.isDebug() ? (" (" + entry.getId() + ")") : ""), 187, 14)); + currentMusicId = entry.getId(); + playing = true; + } } /** @@ -216,7 +218,7 @@ public final class MusicPlayer { if(GameWorld.getTicks() % 20 == 0){ if(!isPlaying()){ try { - play((MusicEntry) unlocked.values().toArray()[new Random().nextInt(unlocked.values().size())]); + PacketRepository.send(MusicPacket.class, new MusicContext(player, currentMusicId)); } catch (Exception e){} } } diff --git a/Server/src/main/core/game/system/config/DoorConfigLoader.kt b/Server/src/main/core/game/system/config/DoorConfigLoader.kt index cb8649d85..4839e713c 100644 --- a/Server/src/main/core/game/system/config/DoorConfigLoader.kt +++ b/Server/src/main/core/game/system/config/DoorConfigLoader.kt @@ -33,6 +33,13 @@ class DoorConfigLoader { door.isAutoWalk = e["autowalk"]?.toString()?.toBoolean() ?: false door.questRequirement = e["questRequirement"]?.toString() ?: "" DOORS[door.id] = door + val replacedDoor = Door(door.replaceId) + replacedDoor.replaceId = door.id + replacedDoor.isFence = door.isFence + replacedDoor.isMetal = door.isMetal + replacedDoor.isAutoWalk = door.isAutoWalk + replacedDoor.questRequirement = door.questRequirement + DOORS[door.replaceId] = replacedDoor count++ } log(this::class.java, Log.FINE, "Parsed $count door configs.")