Audio Refactor

1st of many audio refactors, the end goal is removing AudioManager.java and using contentAPI functions for all sound
Refactored playAudio
Refactored playGlobalAudio
Fixed lunar teleport sounds to not play if teleblocked
Refactored the following sounds:
All the special attack and DFS sounds defaulting to new API radius of 8 instead of 5
Dropping coins, item, and destroying object sounds fixed
Ectophial refill sound
Agility pyramid sounds
Emptying a fishbowl
Enchanted jewellery teleport sound
Enchanted jewellery enchant tab sound
All the sounds for Elemental Workshop 1 listeners
The sound when getting experience from a lamp
Blessing and repairing a grave
Hunter pitfall sounds
Hunter sound when catching a kebbit with a noose
Lunar cure me and cure group spell sound
High and low alchemy spells
Silver crafting at a furnace
Spinning at a spinning wheel
Drinking from a waterskin in the desert
Sound when being blessed by drezel in nature's spirit quest
Sound when poison immunity has 30 seconds left and when your immunity expires
Shearing regular sheep and the penguin sheep at lumbridge
Sound when regular spell book charge spell expires
GE sounds: making 0 coin offer when buying, not having enough money, placing a buy offer, not enough room in inventory
Sound when filling vessels from a water source
Regular and ancient combat spells
This commit is contained in:
Zerken
2023-08-20 07:21:24 +00:00
committed by Ryan
parent 7a585796be
commit a105821427
69 changed files with 180 additions and 231 deletions
@@ -8,12 +8,12 @@ import core.game.node.Node
import core.game.node.entity.combat.graves.GraveController
import core.game.node.entity.player.Player
import core.game.node.entity.player.info.login.PlayerParser
import core.game.node.entity.player.link.audio.Audio
import core.game.node.item.GroundItemManager
import core.game.node.item.Item
import core.game.system.config.ItemConfigParser
import content.global.skill.summoning.pet.Pets
import org.rs09.consts.Items
import org.rs09.consts.Sounds
/**
* Represents the item drop/destroy/dissolve handler.
@@ -25,9 +25,9 @@ class DropListener : InteractionListener {
}
companion object {
private val DROP_COINS_SOUND = Audio(10, 1, 0)
private val DROP_ITEM_SOUND = Audio(2739, 1, 0)
private val DESTROY_ITEM_SOUND = Audio(4500, 1, 0)
private val DROP_COINS_SOUND = Sounds.EYEGLO_COIN_10
private val DROP_ITEM_SOUND = Sounds.PUT_DOWN_2739
private val DESTROY_ITEM_SOUND = Sounds.DESTROY_OBJECT_2381
@JvmStatic fun drop(player: Player, item: Item) : Boolean {
return handleDropAction(player, item)
}
@@ -6,7 +6,6 @@ import core.game.node.entity.combat.ImpactHandler
import core.game.node.entity.player.Player
import core.game.node.entity.player.info.Rights
import core.game.node.entity.player.link.IronmanMode
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
@@ -24,6 +23,7 @@ import core.game.world.map.zone.impl.WildernessZone
import core.game.world.repository.Repository
import core.tools.secondsToTicks
import core.tools.colorize
import org.rs09.consts.Sounds
import java.util.Map
import kotlin.math.min
@@ -122,7 +122,7 @@ class GraveController : PersistWorld, TickListener, InteractionListener, Command
player.skills.prayerPoints -= blessAmount
setAttribute(g, "blessed", true)
playAudio(player, Audio(2674))
playAudio(player, Sounds.PRAYER_RECHARGE_2674)
animate(player, 645)
val gOwner = Repository.uid_map[g.ownerUid]
@@ -155,7 +155,7 @@ class GraveController : PersistWorld, TickListener, InteractionListener, Command
player.skills.prayerPoints -= restoreAmount
setAttribute(g, "repaired", true)
playAudio(player, Audio(2674))
playAudio(player, Sounds.PRAYER_RECHARGE_2674)
animate(player, 645)
return true
}
@@ -136,12 +136,12 @@ public abstract class CombatSpell extends MagicSpell {
*/
public void visualizeImpact(Entity entity, Entity target, BattleState state) {
if (state.getEstimatedHit() == -1) {
playGlobalAudio(target.getLocation(), Sounds.SPELLFAIL_227, 1, 20);
playGlobalAudio(target.getLocation(), Sounds.SPELLFAIL_227, 20);
target.graphics(SPLASH_GRAPHIC);
return;
}
target.graphics(endGraphic);
playGlobalAudio(target.getLocation(), impactAudio, 1, 20);
playGlobalAudio(target.getLocation(), impactAudio, 20);
}
@Override
@@ -173,7 +173,7 @@ public abstract class CombatSpell extends MagicSpell {
entity.animate(animation);
}
}
playGlobalAudio(entity.getLocation(), audio.getId(), 1, 20);
playGlobalAudio(entity.getLocation(), audio.getId(), 20);
}
@Override
@@ -20,7 +20,6 @@ import core.tools.RandomFunction;
import java.util.ArrayList;
import java.util.List;
import static core.api.ContentAPIKt.playAudio;
import static core.api.ContentAPIKt.playGlobalAudio;
/**
@@ -161,7 +160,7 @@ public abstract class MagicSpell implements Plugin<SpellType> {
public void visualize(Entity entity, Node target) {
entity.graphics(graphic);
entity.animate(animation);
playGlobalAudio(entity.getLocation(), audio.getId(), 1, 20);
playGlobalAudio(entity.getLocation(), audio.getId(), 20);
}
/**
@@ -5,10 +5,8 @@ import core.api.*
import core.tools.*
import core.game.node.entity.Entity
import core.game.node.entity.player.Player
import core.game.node.entity.combat.ImpactHandler
import core.game.world.repository.Repository
import core.game.node.entity.player.link.audio.Audio
import org.json.simple.*
import org.rs09.consts.Sounds
/**
* A timer that replicates the behavior of poison immunity mechanics. Runs every tick.
@@ -35,11 +33,11 @@ class PoisonImmunity : PersistTimer (1, "poison:immunity", isSoft = true, flags
if (entity is Player && ticksRemaining == secondsToTicks(30)) {
sendMessage(entity, colorize("%RYou have 30 seconds remaining on your poison immunity."))
playAudio(entity, Audio(3120))
playAudio(entity, Sounds.CLOCK_TICK_1_3120, 0, 3)
}
else if (entity is Player && ticksRemaining == 0) {
sendMessage(entity, colorize("%RYour poison immunity has expired."))
playAudio(entity, Audio(2607))
playAudio(entity, Sounds.DRAGON_POTION_FINISHED_2607)
}
return ticksRemaining > 0