Audio refactor continued

Implemented admin audio command ::audio audioId loops[optional]
Implemented admin globalaudio command ::globalaudio audioId radius playername (plays from that players location) or can be used by coords ::globalaudio audioId radius x y z
Refactored the following sounds:
Tribal totem quest Cromperty teleport (fixed looping)
Vinesweeper tool leprechaun teleport sound (Corrected this sound so it does not loop 10 times)
Antifire and poision immunity 30 seconds remaining tick tock sounds and sound of the potions expiring (Fixed it so it plays the correct number of tick tocks)
Sound when summoning a familiar (All familiars were using the summon unicorn sound. It is now defaulted to the normal summoning sound instead of the unicorn summon sound. All familiars on first summon have a their own sounds that will need to be implemented later)
Door and gate sounds
Bank interface sounds
Unicorn stallion special move sound
Agility pyramid rolling block sounds
Prayer book sounds
Lunar stat spy
Hunter falconry
Picking items in a field like potatoes
Ectophial teleport and refill
Summoning pouch creation and renewing points
Runecrafting at altar sound
Making finished and unfinished potions
Cutting gems
Entering giant mole area
Praying at an altar
Warriors guild animator sounds
Chiseling limestone
Spirit wolf special move sound
Telegrab spell sound
Glassblowing sound
Strong of security opening reward chest creaking sound
Butterfly net sound
Desert rug travel rise and descend sound
Enchanting bolts
Woodcutting tree falling and chopping sound
Hunter setting up dismantling traps and pitfall sounds
Explorers ring run energy restore sound
Farming: Raking, adding compost to patch, picking from fruit trees, seed dibb, using plant cure on patch, opening/closing/adding to/from compost bin
Mage training arena alchemy spell sounds
Breaking bones to peaches/bananas tab sound
Casting silver sickle bloom
Entrana magic door teleport
Cabbage teleport
Teleother cast sound
Fairy ring teleport sound
Lunar vengeance spells
Running out of prayer sound
Lunar (non teleport) spells
Super heat and bones to bananas normal spell book sounds
Equip/unequip item sound
Revenant combat sounds
Herb cleaning sound
Emptying buckets/bowls/jugs of water
Making cannonballs at a furnace
Digging with a spade
Peer the seer fremmenik trials challenge: heating items on the range
Blessing a spirit shield at a POH altar
ContentAPI function stun sound
Picking up items off the ground
Eating food sound
Cooking and intentionally burning food
Drinking a potion
Warriors guild catapult
Pulling wilderness teleport levers
Offering bones on a POH altar
Slashing spider webs in Varrock sewers
Entering POH portal teleport sound
GE exchanging item set sound
Jumping wilderness ditch
Dragon axe special
Digging up a farming patch
Lunar heal spells
Chaos elemental projectile impact sounds
Mounted glory teleport
Lunar share and boost potion spell
Dwarf multi cannon setup, rotate, and firing sounds
NPC attacking sound
Enchanted bolt effect combat sound
This commit is contained in:
Zerken
2023-08-24 13:58:19 +00:00
committed by Ryan
parent 00af62e449
commit c52e02936d
109 changed files with 463 additions and 619 deletions
+7 -7
View File
@@ -810,30 +810,30 @@ fun <T> animate(entity: Entity, anim: T, forced: Boolean = false) {
/**
* Plays audio for the player
* @param player the player to play the defined audio for
* @param audio the audio id to play
* @param id the audio id to play
* @param delay the delay in client cycles (50 cycles = 1 second)
* @param loops the number of times to loop audio (for some audio ids it is used to define how many times to loop the audio)
* @param location the location where the audio will play from (The sound will fade with distance)
* @param radius the distance the audio can be heard from the defined location (default = 8 tiles if undefined)
*/
@JvmOverloads
fun playAudio(player: Player, audio: Int, delay: Int = 0, loops: Int = 1, location: Location? = null, radius: Int = 8) {
PacketRepository.send(AudioPacket::class.java, DefaultContext(player, Audio(audio, loops, delay, radius), location))
fun playAudio(player: Player, id: Int, delay: Int = 0, loops: Int = 1, location: Location? = null, radius: Int = Audio.defaultAudioRadius) {
PacketRepository.send(AudioPacket::class.java, DefaultContext(player, Audio(id, delay, loops, radius), location))
}
/**
* Plays audio for players near a defined location
* @param location the location where the audio will play from (The sound will fade with distance)
* @param audio the audio id to play
* @param id the audio id to play
* @param delay the delay in client cycles (50 cycles = 1 second)
* @param loops the number of times to loop audio (for some audio ids it is used to define how many times to loop the audio)
* @param radius the distance the audio can be heard from the defined location (default = 8 tiles if undefined)
*/
@JvmOverloads
fun playGlobalAudio(location: Location, audio: Int, delay: Int = 0, loops: Int = 1, radius: Int = 8) {
fun playGlobalAudio(location: Location, id: Int, delay: Int = 0, loops: Int = 1, radius: Int = Audio.defaultAudioRadius) {
val nearbyPlayers = RegionManager.getLocalPlayers(location, radius)
for (player in nearbyPlayers) {
PacketRepository.send(AudioPacket::class.java, DefaultContext(player, Audio(audio, loops, delay, radius), location))
PacketRepository.send(AudioPacket::class.java, DefaultContext(player, Audio(id, delay, loops, radius), location))
}
}
@@ -2803,7 +2803,7 @@ fun stun(entity: Entity, ticks: Int) {
entity.clocks[Clocks.STUN] = getWorldTicks() + ticks
entity.graphics(Graphics(80, 96))
if (entity is Player) {
entity.audioManager.send(Audio(2727, 1, 0))
playAudio(entity.asPlayer(), Sounds.STUNNED_2727)
entity.animate(Animation(424, Animator.Priority.VERY_HIGH))
sendMessage(entity, "You have been stunned!")
}