Implemented water filling sounds for filling water vessels from all water sources

Implemented specific bucket water filling sound when filling from a well
Implemented emptying sounds for emptying vessels
Implemented cow milking sound
Implemented sound when smelting at a furnace
Implemented sound when smelting cannonballs at a furnace
Implemented sound when glassblowing
Fixed herb cleaning sound
Fixed regular wood door opening and closing sounds
Implemented metal door/gate opening and closing sounds
Implemented fence opening and closing sounds
Added Camelot castle main gate in door_configs.json
Fixed Sinclair mansion main gate to be a metal type door in door_configs.json
Implemented drinking sound when drinking from a waterskin in the desert
Implemented desert magic carpet travel take off and landing sound
Implemented desert magic carpet travel jingle/music
Fence around Falador cow farm is now properly identified as a fence and opens correctly
Fence id 34780 is now properly identified as a fence in door_configs.json so it opens correctly
Fence id 8810 is now properly identified as a fence in door_configs.json so it opens correctly
Fence id 2050-2051 is now properly identified as a fence in door_configs.json so it opens correctly
Fence id 1553 now has the correct open id in door_configs.json so it opens correctly
Fixed music tracks Relleka(289), Saga(290), and Borderlands(291) so they now play in their correct locations
Implemented jingle/music for sailing/chartering a ship(Trader crewmembers)
Implemented jingle/music for sailing/chartering a ship from/to Port Sarim/Karamja
Implemented jingle/music for sailing/chartering a ship from/to Port Sarim/Entrana
Implemented jingle/music for sailing/chartering a ship from/to Relleka/Neitiznot
Implemented jingle/music for sailing/chartering a ship from/to Relleka/Jatizso
Implemented jingle/music for sailing/chartering a ship from/to Ardougne/Brimmhaven
Implemented jingle/music for sailing/chartering a ship from/to Port Sarim/Pest control
Fixed the music player to be more authentic. Now when songs end they will repeat instead of playing a random inauthentic song. The loop function now works correctly so the currently playing song will play endlessly without changing as the player moves.
Implemented playJingle function in contentAPI.kt
This commit is contained in:
Zerken 2023-06-21 14:57:01 +00:00 committed by Ryan
parent 1672646e87
commit cef956722a
23 changed files with 141 additions and 26 deletions

View file

@ -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"
},
{

View file

@ -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",

View file

@ -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);

View file

@ -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 {

View file

@ -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.")

View file

@ -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
}

View file

@ -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() {

View file

@ -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<Object> 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);

View file

@ -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<Item> {
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);
}
}
}

View file

@ -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

View file

@ -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;

View file

@ -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());

View file

@ -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();

View file

@ -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();

View file

@ -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");

View file

@ -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<Object> {
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;
}
}

View file

@ -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
}
}

View file

@ -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;

View file

@ -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();

View file

@ -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

View file

@ -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;

View file

@ -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){}
}
}

View file

@ -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.")