diff --git a/Server/src/main/content/data/tables/BirdNest.java b/Server/src/main/content/data/tables/BirdNest.java
index 929ca3adc..0552daa2e 100644
--- a/Server/src/main/content/data/tables/BirdNest.java
+++ b/Server/src/main/content/data/tables/BirdNest.java
@@ -8,6 +8,9 @@ import core.game.node.item.GroundItemManager;
import core.game.node.item.Item;
import core.tools.RandomFunction;
import core.tools.StringUtils;
+import org.rs09.consts.Sounds;
+
+import static core.api.ContentAPIKt.playAudio;
/**
* Represents a birds nest.
@@ -93,7 +96,7 @@ public enum BirdNest {
*/
public static void drop(final Player player) {
final BirdNest nest = getRandomNest(false);
- player.getAudioManager().send(1997);
+ playAudio(player, Sounds.CUCKOO_1_1997);
GroundItemManager.create(nest.getNest(), player);
player.getPacketDispatch().sendMessage("
A bird's nest falls out of the tree.");
}
diff --git a/Server/src/main/content/global/handlers/iface/BoltEnchantingInterface.java b/Server/src/main/content/global/handlers/iface/BoltEnchantingInterface.java
index 77ea04dec..5d4a567ff 100644
--- a/Server/src/main/content/global/handlers/iface/BoltEnchantingInterface.java
+++ b/Server/src/main/content/global/handlers/iface/BoltEnchantingInterface.java
@@ -1,5 +1,6 @@
package content.global.handlers.iface;
+import core.api.ContentAPIKt;
import core.game.component.Component;
import core.game.component.ComponentDefinition;
import core.game.component.ComponentPlugin;
@@ -15,6 +16,8 @@ import core.game.world.update.flag.context.Graphics;
import core.plugin.Plugin;
import org.rs09.consts.Sounds;
+import static core.api.ContentAPIKt.playAudio;
+
/**
* Represents the component plugin used to handle the bolt enchanting interface.
* @author Emperor
@@ -88,7 +91,7 @@ public final class BoltEnchantingInterface extends ComponentPlugin {
}
player.getSkills().addExperience(Skills.MAGIC, bolts.getExp(), true);
player.getPacketDispatch().sendMessage("The magic of the runes coaxes out the true nature of the gem tips.");
- player.getAudioManager().send(Sounds.ENCHANTED_TIPPING_2921);
+ playAudio(player, Sounds.ENCHANTED_TIPPING_2921);
return true;
}
});
diff --git a/Server/src/main/content/global/handlers/iface/GlassInterface.java b/Server/src/main/content/global/handlers/iface/GlassInterface.java
index dd515ce37..0dc72c9ad 100644
--- a/Server/src/main/content/global/handlers/iface/GlassInterface.java
+++ b/Server/src/main/content/global/handlers/iface/GlassInterface.java
@@ -106,7 +106,7 @@ public final class GlassInterface extends ComponentPlugin {
return true;
}
player.animate(ANIMATION);
- player.getAudioManager().send(Sounds.GLASSBLOWING_2724);
+ playAudio(player, 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/iface/ge/GrandExchangeInterface.java b/Server/src/main/content/global/handlers/iface/ge/GrandExchangeInterface.java
index dd01103aa..853808349 100644
--- a/Server/src/main/content/global/handlers/iface/ge/GrandExchangeInterface.java
+++ b/Server/src/main/content/global/handlers/iface/ge/GrandExchangeInterface.java
@@ -8,7 +8,6 @@ import core.game.component.ComponentPlugin;
import core.game.ge.GEGuidePrice;
import core.game.ge.GEItemSet;
import core.game.node.entity.player.Player;
-import core.game.node.entity.player.link.audio.Audio;
import core.game.node.item.Item;
import core.game.system.task.Pulse;
import core.net.packet.PacketRepository;
@@ -19,6 +18,9 @@ import core.plugin.Plugin;
import core.game.ge.GrandExchangeOffer;
import core.game.ge.GrandExchangeRecords;
import core.game.world.GameWorld;
+import org.rs09.consts.Sounds;
+
+import static core.api.ContentAPIKt.playAudio;
/**
* Handles the Grand Exchange interface options.
@@ -178,7 +180,7 @@ public class GrandExchangeInterface extends ComponentPlugin {
player.getInventory().refresh();
player.getPacketDispatch().sendMessage("You successfully traded your item components for a set!");
}
- player.getAudioManager().send(new Audio(4044, 1, 1));
+ playAudio(player, Sounds.GE_TRADE_OK_4044);
PacketRepository.send(ContainerPacket.class, new ContainerContext(player, -1, -2, player.getAttribute("container-key", 93), player.getInventory(), false));
break;
case 155:
diff --git a/Server/src/main/content/global/handlers/item/EmptyOptionPlugin.java b/Server/src/main/content/global/handlers/item/EmptyOptionPlugin.java
index 7e5514ff5..ac51b226b 100644
--- a/Server/src/main/content/global/handlers/item/EmptyOptionPlugin.java
+++ b/Server/src/main/content/global/handlers/item/EmptyOptionPlugin.java
@@ -11,6 +11,8 @@ import org.rs09.consts.Sounds;
import java.util.HashMap;
+import static core.api.ContentAPIKt.playAudio;
+
/**
* Handles items with "empty" options
* @author ceik
@@ -29,7 +31,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);
+ playAudio(player, Sounds.LIQUID_2401, 0 ,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/ExplorersRingPlugin.kt b/Server/src/main/content/global/handlers/item/ExplorersRingPlugin.kt
index f8dc9de65..01fd85be6 100644
--- a/Server/src/main/content/global/handlers/item/ExplorersRingPlugin.kt
+++ b/Server/src/main/content/global/handlers/item/ExplorersRingPlugin.kt
@@ -28,7 +28,7 @@ class ExplorersRingPlugin : InteractionListener {
return@on true
}
player.settings.updateRunEnergy(-50.0)
- player.audioManager.send(5035)
+ playAudio(player, 5035)
getStoreFile()[player.username.toLowerCase() + ":run"] = charges + 1
diff --git a/Server/src/main/content/global/handlers/item/SpadeDigOptionPlugin.java b/Server/src/main/content/global/handlers/item/SpadeDigOptionPlugin.java
index 88228fe35..70d478faa 100644
--- a/Server/src/main/content/global/handlers/item/SpadeDigOptionPlugin.java
+++ b/Server/src/main/content/global/handlers/item/SpadeDigOptionPlugin.java
@@ -7,6 +7,9 @@ import core.game.node.Node;
import core.game.node.entity.player.Player;
import core.plugin.Initializable;
import core.plugin.Plugin;
+import org.rs09.consts.Sounds;
+
+import static core.api.ContentAPIKt.playAudio;
/**
* Represents the plugin used to handle the dig option on a spade.
@@ -24,7 +27,7 @@ public class SpadeDigOptionPlugin extends OptionHandler {
@Override
public boolean handle(final Player player, Node node, String option) {
- player.getAudioManager().send(1470,1,1);
+ playAudio(player, Sounds.DIGSPADE_1470);
if (!DigSpadeHandler.dig(player)) {
player.sendMessage("You dig but find nothing.");
}
diff --git a/Server/src/main/content/global/handlers/item/equipment/special/ClobberSpecialHandler.kt b/Server/src/main/content/global/handlers/item/equipment/special/ClobberSpecialHandler.kt
index 25ff591a5..31629189e 100644
--- a/Server/src/main/content/global/handlers/item/equipment/special/ClobberSpecialHandler.kt
+++ b/Server/src/main/content/global/handlers/item/equipment/special/ClobberSpecialHandler.kt
@@ -1,6 +1,7 @@
package content.global.handlers.item.equipment.special
import core.ServerConstants
+import core.api.playAudio
import core.game.container.impl.EquipmentContainer
import core.game.node.entity.Entity
import core.game.node.entity.combat.BattleState
@@ -18,6 +19,7 @@ import core.plugin.Initializable
import core.plugin.Plugin
import core.tools.RandomFunction
import org.rs09.consts.Items
+import org.rs09.consts.Sounds
/**
@@ -70,7 +72,7 @@ class ClobberSpecialHandler : MeleeSwingHandler(), Plugin {
victim.skills.updateLevel(Skills.DEFENCE, -hit, 0)
victim.skills.updateLevel(Skills.MAGIC, -hit, 0)
- player.audioManager.send(AUTHENTIC_AUDIO)
+ playAudio(player, Sounds.CLOBBER_2531, 20)
return 1
}
@@ -84,7 +86,7 @@ class ClobberSpecialHandler : MeleeSwingHandler(), Plugin {
player.sendChat("Chop chop!")
player.skills.updateLevel(Skills.WOODCUTTING, 3, player.skills.getStaticLevel(Skills.WOODCUTTING) + 3)
visualize(player, null, null)
- player.audioManager.send(OSRS_AUDIO)
+ playAudio(player, Sounds.CLOBBER_2531, 20)
return -1
}
@@ -104,16 +106,6 @@ class ClobberSpecialHandler : MeleeSwingHandler(), Plugin {
*/
private val GRAPHIC = Graphics(479, 96)
- /**
- * The authentic sound.
- */
- private val AUTHENTIC_AUDIO = Audio(2531)
-
- /**
- * The OSRS sound.
- */
- private val OSRS_AUDIO = Audio(2530)
-
/**
* The item.
*/
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 3ac1f9c45..5b78dd96b 100644
--- a/Server/src/main/content/global/handlers/item/withobject/AmmoMouldOnFurnace.kt
+++ b/Server/src/main/content/global/handlers/item/withobject/AmmoMouldOnFurnace.kt
@@ -40,7 +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)
+ playAudio(player, Sounds.FURNACE_2725)
}
3 -> {
sendMessage(player,"You pour the molten metal into your cannonball mould.")
diff --git a/Server/src/main/content/global/handlers/scenery/FieldPickingPlugin.java b/Server/src/main/content/global/handlers/scenery/FieldPickingPlugin.java
index 12fd3eec8..ec2d8bc96 100644
--- a/Server/src/main/content/global/handlers/scenery/FieldPickingPlugin.java
+++ b/Server/src/main/content/global/handlers/scenery/FieldPickingPlugin.java
@@ -18,6 +18,8 @@ import core.plugin.Initializable;
import core.tools.RandomFunction;
import org.rs09.consts.Sounds;
+import static core.api.ContentAPIKt.playAudio;
+
/**
* Handles the pick option of interactive scenery (non-farming cabbages,
* potatoes, bananas, etc)
@@ -65,7 +67,7 @@ public final class FieldPickingPlugin extends OptionHandler {
player.lock(1);
player.setAttribute("delay:picking", GameWorld.getTicks() + (plant == PickingPlant.FLAX ? 2 : 3));
player.animate(ANIMATION);
- player.getAudioManager().send(Sounds.PICK_2581,10, 30);
+ playAudio(player, Sounds.PICK_2581, 30);
if (plant.name().startsWith("NETTLES") && (player.getEquipment().get(EquipmentContainer.SLOT_HANDS) == null || player.getEquipment().get(EquipmentContainer.SLOT_HANDS) != null && !player.getEquipment().get(EquipmentContainer.SLOT_HANDS).getName().contains("glove"))) {
player.getPacketDispatch().sendMessage("You have been stung by the nettles!");
player.getImpactHandler().manualHit(player, 2, HitsplatType.POISON);
@@ -126,7 +128,7 @@ public final class FieldPickingPlugin extends OptionHandler {
*/
private void handleFlaxPick(final Player player, final Scenery object, final PickingPlant plant) {
int charge = object.getCharge();
- player.getAudioManager().send(2581);
+ playAudio(player, Sounds.PICK_2581);
player.getPacketDispatch().sendMessage("You pick some flax.");
// Seers achievement diary
diff --git a/Server/src/main/content/global/handlers/scenery/SlashWebPlugin.java b/Server/src/main/content/global/handlers/scenery/SlashWebPlugin.java
index d9fefe4c5..70ea5105b 100644
--- a/Server/src/main/content/global/handlers/scenery/SlashWebPlugin.java
+++ b/Server/src/main/content/global/handlers/scenery/SlashWebPlugin.java
@@ -12,13 +12,15 @@ import core.game.node.entity.combat.equipment.WeaponInterface.AttackStyle;
import core.game.node.entity.combat.equipment.WeaponInterface.WeaponInterfaces;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.diary.DiaryType;
-import core.game.node.entity.player.link.audio.Audio;
import core.game.node.item.Item;
import core.game.node.scenery.Scenery;
import core.game.node.scenery.SceneryBuilder;
import core.game.world.update.flag.context.Animation;
import core.plugin.Plugin;
import core.tools.RandomFunction;
+import org.rs09.consts.Sounds;
+
+import static core.api.ContentAPIKt.playAudio;
/**
* Handles the slashing of a web object.
@@ -74,7 +76,7 @@ public final class SlashWebPlugin extends OptionHandler {
}
final boolean success = RandomFunction.random(2) == 1;
player.lock(2);
- player.getAudioManager().send(new Audio(2548));
+ playAudio(player, Sounds.STABSWORD_SLASH_2548);
player.animate(weapon == KNIFE ? KNIFE_ANIMATION : ANIMATION);
if (success) {
player.getPacketDispatch().sendMessage("You slash the web apart.");
diff --git a/Server/src/main/content/global/skill/agility/pyramid/RollingBlock.java b/Server/src/main/content/global/skill/agility/pyramid/RollingBlock.java
index f5d31adab..7573889aa 100644
--- a/Server/src/main/content/global/skill/agility/pyramid/RollingBlock.java
+++ b/Server/src/main/content/global/skill/agility/pyramid/RollingBlock.java
@@ -12,6 +12,9 @@ import core.game.world.map.Direction;
import core.game.world.map.Location;
import core.game.world.map.RegionManager;
import core.game.world.update.flag.context.Animation;
+import org.rs09.consts.Sounds;
+
+import static core.api.ContentAPIKt.playAudio;
/**
* Represents the rolling block obstacle.
@@ -29,8 +32,8 @@ public final class RollingBlock implements MovementHook {
final boolean fail = backwards || AgilityHandler.hasFailed(player, 2, 0.3);
player.lock(5);
AgilityPyramidCourse.addConfig(player, stone, 1, false);
- player.getAudioManager().send(1396);
- player.getAudioManager().send(2469, 10 , 40);
+ playAudio(player, Sounds.PYRAMID_SCRAPE_1396);
+ playAudio(player, Sounds.LAND_FLAT_2469, 40);
if(e.isPlayer())
{
diff --git a/Server/src/main/content/global/skill/construction/HouseManager.java b/Server/src/main/content/global/skill/construction/HouseManager.java
index 3a93bbf06..9e5e4f1ea 100644
--- a/Server/src/main/content/global/skill/construction/HouseManager.java
+++ b/Server/src/main/content/global/skill/construction/HouseManager.java
@@ -8,7 +8,6 @@ import core.api.regionspec.RegionSpecification;
import core.api.regionspec.contracts.FillChunkContract;
import core.game.dialogue.FacialExpression;
import core.game.node.entity.player.Player;
-import core.game.node.entity.player.link.audio.Audio;
import core.game.node.entity.skill.Skills;
import core.game.node.scenery.Scenery;
import core.game.system.task.Pulse;
@@ -25,6 +24,7 @@ import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import core.tools.SystemLogger;
import core.game.world.GameWorld;
+import org.rs09.consts.Sounds;
import java.awt.*;
import java.nio.ByteBuffer;
@@ -224,7 +224,7 @@ public final class HouseManager {
private void openLoadInterface(Player player) {
player.getInterfaceManager().openComponent(399);
- player.getAudioManager().send(new Audio(984));
+ playAudio(player, Sounds.POH_TELEPORT_984);
submitCloseLoadInterfacePulse(player);
}
diff --git a/Server/src/main/content/global/skill/construction/decoration/chapel/BoneOfferPlugin.java b/Server/src/main/content/global/skill/construction/decoration/chapel/BoneOfferPlugin.java
index d241c0e1a..70a5eeb81 100644
--- a/Server/src/main/content/global/skill/construction/decoration/chapel/BoneOfferPlugin.java
+++ b/Server/src/main/content/global/skill/construction/decoration/chapel/BoneOfferPlugin.java
@@ -18,6 +18,7 @@ import core.game.world.update.flag.context.Animation;
import core.game.world.update.flag.context.Graphics;
import core.plugin.Initializable;
import core.plugin.Plugin;
+import org.rs09.consts.Sounds;
/**
* Handles the offering of bones on an altar.
@@ -98,7 +99,7 @@ public class BoneOfferPlugin extends UseWithHandler {
if (counter == 1 || counter % 5 == 0) {
if (player.getInventory().remove(new Item(b.getItemId()))) {
player.animate(ANIM);
- player.getAudioManager().send(new Audio(958));
+ playAudio(player, Sounds.POH_OFFER_BONES_958);
player.getPacketDispatch().sendPositionedGraphics(GFX, gfxLoc);
player.sendMessage(getMessage(isLit(left), isLit(right)));
player.getSkills().addExperience(Skills.PRAYER, b.getExperience() * getMod(altar, isLit(left), isLit(right)));
diff --git a/Server/src/main/content/global/skill/construction/decoration/chapel/ShieldBlessingPlugin.kt b/Server/src/main/content/global/skill/construction/decoration/chapel/ShieldBlessingPlugin.kt
index 6e6f6a539..9a8e34c76 100644
--- a/Server/src/main/content/global/skill/construction/decoration/chapel/ShieldBlessingPlugin.kt
+++ b/Server/src/main/content/global/skill/construction/decoration/chapel/ShieldBlessingPlugin.kt
@@ -1,14 +1,15 @@
package content.global.skill.construction.decoration.chapel
+import core.api.playAudio
import core.game.interaction.NodeUsageEvent
import core.game.interaction.UseWithHandler
-import core.game.node.entity.player.link.audio.Audio
import core.game.node.entity.skill.Skills
import core.game.node.item.Item
import core.game.world.update.flag.context.Animation
import core.plugin.Initializable
import core.plugin.Plugin
import org.rs09.consts.Items
+import org.rs09.consts.Sounds
const val HOLY_ELIXER = 13754
const val SPIRIT_SHIELD = 13734
@@ -38,7 +39,7 @@ class ShieldBlessingPlugin : UseWithHandler(HOLY_ELIXER, SPIRIT_SHIELD) {
}
player.animator.animate(Animation(896))
- player.audioManager.send(Audio(958))
+ playAudio(player, Sounds.POH_OFFER_BONES_958)
if(player.inventory.remove(Item(HOLY_ELIXER)) && player.inventory.remove(Item(SPIRIT_SHIELD)))
player.inventory.add(Item(Items.BLESSED_SPIRIT_SHIELD_13736))
diff --git a/Server/src/main/content/global/skill/construction/decoration/questhall/MountedGlory.kt b/Server/src/main/content/global/skill/construction/decoration/questhall/MountedGlory.kt
index 2a2adec95..44c9750a9 100644
--- a/Server/src/main/content/global/skill/construction/decoration/questhall/MountedGlory.kt
+++ b/Server/src/main/content/global/skill/construction/decoration/questhall/MountedGlory.kt
@@ -1,14 +1,15 @@
package content.global.skill.construction.decoration.questhall
+import core.api.playGlobalAudio
import core.api.teleport
+import core.game.interaction.IntType
+import core.game.interaction.InteractionListener
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.map.Location
import core.game.world.update.flag.context.Animation
import core.game.world.update.flag.context.Graphics
-import core.game.interaction.InteractionListener
-import core.game.interaction.IntType
+import org.rs09.consts.Sounds
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
@@ -53,7 +54,7 @@ class MountedGlory : InteractionListener {
1 -> {
player.lock(5)
player.visualize(Animation(714), Graphics(308, 100, 50))
- player.getAudioManager().send(Audio(200), true)
+ playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
}
4 -> player.animator.reset().also { teleport(player, TELEPORTS[int]) }
}
diff --git a/Server/src/main/content/global/skill/construction/decoration/questhall/MountedGloryPlugin.java b/Server/src/main/content/global/skill/construction/decoration/questhall/MountedGloryPlugin.java
index 4323ce498..90d96eb80 100644
--- a/Server/src/main/content/global/skill/construction/decoration/questhall/MountedGloryPlugin.java
+++ b/Server/src/main/content/global/skill/construction/decoration/questhall/MountedGloryPlugin.java
@@ -7,7 +7,6 @@ import core.game.dialogue.DialogueInterpreter;
import core.game.interaction.OptionHandler;
import core.game.node.Node;
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;
@@ -15,6 +14,9 @@ import core.game.world.update.flag.context.Animation;
import core.game.world.update.flag.context.Graphics;
import core.plugin.Initializable;
import core.plugin.Plugin;
+import org.rs09.consts.Sounds;
+
+import static core.api.ContentAPIKt.playGlobalAudio;
/**
* Handles the POH Mounted Glory.
@@ -79,7 +81,7 @@ public class MountedGloryPlugin extends OptionHandler {
}
player.lock();
player.visualize(ANIMATION, GRAPHICS);
- player.getAudioManager().send(new Audio(200), true);
+ playGlobalAudio(player.getLocation(), Sounds.TELEPORT_ALL_200);
player.getImpactHandler().setDisabledTicks(4);
GameWorld.getPulser().submit(new Pulse(4, player) {
@Override
diff --git a/Server/src/main/content/global/skill/cooking/IntentionalBurnPulse.java b/Server/src/main/content/global/skill/cooking/IntentionalBurnPulse.java
index 1cd0d4923..051f5a14c 100644
--- a/Server/src/main/content/global/skill/cooking/IntentionalBurnPulse.java
+++ b/Server/src/main/content/global/skill/cooking/IntentionalBurnPulse.java
@@ -3,6 +3,9 @@ package content.global.skill.cooking;
import core.game.node.entity.player.Player;
import core.game.node.item.Item;
import core.game.node.scenery.Scenery;
+import org.rs09.consts.Sounds;
+
+import static core.api.ContentAPIKt.playAudio;
public class IntentionalBurnPulse extends StandardCookingPulse {
int initial,product,amount;
@@ -47,7 +50,7 @@ public class IntentionalBurnPulse extends StandardCookingPulse {
if (player.getInventory().remove(initialItem)) {
player.getInventory().add(productItem);
player.getPacketDispatch().sendMessage(getMessage(initialItem, productItem, burned));
- player.getAudioManager().send(SOUND);
+ playAudio(player, Sounds.FRY_2577);
return true;
}
return false;
diff --git a/Server/src/main/content/global/skill/cooking/StandardCookingPulse.java b/Server/src/main/content/global/skill/cooking/StandardCookingPulse.java
index 9142ae020..66654e428 100644
--- a/Server/src/main/content/global/skill/cooking/StandardCookingPulse.java
+++ b/Server/src/main/content/global/skill/cooking/StandardCookingPulse.java
@@ -13,6 +13,9 @@ import core.game.system.task.Pulse;
import core.game.world.update.flag.context.Animation;
import core.tools.RandomFunction;
import org.rs09.consts.Items;
+import org.rs09.consts.Sounds;
+
+import static core.api.ContentAPIKt.playAudio;
public class StandardCookingPulse extends Pulse {
//range animation
@@ -170,7 +173,7 @@ public class StandardCookingPulse extends Pulse {
player.getInventory().add(CookableItems.getBurnt(initial));
}
player.getPacketDispatch().sendMessage(getMessage(initialItem, productItem, burned));
- player.getAudioManager().send(SOUND);
+ playAudio(player, Sounds.FRY_2577);
return true;
}
return false;
diff --git a/Server/src/main/content/global/skill/crafting/gem/GemCutPulse.java b/Server/src/main/content/global/skill/crafting/gem/GemCutPulse.java
index 123687c50..f094fa838 100644
--- a/Server/src/main/content/global/skill/crafting/gem/GemCutPulse.java
+++ b/Server/src/main/content/global/skill/crafting/gem/GemCutPulse.java
@@ -4,6 +4,9 @@ import core.game.node.entity.skill.SkillPulse;
import core.game.node.entity.skill.Skills;
import core.game.node.entity.player.Player;
import core.game.node.item.Item;
+import org.rs09.consts.Sounds;
+
+import static core.api.ContentAPIKt.playAudio;
/**
* Represents the pulse used to cut a gem.
@@ -61,7 +64,7 @@ public final class GemCutPulse extends SkillPulse- {
@Override
public void animate() {
if (ticks % 5 == 0 || ticks < 1) {
- player.getAudioManager().send(2586);
+ playAudio(player, Sounds.CHISEL_2586);
player.animate(gem.getAnimation());
}
}
diff --git a/Server/src/main/content/global/skill/crafting/limestone/ChiselLimestonePulse.java b/Server/src/main/content/global/skill/crafting/limestone/ChiselLimestonePulse.java
index 62333f0d6..259850dfa 100644
--- a/Server/src/main/content/global/skill/crafting/limestone/ChiselLimestonePulse.java
+++ b/Server/src/main/content/global/skill/crafting/limestone/ChiselLimestonePulse.java
@@ -5,6 +5,9 @@ import core.game.node.entity.skill.Skills;
import core.game.node.entity.player.Player;
import core.game.node.item.Item;
import core.game.world.update.flag.context.Animation;
+import org.rs09.consts.Sounds;
+
+import static core.api.ContentAPIKt.playAudio;
/**
*
@@ -48,7 +51,7 @@ public class ChiselLimestonePulse extends SkillPulse
- {
@Override
public void animate() {
if (ticks % 5 == 0 || ticks < 1) {
- player.getAudioManager().send(2586);
+ playAudio(player, Sounds.CHISEL_2586);
player.animate(Animation.create(4470));
}
}
diff --git a/Server/src/main/content/global/skill/farming/CompostBin.kt b/Server/src/main/content/global/skill/farming/CompostBin.kt
index ebaf9a732..b8581d5e3 100644
--- a/Server/src/main/content/global/skill/farming/CompostBin.kt
+++ b/Server/src/main/content/global/skill/farming/CompostBin.kt
@@ -9,6 +9,7 @@ import core.tools.RandomFunction
import org.json.simple.JSONArray
import org.json.simple.JSONObject
import org.rs09.consts.Items
+import org.rs09.consts.Sounds
import java.util.concurrent.TimeUnit
class CompostBin(val player: Player, val bin: CompostBins) {
@@ -25,14 +26,14 @@ class CompostBin(val player: Player, val bin: CompostBins) {
fun close() {
isClosed = true
- player.audioManager.send(2428)
+ playAudio(player, Sounds.COMPOST_CLOSE_2428)
finishedTime = System.currentTimeMillis() + TimeUnit.MINUTES.toMillis(RandomFunction.random(35,50).toLong())
updateBit()
}
fun open(){
isClosed = false
- player.audioManager.send(2429)
+ playAudio(player, Sounds.COMPOST_OPEN_2429)
updateBit()
}
@@ -47,7 +48,7 @@ class CompostBin(val player: Player, val bin: CompostBins) {
isSuperCompost = true
isClosed = false
}
- player.audioManager.send(Audio (2443, 1, 1))
+ playAudio(player, Sounds.FARMING_SCOOP_2443)
updateBit()
if(isSuperCompost) rewardXP(player, Skills.FARMING, 8.5)
else rewardXP(player, Skills.FARMING, 4.5)
@@ -116,7 +117,7 @@ class CompostBin(val player: Player, val bin: CompostBins) {
} else item.amount
for(i in 0 until amount) {
- player.audioManager.send(2441)
+ playAudio(player, Sounds.FARMING_PUTIN_2441)
addItem(item.id)
}
}
diff --git a/Server/src/main/content/global/skill/farming/CropHarvester.kt b/Server/src/main/content/global/skill/farming/CropHarvester.kt
index d69f50bf0..4e0366e24 100644
--- a/Server/src/main/content/global/skill/farming/CropHarvester.kt
+++ b/Server/src/main/content/global/skill/farming/CropHarvester.kt
@@ -6,7 +6,6 @@ import core.game.interaction.OptionHandler
import core.game.node.Node
import content.global.skill.summoning.familiar.GiantEntNPC
import core.game.node.entity.player.Player
-import core.game.node.entity.player.link.audio.Audio
import core.game.node.entity.skill.Skills
import core.game.node.item.Item
import core.game.system.task.Pulse
@@ -14,6 +13,7 @@ import core.game.world.update.flag.context.Animation
import core.plugin.Initializable
import core.plugin.Plugin
import org.rs09.consts.Items
+import org.rs09.consts.Sounds
val livesBased = arrayOf(PatchType.HERB, PatchType.CACTUS, PatchType.BELLADONNA, PatchType.HOPS, PatchType.ALLOTMENT,PatchType.EVIL_TURNIP)
@@ -65,17 +65,17 @@ class CropHarvester : OptionHandler() {
else -> Animation(0)
}
val sound = when(requiredItem){
- Items.SPADE_952 -> Audio(1470, 1, 1)
- Items.SECATEURS_5329 -> Audio(2437, 1, 1)
- Items.MAGIC_SECATEURS_7409 -> Audio(2437, 1, 1)
- else -> Audio(0)
+ Items.SPADE_952 -> Sounds.DIGSPADE_1470
+ Items.SECATEURS_5329 -> Sounds.FARMING_PICK_2437
+ Items.MAGIC_SECATEURS_7409 -> Sounds.FARMING_PICK_2437
+ else -> 0
}
if(!player.inventory.containsItem(Item(requiredItem))){
player.sendMessage("You lack the needed tool to harvest these crops.")
return true
}
player.animator.animate(anim)
- player.audioManager.send(sound)
+ playAudio(player, sound)
delay = 2
player.inventory.add(reward)
player.skills.addExperience(Skills.FARMING,plantable.harvestXP)
diff --git a/Server/src/main/content/global/skill/farming/DigUpPatchDialogue.kt b/Server/src/main/content/global/skill/farming/DigUpPatchDialogue.kt
index c320336b1..c1f2666ff 100644
--- a/Server/src/main/content/global/skill/farming/DigUpPatchDialogue.kt
+++ b/Server/src/main/content/global/skill/farming/DigUpPatchDialogue.kt
@@ -1,5 +1,6 @@
package content.global.skill.farming
+import core.api.playAudio
import core.game.dialogue.DialoguePlugin
import core.game.node.entity.player.Player
import core.game.node.entity.player.link.audio.Audio
@@ -8,6 +9,7 @@ import core.game.node.item.Item
import core.game.system.task.Pulse
import core.game.world.update.flag.context.Animation
import core.plugin.Initializable
+import org.rs09.consts.Sounds
@Initializable
class DigUpPatchDialogue(player: Player? = null) : DialoguePlugin(player) {
@@ -35,8 +37,8 @@ class DigUpPatchDialogue(player: Player? = null) : DialoguePlugin(player) {
1 -> {
end()
player.animator.animate(Animation(830))
- player.audioManager.send(Audio(1470, 1, 1))
- player.pulseManager.run(object : Pulse(){
+ playAudio(player, Sounds.DIGSPADE_1470)
+ player.pulseManager.run(object : Pulse(){
override fun pulse(): Boolean {
if(patch?.patch?.type == PatchType.TREE){
if(patch?.getCurrentState() == (patch?.plantable?.value ?: 0) + (patch?.plantable?.stages ?: 0) + 2 && patch?.isWeedy() != true){
diff --git a/Server/src/main/content/global/skill/farming/FruitAndBerryPicker.kt b/Server/src/main/content/global/skill/farming/FruitAndBerryPicker.kt
index 10ae27787..5c420a348 100644
--- a/Server/src/main/content/global/skill/farming/FruitAndBerryPicker.kt
+++ b/Server/src/main/content/global/skill/farming/FruitAndBerryPicker.kt
@@ -12,6 +12,7 @@ import core.game.system.task.Pulse
import core.game.world.update.flag.context.Animation
import core.plugin.Initializable
import core.plugin.Plugin
+import org.rs09.consts.Sounds
import java.util.concurrent.TimeUnit
@Initializable
@@ -68,7 +69,7 @@ class FruitAndBerryPicker : OptionHandler() {
}
player.animator.animate(animation)
- player.audioManager.send(2437)
+ playAudio(player, Sounds.FARMING_PICK_2437)
addItemOrDrop(player,reward.id,reward.amount)
player.skills.addExperience(Skills.FARMING,plantable.harvestXP)
patch.setCurrentState(patch.getCurrentState() - 1)
diff --git a/Server/src/main/content/global/skill/farming/PatchRaker.kt b/Server/src/main/content/global/skill/farming/PatchRaker.kt
index ee4641925..6569ac495 100644
--- a/Server/src/main/content/global/skill/farming/PatchRaker.kt
+++ b/Server/src/main/content/global/skill/farming/PatchRaker.kt
@@ -1,11 +1,13 @@
package content.global.skill.farming
+import core.api.playAudio
import core.game.node.entity.player.Player
import core.game.node.entity.skill.Skills
import core.game.node.item.Item
import core.game.system.task.Pulse
import core.game.world.update.flag.context.Animation
import org.rs09.consts.Items
+import org.rs09.consts.Sounds
object PatchRaker {
val RAKE_ANIM = Animation(2273)
@@ -17,7 +19,7 @@ object PatchRaker {
var patchStage = patch.getPatchFor(player).getCurrentState()
if(patchStage <= 2){
player.animator.animate(RAKE_ANIM)
- player.audioManager.send(2442)
+ playAudio(player, Sounds.FARMING_RAKING_2442)
}
if(delay < 5) {
delay = 5
diff --git a/Server/src/main/content/global/skill/farming/UseWithPatchHandler.kt b/Server/src/main/content/global/skill/farming/UseWithPatchHandler.kt
index 02e02fcb6..a263f9812 100644
--- a/Server/src/main/content/global/skill/farming/UseWithPatchHandler.kt
+++ b/Server/src/main/content/global/skill/farming/UseWithPatchHandler.kt
@@ -9,6 +9,7 @@ import core.game.world.update.flag.context.Animation
import org.rs09.consts.Items
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
+import org.rs09.consts.Sounds
class UseWithPatchHandler : InteractionListener {
val RAKE = Items.RAKE_5341
@@ -99,7 +100,7 @@ class UseWithPatchHandler : InteractionListener {
player.pulseManager.run(object: Pulse(){
override fun pulse(): Boolean {
player.animator.animate(plantCureAnim)
- player.audioManager.send(2438)
+ playAudio(player, Sounds.FARMING_PLANTCURE_2438)
if(player.inventory.remove(usedItem)){
player.inventory.add(Item(Items.VIAL_229))
p.cureDisease()
@@ -123,7 +124,7 @@ class UseWithPatchHandler : InteractionListener {
return true
}
player.animator.animate(wateringCanAnim)
- player.audioManager.send(2446)
+ playAudio(player, Sounds.FARMING_WATERING_2446)
if(player.inventory.remove(usedItem)){
player.inventory.add(Item(usedItem.id.getNext()))
p.water()
@@ -138,7 +139,7 @@ class UseWithPatchHandler : InteractionListener {
val p = patch.getPatchFor(player)
if(p.compost == CompostType.NONE) {
player.animator.animate(pourBucketAnim)
- player.audioManager.send(2427)
+ playAudio(player, Sounds.FARMING_COMPOST_2427)
player.pulseManager.run(object : Pulse(){
override fun pulse(): Boolean {
if(player.inventory.remove(usedItem,false)){
@@ -207,7 +208,7 @@ class UseWithPatchHandler : InteractionListener {
player.lock()
if(player.inventory.remove(plantItem)) {
player.animator.animate(Animation(2291))
- player.audioManager.send(2432)
+ playAudio(player, Sounds.FARMING_DIBBING_2432)
player.pulseManager.run(object : Pulse(3) {
override fun pulse(): Boolean {
if(plantable == Plantable.JUTE_SEED && patch == FarmingPatch.MCGRUBOR_HOPS && !player.achievementDiaryManager.hasCompletedTask(DiaryType.SEERS_VILLAGE,0,7)){
diff --git a/Server/src/main/content/global/skill/gather/PickaxeRepairPlugin.kt b/Server/src/main/content/global/skill/gather/PickaxeRepairPlugin.kt
index 8ac6c82c9..83e3db86a 100644
--- a/Server/src/main/content/global/skill/gather/PickaxeRepairPlugin.kt
+++ b/Server/src/main/content/global/skill/gather/PickaxeRepairPlugin.kt
@@ -1,10 +1,12 @@
package content.global.skill.gather
+import core.api.playAudio
import core.game.interaction.NodeUsageEvent
import core.game.interaction.UseWithHandler
import core.game.node.item.Item
import core.plugin.Initializable
import core.plugin.Plugin
+import org.rs09.consts.Sounds
/**
* Repairs pickaxes after being broken
@@ -35,7 +37,7 @@ class PickaxeRepairPlugin : UseWithHandler(480,482,484,486,488,490){
event.player.inventory.remove(used.asItem())
event.player.inventory.add(Item(product))
event.player.sendMessage("You carefully reattach the head to the handle.")
- event.player.audioManager.send(10)
+ playAudio(event.player, Sounds.EYEGLO_COIN_10)
return true
}
diff --git a/Server/src/main/content/global/skill/gather/woodcutting/WoodcuttingListener.kt b/Server/src/main/content/global/skill/gather/woodcutting/WoodcuttingListener.kt
index 29dfe67aa..ffb060243 100644
--- a/Server/src/main/content/global/skill/gather/woodcutting/WoodcuttingListener.kt
+++ b/Server/src/main/content/global/skill/gather/woodcutting/WoodcuttingListener.kt
@@ -12,14 +12,13 @@ import core.api.*
import core.cache.def.impl.ItemDefinition
import core.game.container.impl.EquipmentContainer
import core.game.event.ResourceProducedEvent
+import core.game.interaction.Clocks
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
-import core.game.interaction.Clocks
import core.game.node.Node
-import core.game.node.entity.npc.NPC
import core.game.node.entity.impl.Projectile
+import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
-import core.game.node.entity.player.link.audio.Audio
import core.game.node.entity.player.link.diary.DiaryType
import core.game.node.entity.skill.Skills
import core.game.node.item.Item
@@ -169,7 +168,7 @@ class WoodcuttingListener : InteractionListener {
SceneryBuilder.replace(node, node.transform(0), resource.getRespawnDuration())
}
node.setActive(false)
- player.getAudioManager().send(TREE_FALLING_2734)
+ playAudio(player, TREE_FALLING_2734)
return true
}
}
@@ -196,11 +195,10 @@ class WoodcuttingListener : InteractionListener {
.filter { p: Player -> p.username != player.username }
.toList()
val soundIndex = RandomFunction.random(0, woodcuttingSounds.size)
- player.audioManager.send(
- Audio(woodcuttingSounds[soundIndex]),
- playersAroundMe,
- player.location
- )
+
+ for (p in playersAroundMe) {
+ playAudio(p, woodcuttingSounds[soundIndex])
+ }
}
}
diff --git a/Server/src/main/content/global/skill/gather/woodcutting/WoodcuttingSkillPulse.java b/Server/src/main/content/global/skill/gather/woodcutting/WoodcuttingSkillPulse.java
index 43e220666..00c153744 100644
--- a/Server/src/main/content/global/skill/gather/woodcutting/WoodcuttingSkillPulse.java
+++ b/Server/src/main/content/global/skill/gather/woodcutting/WoodcuttingSkillPulse.java
@@ -29,6 +29,7 @@ import org.rs09.consts.Sounds;
import java.util.List;
import java.util.stream.Collectors;
+import static core.api.ContentAPIKt.playAudio;
import static core.game.system.command.sets.StatAttributeKeysKt.STATS_BASE;
import static core.game.system.command.sets.StatAttributeKeysKt.STATS_LOGS;
@@ -123,11 +124,9 @@ public class WoodcuttingSkillPulse extends Pulse {
int soundIndex = RandomFunction.random(0, woodcuttingSounds.length);
- player.getAudioManager().send(
- new Audio(woodcuttingSounds[soundIndex]),
- playersAroundMe,
- player.getLocation()
- );
+ for (Player p : playersAroundMe) {
+ playAudio(p, woodcuttingSounds[soundIndex]);
+ }
}
}
@@ -216,7 +215,7 @@ public class WoodcuttingSkillPulse extends Pulse {
}
node.setActive(false);
- player.getAudioManager().send(Sounds.TREE_FALLING_2734);
+ playAudio(player, Sounds.TREE_FALLING_2734);
return true;
}
}
diff --git a/Server/src/main/content/global/skill/herblore/HerbCleanPlugin.java b/Server/src/main/content/global/skill/herblore/HerbCleanPlugin.java
index 62d8c9ec3..3de0c24f0 100644
--- a/Server/src/main/content/global/skill/herblore/HerbCleanPlugin.java
+++ b/Server/src/main/content/global/skill/herblore/HerbCleanPlugin.java
@@ -41,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(5153, 1);
+ playAudio(player, 5153);
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/herblore/HerblorePulse.java b/Server/src/main/content/global/skill/herblore/HerblorePulse.java
index 2e45fb35b..fbf1a8c73 100644
--- a/Server/src/main/content/global/skill/herblore/HerblorePulse.java
+++ b/Server/src/main/content/global/skill/herblore/HerblorePulse.java
@@ -9,6 +9,9 @@ import core.tools.StringUtils;
import content.global.skill.skillcapeperks.*;
import content.data.consumables.Consumables;
import core.tools.RandomFunction;
+import org.rs09.consts.Sounds;
+
+import static core.api.ContentAPIKt.playAudio;
/**
@@ -121,7 +124,7 @@ public final class HerblorePulse extends SkillPulse
- {
final Item item = potion.getProduct();
player.getInventory().add(item);
player.getPacketDispatch().sendMessage("You put the" + StringUtils.formatDisplayName(potion.getIngredient().getName().toLowerCase().replace("clean", "")) + " leaf into the vial of water.");
- player.getAudioManager().send(2608);
+ playAudio(player, Sounds.GRIND_2608);
if (cycles++ == 3) {
player.animate(ANIMATION);
cycles = 0;
@@ -146,7 +149,7 @@ public final class HerblorePulse extends SkillPulse
- {
player.getInventory().add(item);
player.getSkills().addExperience(Skills.HERBLORE, potion.getExperience(), true);
player.getPacketDispatch().sendMessage("You mix the " + potion.getIngredient().getName().toLowerCase() + " into your potion.");
- player.getAudioManager().send(2608);
+ playAudio(player, Sounds.GRIND_2608);
player.animate(ANIMATION);
}
}
diff --git a/Server/src/main/content/global/skill/hunter/TrapCreatePulse.java b/Server/src/main/content/global/skill/hunter/TrapCreatePulse.java
index c40e81919..dddc84e4d 100644
--- a/Server/src/main/content/global/skill/hunter/TrapCreatePulse.java
+++ b/Server/src/main/content/global/skill/hunter/TrapCreatePulse.java
@@ -57,21 +57,21 @@ public final class TrapCreatePulse extends SkillPulse {
if (checkRequirements()){
switch(trap) {
case BIRD_SNARE:
- player.getAudioManager().send(Sounds.HUNTING_SETNOOSE_2646, 10, 40);
+ playAudio(player, Sounds.HUNTING_SETNOOSE_2646, 40);
break;
case BOX_TRAP:
- player.getAudioManager().send(Sounds.HUNTING_LAYBOXTRAP_2636, 10, 20);
+ playAudio(player, Sounds.HUNTING_LAYBOXTRAP_2636, 20);
break;
case NET_TRAP:
lock(player, 3);
- player.getAudioManager().send(Sounds.HUNTING_SET_TWITCHNET_2644);
+ playAudio(player, Sounds.HUNTING_SET_TWITCHNET_2644);
break;
case RABBIT_SNARE:
- player.getAudioManager().send(Sounds.HUNTING_SETSNARE_2647);
+ playAudio(player, Sounds.HUNTING_SETSNARE_2647);
break;
case DEAD_FALL:
lock(player, 6);
- player.getAudioManager().send(Sounds.HUNTING_SETDEADFALL_2645, 10, 130);
+ playAudio(player, Sounds.HUNTING_SETDEADFALL_2645, 130);
}
}
}
diff --git a/Server/src/main/content/global/skill/hunter/TrapDismantlePulse.java b/Server/src/main/content/global/skill/hunter/TrapDismantlePulse.java
index 292ad1874..0492f937b 100644
--- a/Server/src/main/content/global/skill/hunter/TrapDismantlePulse.java
+++ b/Server/src/main/content/global/skill/hunter/TrapDismantlePulse.java
@@ -46,20 +46,20 @@ public final class TrapDismantlePulse extends SkillPulse {
switch(trap) {
case BIRD_SNARE:
lock(player,5);
- player.getAudioManager().send(Sounds.HUNTING_DISMANTLE_2632, 10, 50);
+ playAudio(player, Sounds.HUNTING_DISMANTLE_2632, 50);
break;
case BOX_TRAP:
lock(player,4);
- player.getAudioManager().send(Sounds.HUNTING_DISMANTLE_2632, 10, 50);
+ playAudio(player, Sounds.HUNTING_DISMANTLE_2632, 50);
break;
case NET_TRAP:
lock(player, 5);
- player.getAudioManager().send(Sounds.HUNTING_DISMANTLE_2632, 10, 20);
+ playAudio(player, Sounds.HUNTING_DISMANTLE_2632, 20);
break;
case RABBIT_SNARE:
case DEAD_FALL:
lock(player, 4);
- player.getAudioManager().send(Sounds.HUNTING_DISMANTLE_2632, 10, 80);
+ playAudio(player, Sounds.HUNTING_DISMANTLE_2632, 80);
break;
}
}
diff --git a/Server/src/main/content/global/skill/hunter/TrapSetting.java b/Server/src/main/content/global/skill/hunter/TrapSetting.java
index 461c2c5c9..ec0f87ba3 100644
--- a/Server/src/main/content/global/skill/hunter/TrapSetting.java
+++ b/Server/src/main/content/global/skill/hunter/TrapSetting.java
@@ -18,6 +18,8 @@ import core.game.world.update.flag.context.Animation;
import core.tools.RandomFunction;
import org.rs09.consts.Sounds;
+import static core.api.ContentAPIKt.playAudio;
+
/**
* A setting for a trap type.
* @author Vexia
@@ -309,18 +311,18 @@ public class TrapSetting {
wrapper.setObject(getFinalId(wrapper, node));
switch(wrapper.getType()) {
case BIRD_SNARE:
- player.getAudioManager().send(Sounds.HUNTING_NOOSE_2637, 10, 0, 10, wrapper.getObject().getLocation());
- player.getAudioManager().send(Sounds.HUNTING_BIRDCAUGHT_2625, 10, 20, 10, wrapper.getObject().getLocation());
+ playAudio(player, Sounds.HUNTING_NOOSE_2637, 0, 1, wrapper.getObject().getLocation(), 10);
+ playAudio(player, Sounds.HUNTING_BIRDCAUGHT_2625, 20, 1, wrapper.getObject().getLocation(), 10);
break;
case BOX_TRAP:
- player.getAudioManager().send(Sounds.HUNTING_BOXTRAP_2627, 10, 0, 10, wrapper.getObject().getLocation());
+ playAudio(player, Sounds.HUNTING_BOXTRAP_2627, 0, 1, wrapper.getObject().getLocation(), 10);
break;
case NET_TRAP:
- player.getAudioManager().send(Sounds.HUNTING_TWITCHNET_2652, 10, 0, 10, wrapper.getObject().getLocation());
- player.getAudioManager().send(Sounds.SALAMANDER_HIT_739, 10, 20, 10, wrapper.getObject().getLocation());
+ playAudio(player, Sounds.HUNTING_TWITCHNET_2652, 0, 1, wrapper.getObject().getLocation(), 10);
+ playAudio(player, Sounds.SALAMANDER_HIT_739, 20, 1, wrapper.getObject().getLocation(), 10);
break;
case DEAD_FALL:
- player.getAudioManager().send(Sounds.HUNTING_DEADFALL_2631, 10, 0, 10, wrapper.getObject().getLocation());
+ playAudio(player, Sounds.HUNTING_DEADFALL_2631, 0, 1, wrapper.getObject().getLocation(), 10);
break;
}
return true;
diff --git a/Server/src/main/content/global/skill/hunter/bnet/BNetPulse.java b/Server/src/main/content/global/skill/hunter/bnet/BNetPulse.java
index 7729bb00f..38371c49f 100644
--- a/Server/src/main/content/global/skill/hunter/bnet/BNetPulse.java
+++ b/Server/src/main/content/global/skill/hunter/bnet/BNetPulse.java
@@ -15,6 +15,8 @@ import org.rs09.consts.Sounds;
import java.util.Random;
+import static core.api.ContentAPIKt.playAudio;
+
/**
* Handles the butterfly net catch pulse.
* @author Vexia
@@ -94,7 +96,7 @@ public final class BNetPulse extends SkillPulse {
public void animate() {
if (ticks < 1) {
player.animate(ANIMATION);
- player.getAudioManager().send(Sounds.HUNTING_BUTTERFLYNET_2623);
+ playAudio(player, Sounds.HUNTING_BUTTERFLYNET_2623);
}
}
diff --git a/Server/src/main/content/global/skill/hunter/falconry/FalconryCatchPulse.java b/Server/src/main/content/global/skill/hunter/falconry/FalconryCatchPulse.java
index 99c64c7d5..b33667e41 100644
--- a/Server/src/main/content/global/skill/hunter/falconry/FalconryCatchPulse.java
+++ b/Server/src/main/content/global/skill/hunter/falconry/FalconryCatchPulse.java
@@ -15,6 +15,8 @@ import core.game.world.repository.Repository;
import core.tools.RandomFunction;
import org.rs09.consts.Sounds;
+import static core.api.ContentAPIKt.playAudio;
+
/**
* Represents the skill pulse used to catch a kebbit.
* @author Vexia
@@ -124,7 +126,7 @@ public final class FalconryCatchPulse extends SkillPulse {
falcon.setAttribute("falcon:catch", falconCatch);
falcon.init();
HintIconManager.registerHintIcon(player, falcon);
- player.getAudioManager().send(Sounds.HUNTING_FALCON_SWOOP_2634, 10, 0, 12, node.getLocation());
+ playAudio(player, Sounds.HUNTING_FALCON_SWOOP_2634, 10, 1, node.getLocation(), 12);
GameWorld.getPulser().submit(new Pulse(100, falcon) {
@Override
public boolean pulse() {
@@ -157,7 +159,7 @@ public final class FalconryCatchPulse extends SkillPulse {
projectile.setStartHeight(26);
projectile.setEndHeight(1);
projectile.send();
- player.getAudioManager().send(Sounds.HUNTING_FALCON_FLY_2633);
+ playAudio(player, Sounds.HUNTING_FALCON_FLY_2633);
}
/**
diff --git a/Server/src/main/content/global/skill/hunter/pitfall/HunterPitfall.kt b/Server/src/main/content/global/skill/hunter/pitfall/HunterPitfall.kt
index cfe50aef7..7915f639d 100644
--- a/Server/src/main/content/global/skill/hunter/pitfall/HunterPitfall.kt
+++ b/Server/src/main/content/global/skill/hunter/pitfall/HunterPitfall.kt
@@ -225,8 +225,8 @@ class PitfallListeners : InteractionListener {
//pitfall_npc.setLocation(pit.getLocation());
//pitfall_npc.walkingQueue.addPath(pit.location.x, pit.location.y);
teleport(pitfall_npc, pit.location)
- player.audioManager.send(Sounds.HUNTING_PITFALL_COLLAPSE_2638, 10, 0, 10, pit.location)
- player.audioManager.send(Sounds.PANTHER_DEATH_667, 10, 50, 10, pit.location)
+ playAudio(player, Sounds.HUNTING_PITFALL_COLLAPSE_2638, 0, 1, pit.location, 10)
+ playAudio(player, Sounds.PANTHER_DEATH_667, 50, 1, pit.location, 10)
pitfall_npc.startDeath(null)
player.removeAttribute("pitfall:timestamp:${pit.location.x}:${pit.location.y}")
player.incrementAttribute("pitfall:count", -1)
@@ -238,7 +238,7 @@ class PitfallListeners : InteractionListener {
val npcdst = dst.transform(dir, if(dir == Direction.SOUTH || dir == Direction.WEST) 1 else 0)
teleport(pitfall_npc, npcdst)
pitfall_npc.animate(Animation(5232, Priority.HIGH))
- player.audioManager.send(Sounds.HUNTING_BIGCAT_JUMP_2619, 10, 0, 10, pit.location)
+ playAudio(player, Sounds.HUNTING_BIGCAT_JUMP_2619, 0, 1, pit.location, 10)
pitfall_npc.attack(player)
pitfall_npc.setAttribute("last_pit_loc", pit.location)
}
diff --git a/Server/src/main/content/global/skill/magic/SpellListener.kt b/Server/src/main/content/global/skill/magic/SpellListener.kt
index 01eae8785..61c5e31c2 100644
--- a/Server/src/main/content/global/skill/magic/SpellListener.kt
+++ b/Server/src/main/content/global/skill/magic/SpellListener.kt
@@ -1,5 +1,6 @@
package content.global.skill.magic
+import core.api.playAudio
import core.api.setAttribute
import core.cache.def.impl.ItemDefinition
import core.game.node.Node
@@ -76,7 +77,7 @@ abstract class SpellListener(val bookName: String) : Listener {
if(player.getAttribute("tablet-spell",false)) return
player.visualize(anim,gfx)
if(soundID != -1){
- player.audioManager.send(soundID)
+ playAudio(player, soundID)
}
}
diff --git a/Server/src/main/content/global/skill/magic/SpellTablets.kt b/Server/src/main/content/global/skill/magic/SpellTablets.kt
index f6b8f428e..62b550f63 100644
--- a/Server/src/main/content/global/skill/magic/SpellTablets.kt
+++ b/Server/src/main/content/global/skill/magic/SpellTablets.kt
@@ -1,12 +1,14 @@
package content.global.skill.magic
import content.global.skill.magic.spellconsts.Modern
+import core.api.playAudio
import core.game.node.entity.player.Player
import core.game.node.item.Item
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
class SpellTablets : InteractionListener {
val B2P_TABLET = Items.BONES_TO_PEACHES_8015
@@ -30,7 +32,7 @@ class SpellTablets : InteractionListener {
}
fun breakTablet(player: Player){
- player.audioManager.send(979)
+ playAudio(player, Sounds.POH_TABLET_BREAK_979)
player.animator.forceAnimation(Animation(4069))
player.lock(5)
player.setAttribute("tablet-spell",true)
diff --git a/Server/src/main/content/global/skill/magic/ancient/BloodSpells.java b/Server/src/main/content/global/skill/magic/ancient/BloodSpells.java
index b3db5e3f8..2cd31111c 100644
--- a/Server/src/main/content/global/skill/magic/ancient/BloodSpells.java
+++ b/Server/src/main/content/global/skill/magic/ancient/BloodSpells.java
@@ -97,7 +97,7 @@ public final class BloodSpells extends CombatSpell {
projectile.transform(entity, (Entity) target, false, 58, 10).send();
}
entity.animate(animation);
- playGlobalAudio(entity.getLocation(), audio.getId(), 20);
+ playGlobalAudio(entity.getLocation(), audio.id, 20);
}
@Override
diff --git a/Server/src/main/content/global/skill/magic/ancient/IceSpells.java b/Server/src/main/content/global/skill/magic/ancient/IceSpells.java
index 8641ac76a..e4f287574 100644
--- a/Server/src/main/content/global/skill/magic/ancient/IceSpells.java
+++ b/Server/src/main/content/global/skill/magic/ancient/IceSpells.java
@@ -102,7 +102,7 @@ public final class IceSpells extends CombatSpell {
projectile.transform(entity, (Entity) target, false, 58, 10).send();
}
entity.animate(animation);
- playGlobalAudio(entity.getLocation(), audio.getId(), 20);
+ playGlobalAudio(entity.getLocation(), audio.id, 20);
}
diff --git a/Server/src/main/content/global/skill/magic/ancient/MiasmicSpells.java b/Server/src/main/content/global/skill/magic/ancient/MiasmicSpells.java
index 6df4d946c..1faf6ed30 100644
--- a/Server/src/main/content/global/skill/magic/ancient/MiasmicSpells.java
+++ b/Server/src/main/content/global/skill/magic/ancient/MiasmicSpells.java
@@ -101,7 +101,7 @@ public final class MiasmicSpells extends CombatSpell {
projectile.transform(entity, (Entity) target, false, 58, 10).send();
}
entity.animate(animation);
- playGlobalAudio(entity.getLocation(), audio.getId(), 20);
+ playGlobalAudio(entity.getLocation(), audio.id, 20);
}
@Override
diff --git a/Server/src/main/content/global/skill/magic/ancient/ShadowSpells.java b/Server/src/main/content/global/skill/magic/ancient/ShadowSpells.java
index 75ec82d48..22ca33fa3 100644
--- a/Server/src/main/content/global/skill/magic/ancient/ShadowSpells.java
+++ b/Server/src/main/content/global/skill/magic/ancient/ShadowSpells.java
@@ -99,7 +99,7 @@ public final class ShadowSpells extends CombatSpell {
projectile.transform(entity, (Entity) target, false, 58, 10).send();
}
entity.animate(animation);
- playGlobalAudio(entity.getLocation(), audio.getId(), 20);
+ playGlobalAudio(entity.getLocation(), audio.id, 20);
}
@Override
diff --git a/Server/src/main/content/global/skill/magic/ancient/SmokeSpells.java b/Server/src/main/content/global/skill/magic/ancient/SmokeSpells.java
index 7c6a71965..23ddf938f 100644
--- a/Server/src/main/content/global/skill/magic/ancient/SmokeSpells.java
+++ b/Server/src/main/content/global/skill/magic/ancient/SmokeSpells.java
@@ -108,7 +108,7 @@ public final class SmokeSpells extends CombatSpell {
projectile.transform(entity, (Entity) target, false, 58, 10).send();
}
entity.animate(animation);
- playGlobalAudio(entity.getLocation(), audio.getId(), 20);
+ playGlobalAudio(entity.getLocation(), audio.id, 20);
}
@Override
diff --git a/Server/src/main/content/global/skill/magic/lunar/HealSpell.java b/Server/src/main/content/global/skill/magic/lunar/HealSpell.java
index 8fb86e46b..f79c85728 100644
--- a/Server/src/main/content/global/skill/magic/lunar/HealSpell.java
+++ b/Server/src/main/content/global/skill/magic/lunar/HealSpell.java
@@ -9,17 +9,19 @@ import core.game.node.entity.Entity;
import core.game.node.entity.combat.ImpactHandler.HitsplatType;
import core.game.node.entity.combat.spell.SpellType;
import core.game.node.entity.player.Player;
-import core.game.node.entity.player.link.audio.Audio;
import core.game.node.entity.player.link.SpellBookManager.SpellBook;
import core.game.node.item.Item;
import core.game.world.map.RegionManager;
import core.game.world.update.flag.context.Animation;
import core.game.world.update.flag.context.Graphics;
import core.plugin.Plugin;
+import org.rs09.consts.Sounds;
import java.util.Iterator;
import java.util.List;
+import static core.api.ContentAPIKt.playGlobalAudio;
+
/**
* Represents the healing spell.
* @author 'Vexia
@@ -105,8 +107,8 @@ public final class HealSpell extends MagicSpell {
player.getImpactHandler().manualHit(player, transfer, null);
o.getSkills().heal(transfer);
player.animate(ANIMATION);
- player.getAudioManager().send(new Audio(2895), true);
- o.getAudioManager().send(new Audio(2892), true);
+ playGlobalAudio(player.getLocation(), Sounds.LUNAR_HEAL_OTHER_2895);
+ playGlobalAudio(o.getLocation(), Sounds.LUNAR_HEAL_OTHER_INDIVIDUAL_2892);
o.graphics(GRAPHICS);
} else {
List players = RegionManager.getLocalPlayers(player, 1);
@@ -130,9 +132,9 @@ public final class HealSpell extends MagicSpell {
}
player.getImpactHandler().manualHit(player, percentage, HitsplatType.NORMAL);
player.animate(ANIMATION_G);
- player.getAudioManager().send(new Audio(2894), true);
+ playGlobalAudio(player.getLocation(), Sounds.LUNAR_HEAL_GROUP_2894);
for (Player p : players) {
- p.getAudioManager().send(new Audio(2892), true);
+ playGlobalAudio(p.getLocation(), Sounds.LUNAR_HEAL_OTHER_INDIVIDUAL_2892);
p.graphics(GRAPHICS_G);
p.getSkills().heal(percentage);
}
diff --git a/Server/src/main/content/global/skill/magic/lunar/MagicImbueSpell.java b/Server/src/main/content/global/skill/magic/lunar/MagicImbueSpell.java
index 80574cddc..79512f7c4 100644
--- a/Server/src/main/content/global/skill/magic/lunar/MagicImbueSpell.java
+++ b/Server/src/main/content/global/skill/magic/lunar/MagicImbueSpell.java
@@ -13,6 +13,9 @@ import core.game.world.GameWorld;
import core.game.world.update.flag.context.Animation;
import core.game.world.update.flag.context.Graphics;
import core.plugin.Plugin;
+import org.rs09.consts.Sounds;
+
+import static core.api.ContentAPIKt.playAudio;
/**
* The magic imbue spell.
@@ -61,7 +64,7 @@ public class MagicImbueSpell extends MagicSpell {
player.lock(ANIMATION.getDuration() + 1);
player.graphics(GRAPHIC);
player.animate(ANIMATION);
- player.getAudioManager().send(2888, 1, 1);
+ playAudio(player, Sounds.LUNAR_EMBUE_RUNES_2888);
player.getPacketDispatch().sendMessage("You are charged to combine runes!");
return true;
}
diff --git a/Server/src/main/content/global/skill/magic/lunar/StatBoostSpell.java b/Server/src/main/content/global/skill/magic/lunar/StatBoostSpell.java
index c77e03745..61aeee5f7 100644
--- a/Server/src/main/content/global/skill/magic/lunar/StatBoostSpell.java
+++ b/Server/src/main/content/global/skill/magic/lunar/StatBoostSpell.java
@@ -8,7 +8,6 @@ import core.game.node.Node;
import core.game.node.entity.Entity;
import core.game.node.entity.combat.spell.SpellType;
import core.game.node.entity.player.Player;
-import core.game.node.entity.player.link.audio.Audio;
import core.game.bots.AIPlayer;
import core.game.node.entity.player.link.SpellBookManager.SpellBook;
import core.game.node.item.Item;
@@ -17,9 +16,12 @@ import core.game.world.update.flag.context.Animation;
import core.game.world.update.flag.context.Graphics;
import core.plugin.Initializable;
import core.plugin.Plugin;
+import org.rs09.consts.Sounds;
import java.util.List;
+import static core.api.ContentAPIKt.playGlobalAudio;
+
@Initializable
public final class StatBoostSpell extends MagicSpell {
@@ -70,7 +72,7 @@ public final class StatBoostSpell extends MagicSpell {
continue;
}
o.graphics(GRAPHICS);
- o.getAudioManager().send(new Audio (2902), true);
+ playGlobalAudio(o.getLocation(), Sounds.LUNAR_STRENGTH_SHARE2_2902);
potion.getEffect().activate(o);
size++;
}
@@ -80,7 +82,7 @@ public final class StatBoostSpell extends MagicSpell {
}
super.meetsRequirements(player, true, true);
potion.getEffect().activate(player);
- player.getAudioManager().send(new Audio (2901), true);
+ playGlobalAudio(player.getLocation(), Sounds.LUNAR_STRENGTH_SHARE_2901);
player.animate(ANIMATION);
player.graphics(GRAPHICS);
player.getInventory().remove(item);
diff --git a/Server/src/main/content/global/skill/magic/lunar/StatRestoreSpell.java b/Server/src/main/content/global/skill/magic/lunar/StatRestoreSpell.java
index 89d87f362..1f984d2da 100644
--- a/Server/src/main/content/global/skill/magic/lunar/StatRestoreSpell.java
+++ b/Server/src/main/content/global/skill/magic/lunar/StatRestoreSpell.java
@@ -9,7 +9,6 @@ import core.game.node.Node;
import core.game.node.entity.Entity;
import core.game.node.entity.combat.spell.SpellType;
import core.game.node.entity.player.Player;
-import core.game.node.entity.player.link.audio.Audio;
import core.game.bots.AIPlayer;
import core.game.node.entity.player.link.SpellBookManager.SpellBook;
import core.game.node.item.Item;
@@ -17,9 +16,12 @@ import core.game.world.map.RegionManager;
import core.game.world.update.flag.context.Animation;
import core.game.world.update.flag.context.Graphics;
import core.plugin.Plugin;
+import org.rs09.consts.Sounds;
import java.util.List;
+import static core.api.ContentAPIKt.playGlobalAudio;
+
@Initializable
public class StatRestoreSpell extends MagicSpell {
@@ -87,7 +89,7 @@ public class StatRestoreSpell extends MagicSpell {
}
super.meetsRequirements(player, true, true);
potion.getEffect().activate(player);
- player.getAudioManager().send(new Audio (2899), true);
+ playGlobalAudio(player.getLocation(), Sounds.LUNAR_STAT_SHARE_2899);
player.animate(ANIMATION);
player.graphics(GRAPHICS);
player.getInventory().remove(item);
diff --git a/Server/src/main/content/global/skill/magic/lunar/StatSpySpell.java b/Server/src/main/content/global/skill/magic/lunar/StatSpySpell.java
index 009b0fb5a..4519e870e 100644
--- a/Server/src/main/content/global/skill/magic/lunar/StatSpySpell.java
+++ b/Server/src/main/content/global/skill/magic/lunar/StatSpySpell.java
@@ -15,6 +15,9 @@ import core.game.node.item.Item;
import core.game.world.update.flag.context.Animation;
import core.game.world.update.flag.context.Graphics;
import core.plugin.Plugin;
+import org.rs09.consts.Sounds;
+
+import static core.api.ContentAPIKt.playAudio;
/**
* The stat spy spell.
@@ -72,7 +75,7 @@ public final class StatSpySpell extends MagicSpell {
final Player o = ((Player) target);
player.animate(ANIMATION);
player.face(o);
- player.getAudioManager().send(3620);
+ playAudio(player, Sounds.LUNAR_STAT_SPY_3620);
COMPONENT.setCloseEvent(new CloseEvent() {
@Override
public boolean close(Player player, Component c) {
@@ -82,7 +85,7 @@ public final class StatSpySpell extends MagicSpell {
});
player.graphics(EYE);
o.graphics(GRAPHIC);
- player.getAudioManager().send(3621);
+ playAudio(player, Sounds.LUNAR_STAT_SPY_IMPACT_3621);
for (int[] element : SKILLS) {
player.getPacketDispatch().sendString("" + o.getSkills().getLevel(element[0]) + "", 523, element[1]);
player.getPacketDispatch().sendString("" + o.getSkills().getStaticLevel(element[0]) + "", 523, element[2]);
diff --git a/Server/src/main/content/global/skill/magic/lunar/VengeanceSpell.java b/Server/src/main/content/global/skill/magic/lunar/VengeanceSpell.java
index 5883be295..e06821811 100644
--- a/Server/src/main/content/global/skill/magic/lunar/VengeanceSpell.java
+++ b/Server/src/main/content/global/skill/magic/lunar/VengeanceSpell.java
@@ -13,6 +13,10 @@ import core.game.world.update.flag.context.Animation;
import core.game.world.update.flag.context.Graphics;
import core.plugin.Initializable;
import core.plugin.Plugin;
+import org.rs09.consts.Sounds;
+
+import static core.api.ContentAPIKt.playAudio;
+import static core.api.ContentAPIKt.playGlobalAudio;
/**
* Handles the vengeance (other) spell.
@@ -81,7 +85,7 @@ public final class VengeanceSpell extends MagicSpell {
visualize(entity, p);
entity.setAttribute("vengeance_delay", ticks + 50);
p.setAttribute("vengeance", true);
- p.getAudioManager().send(vengOther ? 2908 : 2907);
+ playGlobalAudio(p.getLocation(), vengOther ? Sounds.LUNAR_VENGENCE_OTHER_2908 : Sounds.LUNAR_VENGENCE_2907);
return true;
}
diff --git a/Server/src/main/content/global/skill/magic/modern/ModernListeners.kt b/Server/src/main/content/global/skill/magic/modern/ModernListeners.kt
index 4ed7ea661..4c35f4a12 100644
--- a/Server/src/main/content/global/skill/magic/modern/ModernListeners.kt
+++ b/Server/src/main/content/global/skill/magic/modern/ModernListeners.kt
@@ -187,7 +187,7 @@ class ModernListeners : SpellListener("modern"){
}
}
visualizeSpell(player,BONE_CONVERT_ANIM, BONE_CONVERT_GFX)
- player.audioManager.send(Audio(114))
+ playAudio(player, Sounds.BONES_TO_BANANAS_ALL_114)
removeRunes(player)
addXP(player,if(bananas) 25.0 else 65.0)
setDelay(player,false)
@@ -223,7 +223,7 @@ class ModernListeners : SpellListener("modern"){
player.lock(3)
removeRunes(player)
addXP(player,53.0)
- player.audioManager.send(Sounds.SUPERHEAT_ALL_190)
+ playAudio(player, Sounds.SUPERHEAT_ALL_190)
showMagicTab(player)
player.pulseManager.run(SmeltingPulse(player, item, bar, 1, true))
setDelay(player,false)
diff --git a/Server/src/main/content/global/skill/magic/modern/TeleblockSpell.java b/Server/src/main/content/global/skill/magic/modern/TeleblockSpell.java
index 1c3fc3f1b..baac8b57d 100644
--- a/Server/src/main/content/global/skill/magic/modern/TeleblockSpell.java
+++ b/Server/src/main/content/global/skill/magic/modern/TeleblockSpell.java
@@ -78,7 +78,7 @@ public final class TeleblockSpell extends CombatSpell {
projectile.transform(entity, (Entity) target, false, 58, 10).send();
}
entity.animate(animation);
- playGlobalAudio(entity.getLocation(), audio.getId(), 20);
+ playGlobalAudio(entity.getLocation(), audio.id, 20);
}
@Override
diff --git a/Server/src/main/content/global/skill/prayer/BoneBuryingOptionPlugin.java b/Server/src/main/content/global/skill/prayer/BoneBuryingOptionPlugin.java
index bf1491456..f11feebe3 100644
--- a/Server/src/main/content/global/skill/prayer/BoneBuryingOptionPlugin.java
+++ b/Server/src/main/content/global/skill/prayer/BoneBuryingOptionPlugin.java
@@ -7,12 +7,14 @@ import core.game.node.entity.skill.Skills;
import core.game.interaction.OptionHandler;
import core.game.node.Node;
import core.game.node.entity.player.Player;
-import core.game.node.entity.player.link.audio.Audio;
import core.game.node.item.Item;
import core.game.system.task.Pulse;
import core.game.world.GameWorld;
import core.game.world.update.flag.context.Animation;
import core.plugin.Plugin;
+import org.rs09.consts.Sounds;
+
+import static core.api.ContentAPIKt.playAudio;
/**
* Represents the bone bury option plugin.
@@ -26,10 +28,6 @@ public final class BoneBuryingOptionPlugin extends OptionHandler {
*/
private static final Animation ANIMATION = new Animation(827);
- /**
- * Represents the sound to use.
- */
- private static final Audio SOUND = new Audio(2738, 10, 1);
@Override
public boolean handle(final Player player, Node node, String option) {
@@ -57,7 +55,7 @@ public final class BoneBuryingOptionPlugin extends OptionHandler {
player.lock(2);
player.animate(ANIMATION);
player.getPacketDispatch().sendMessage("You dig a hole in the ground...");
- player.getAudioManager().send(SOUND);
+ playAudio(player, Sounds.BONES_DOWN_2738);
final Bones bonee = bone;
GameWorld.getPulser().submit(new Pulse(2, player) {
@Override
diff --git a/Server/src/main/content/global/skill/prayer/PrayerAltarPlugin.java b/Server/src/main/content/global/skill/prayer/PrayerAltarPlugin.java
index 9c9a7539e..c9cb114d7 100644
--- a/Server/src/main/content/global/skill/prayer/PrayerAltarPlugin.java
+++ b/Server/src/main/content/global/skill/prayer/PrayerAltarPlugin.java
@@ -14,8 +14,10 @@ import core.game.node.entity.player.link.quest.Quest;
import core.game.world.map.Location;
import core.game.world.update.flag.context.Animation;
import core.plugin.Plugin;
+import org.rs09.consts.Sounds;
import static core.api.ContentAPIKt.hasRequirement;
+import static core.api.ContentAPIKt.playAudio;
/**
* Handles the praying at an alter.
@@ -93,7 +95,7 @@ public class PrayerAltarPlugin extends OptionHandler {
*/
public void visualize(Player player) {
player.lock(3);
- player.getAudioManager().send(2674);
+ playAudio(player, Sounds.PRAYER_RECHARGE_2674);
player.animate(Animation.create(645));
}
diff --git a/Server/src/main/content/global/skill/runecrafting/RuneCraftPulse.java b/Server/src/main/content/global/skill/runecrafting/RuneCraftPulse.java
index 311d023e5..fe97eb3a1 100644
--- a/Server/src/main/content/global/skill/runecrafting/RuneCraftPulse.java
+++ b/Server/src/main/content/global/skill/runecrafting/RuneCraftPulse.java
@@ -12,12 +12,13 @@ import core.game.world.update.flag.context.Animation;
import core.game.world.update.flag.context.Graphics;
import core.tools.RandomFunction;
-import static core.api.ContentAPIKt.inEquipment;
+import static core.api.ContentAPIKt.*;
import static core.game.system.command.sets.StatAttributeKeysKt.STATS_BASE;
import static core.game.system.command.sets.StatAttributeKeysKt.STATS_RC;
-import static core.api.ContentAPIKt.hasRequirement;
+
import core.game.world.GameWorld;
import org.rs09.consts.Items;
+import org.rs09.consts.Sounds;
import java.util.ArrayList;
import java.util.Arrays;
@@ -152,7 +153,7 @@ public final class RuneCraftPulse extends SkillPulse
- {
public void animate() {
player.animate(ANIMATION);
player.graphics(GRAPHICS);
- player.getAudioManager().send(2710);
+ playAudio(player, Sounds.BIND_RUNES_2710);
}
@Override
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 f483a72b7..06c55f1e1 100644
--- a/Server/src/main/content/global/skill/smithing/smelting/SmeltingPulse.java
+++ b/Server/src/main/content/global/skill/smithing/smelting/SmeltingPulse.java
@@ -111,7 +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);
+ playAudio(player, Sounds.FURNACE_2725);
}
}
}
diff --git a/Server/src/main/content/global/skill/summoning/ObeliskOptionPlugin.java b/Server/src/main/content/global/skill/summoning/ObeliskOptionPlugin.java
index bddff2eee..3ecea4dc9 100644
--- a/Server/src/main/content/global/skill/summoning/ObeliskOptionPlugin.java
+++ b/Server/src/main/content/global/skill/summoning/ObeliskOptionPlugin.java
@@ -10,6 +10,9 @@ import core.game.node.entity.player.Player;
import core.game.world.update.flag.context.Animation;
import core.game.world.update.flag.context.Graphics;
import core.plugin.Plugin;
+import org.rs09.consts.Sounds;
+
+import static core.api.ContentAPIKt.playAudio;
/**
* Represents the option used on the summoning obelisk.
@@ -31,7 +34,7 @@ public final class ObeliskOptionPlugin extends OptionHandler {
return true;
}
player.visualize(Animation.create(8502), Graphics.create(1308));
- player.getAudioManager().send(4214);
+ playAudio(player, Sounds.DREADFOWL_BOOST_4214);
player.getSkills().setLevel(Skills.SUMMONING, player.getSkills().getStaticLevel(Skills.SUMMONING));
player.dispatch(new SummoningPointsRechargeEvent(node));
player.getPacketDispatch().sendMessage("You renew your summoning points.");
@@ -39,7 +42,6 @@ public final class ObeliskOptionPlugin extends OptionHandler {
}
return false;
}
-
@Override
public Plugin