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:
@@ -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(), 1, 20);
|
||||
playGlobalAudio(entity.getLocation(), audio.getId(), 20);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -102,14 +102,14 @@ public final class IceSpells extends CombatSpell {
|
||||
projectile.transform(entity, (Entity) target, false, 58, 10).send();
|
||||
}
|
||||
entity.animate(animation);
|
||||
playGlobalAudio(entity.getLocation(), audio.getId(), 1, 20);
|
||||
playGlobalAudio(entity.getLocation(), audio.getId(), 20);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visualizeImpact(Entity entity, Entity target, BattleState state) {
|
||||
if (state.isFrozen()) {
|
||||
playGlobalAudio(target.getLocation(), impactAudio, 1, 20);
|
||||
playGlobalAudio(target.getLocation(), impactAudio, 20);
|
||||
target.graphics(BARRAGE_ORB);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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(), 1, 20);
|
||||
playGlobalAudio(entity.getLocation(), audio.getId(), 20);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,7 +20,6 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -100,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(), 1, 20);
|
||||
playGlobalAudio(entity.getLocation(), audio.getId(), 20);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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(), 1, 20);
|
||||
playGlobalAudio(entity.getLocation(), audio.getId(), 20);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -77,7 +77,7 @@ public final class HumidifySpell extends MagicSpell {
|
||||
p.lock(ANIMATION.getDuration() + 1);
|
||||
p.animate(ANIMATION);
|
||||
p.graphics(GRAPHIC);
|
||||
playGlobalAudio(p.getLocation(), Sounds.LUNAR_HUMIDIFY_3614, 1, 20);
|
||||
playGlobalAudio(p.getLocation(), Sounds.LUNAR_HUMIDIFY_3614, 20);
|
||||
for (int k = 0; k < 28; k++) {
|
||||
for (int i = 0; i < 21; i++) {
|
||||
if (p.getInventory().contains(EMPTY[i], 1)) {
|
||||
|
||||
@@ -13,7 +13,6 @@ import core.game.node.entity.combat.ImpactHandler
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.player.link.TeleportManager
|
||||
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.node.scenery.Scenery
|
||||
@@ -40,91 +39,91 @@ class LunarListeners : SpellListener("lunar"), Commands {
|
||||
|
||||
onCast(Lunar.MOONCLAN_TELEPORT, NONE) { player, _ ->
|
||||
requires(player,69, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,1), Item(Items.EARTH_RUNE_557,2)))
|
||||
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
sendTeleport(player,66.0, Location.create(2111, 3916, 0))
|
||||
}
|
||||
|
||||
onCast(Lunar.MOONCLAN_GR_TELEPORT, NONE) { player, _ ->
|
||||
requires(player,70, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,1), Item(Items.EARTH_RUNE_557,4)))
|
||||
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
sendGroupTeleport(player,67.0,"Moonclan Island",Location.create(2111, 3916, 0))
|
||||
}
|
||||
|
||||
onCast(Lunar.OURANIA_TELEPORT, NONE) { player, _ ->
|
||||
requires(player,71, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,1), Item(Items.EARTH_RUNE_557,6)))
|
||||
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
sendTeleport(player,69.0, Location.create(2469, 3247, 0))
|
||||
}
|
||||
|
||||
onCast(Lunar.WATERBIRTH_TELEPORT, NONE){ player, _ ->
|
||||
requires(player,72, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563), Item(Items.WATER_RUNE_555)))
|
||||
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
sendTeleport(player,71.0, Location.create(2527, 3739, 0))
|
||||
}
|
||||
|
||||
onCast(Lunar.WATERBIRTH_GR_TELEPORT, NONE) { player, _ ->
|
||||
requires(player,73, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563), Item(Items.WATER_RUNE_555,5)))
|
||||
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
sendGroupTeleport(player,72.0,"Waterbirth Island", Location.create(2527, 3739, 0))
|
||||
}
|
||||
|
||||
onCast(Lunar.BARBARIAN_TELEPORT, NONE) { player, _ ->
|
||||
requires(player,75, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,2), Item(Items.FIRE_RUNE_554,3)))
|
||||
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
sendTeleport(player,76.0, Location.create(2544, 3572, 0))
|
||||
}
|
||||
|
||||
onCast(Lunar.BARBARIAN_GR_TELEPORT, NONE) { player, _ ->
|
||||
requires(player,77, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,2), Item(Items.FIRE_RUNE_554,6)))
|
||||
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
sendGroupTeleport(player,77.0,"Barbarian Outpost", Location.create(2544, 3572, 0))
|
||||
}
|
||||
|
||||
onCast(Lunar.KHAZARD_TELEPORT, NONE) { player, _ ->
|
||||
requires(player,78, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,2), Item(Items.WATER_RUNE_555,4)))
|
||||
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
sendTeleport(player,80.0, Location.create(2656, 3157, 0))
|
||||
}
|
||||
|
||||
onCast(Lunar.KHAZARD_GR_TELEPORT, NONE) { player, _ ->
|
||||
requires(player,79, arrayOf(Item(Items.ASTRAL_RUNE_9075,2), Item(Items.LAW_RUNE_563,2), Item(Items.WATER_RUNE_555,8)))
|
||||
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
sendGroupTeleport(player,81.0, "Port Khazard", Location.create(2656, 3157, 0))
|
||||
}
|
||||
|
||||
onCast(Lunar.FISHING_GUILD_TELEPORT, NONE) { player, _ ->
|
||||
requires(player,85, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,10)))
|
||||
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
sendTeleport(player,89.0, Location.create(2611, 3393, 0))
|
||||
}
|
||||
|
||||
onCast(Lunar.FISHING_GUILD_GR_TELEPORT, NONE) { player, _ ->
|
||||
requires(player,86, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,14)))
|
||||
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
sendGroupTeleport(player,90.0,"Fishing Guild", Location.create(2611, 3393, 0))
|
||||
}
|
||||
|
||||
onCast(Lunar.CATHERBY_TELEPORT, NONE) { player, _ ->
|
||||
requires(player,87, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,10)))
|
||||
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
sendTeleport(player,92.0, Location.create(2804, 3433, 0))
|
||||
}
|
||||
|
||||
onCast(Lunar.CATHERBY_GR_TELEPORT, NONE) { player, _ ->
|
||||
requires(player,88, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,15)))
|
||||
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
sendGroupTeleport(player,93.0,"Catherby", Location.create(2804, 3433, 0))
|
||||
}
|
||||
|
||||
onCast(Lunar.ICE_PLATEAU_TELEPORT, NONE) { player, _ ->
|
||||
requires(player,89, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,8)))
|
||||
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
sendTeleport(player,96.0, Location.create(2972, 3873, 0))
|
||||
}
|
||||
|
||||
onCast(Lunar.ICE_PLATEAU_GR_TELEPORT, NONE) { player, _ ->
|
||||
requires(player,90, arrayOf(Item(Items.ASTRAL_RUNE_9075,3), Item(Items.LAW_RUNE_563,3), Item(Items.WATER_RUNE_555,16)))
|
||||
playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
if (!player.isTeleBlocked) playGlobalAudio(player.location, Sounds.TELEPORT_ALL_200)
|
||||
sendGroupTeleport(player,99.0, "Ice Plateau", Location.create(2972, 3873, 0))
|
||||
}
|
||||
|
||||
@@ -487,7 +486,7 @@ class LunarListeners : SpellListener("lunar"), Commands {
|
||||
visualizeSpell(player, CURE_ME_ANIM, CURE_ME_GFX, 2880)
|
||||
curePoison(player)
|
||||
addXP(player, 69.0)
|
||||
playAudio(player, Audio(2900))
|
||||
playAudio(player, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2900)
|
||||
sendMessage(player, "You have been cured of poison.")
|
||||
}
|
||||
|
||||
@@ -505,7 +504,7 @@ class LunarListeners : SpellListener("lunar"), Commands {
|
||||
}
|
||||
curePoison(acct)
|
||||
sendMessage(acct, "You have been cured of poison.")
|
||||
playAudio(acct, Audio(2889), true)
|
||||
playGlobalAudio(acct.location, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2889)
|
||||
visualize(acct, -1, CURE_GROUP_GFX)
|
||||
}
|
||||
addXP(player, 74.0)
|
||||
@@ -533,7 +532,7 @@ class LunarListeners : SpellListener("lunar"), Commands {
|
||||
player.face(p)
|
||||
visualizeSpell(player, CURE_OTHER_ANIM, CURE_OTHER_GFX, 2886)
|
||||
visualize(p, -1, CURE_OTHER_GFX)
|
||||
playAudio(p, Audio(2889), true)
|
||||
playGlobalAudio(p.location, Sounds.LUNAR_CURE_OTHER_INDIVIDUAL_2889)
|
||||
removeRunes(player, true)
|
||||
curePoison(p)
|
||||
sendMessage(p, "You have been cured of poison.")
|
||||
|
||||
@@ -193,19 +193,19 @@ public final class GodSpells extends CombatSpell {
|
||||
if (state.getEstimatedHit() == -1) {
|
||||
target.graphics(SPLASH_GRAPHIC);
|
||||
if (projectile == SARA_PROJECTILE) {
|
||||
playGlobalAudio(target.getLocation(), Sounds.SARADOMIN_STRIKE_FAIL_1656, 1, 20);
|
||||
playGlobalAudio(target.getLocation(), Sounds.SARADOMIN_STRIKE_FAIL_1656, 20);
|
||||
}
|
||||
if (projectile == GUTHIX_PROJECTILE) {
|
||||
playGlobalAudio(target.getLocation(), Sounds.CLAWS_OF_GUTHIX_FAIL_1652, 1, 20);
|
||||
playGlobalAudio(target.getLocation(), Sounds.CLAWS_OF_GUTHIX_FAIL_1652, 20);
|
||||
}
|
||||
if (projectile == ZAM_PROJECTILE) {
|
||||
playGlobalAudio(target.getLocation(), Sounds.FLAMES_OF_ZAMORAK_FAIL_1654, 1, 20);
|
||||
playGlobalAudio(target.getLocation(), Sounds.FLAMES_OF_ZAMORAK_FAIL_1654, 20);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
target.graphics(endGraphic);
|
||||
playGlobalAudio(target.getLocation(), impactAudio, 1);
|
||||
playGlobalAudio(target.getLocation(), impactAudio);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -256,7 +256,7 @@ class ModernListeners : SpellListener("modern"){
|
||||
player.animate(Animation(if (high) 713 else 712))
|
||||
player.graphics(Graphics(if (high) 113 else 112))
|
||||
}
|
||||
playAudio(player, Audio(if (high) 97 else 98))
|
||||
playAudio(player, if (high) Sounds.HIGH_ALCHEMY_97 else Sounds.LOW_ALCHEMY_98)
|
||||
|
||||
if (coins.amount > 0)
|
||||
player.inventory.add(coins)
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
package content.global.skill.magic.modern
|
||||
|
||||
import core.api.getAudio
|
||||
import core.api.playAudio
|
||||
import core.api.sendMessage
|
||||
import core.api.*
|
||||
import core.game.node.entity.Entity
|
||||
import core.game.node.entity.player.Player
|
||||
import org.rs09.consts.Sounds
|
||||
import core.game.system.timer.PersistTimer
|
||||
|
||||
class SpellCharge : PersistTimer (700, "magic:spellcharge") {
|
||||
override fun run (entity: Entity) : Boolean {
|
||||
if (entity !is Player) return false
|
||||
sendMessage(entity, "Your magical charge fades away.")
|
||||
playAudio(entity, getAudio(1650))
|
||||
playAudio(entity, Sounds.CHARGE_GONE_1650)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(), 1, 20);
|
||||
playGlobalAudio(entity.getLocation(), audio.getId(), 20);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user