Hunter sound improvements

Implemented setup, dismantle, and catching sound for bird snares
Implemented setup, dismantle, and catching sound for box traps
Implemented setup, dismantle, and catching sound for net traps
Implemented setup, dismantle, and catching sound for dead falls
Implemented setup and dismantle sound for rabbit snares
Implemented butterfly net swing sound
Implemented falconry fly and catch sound
Implemented noose sound when catching kebbits
Implemented setup, dismantle, catching, teasing, jumping over, and npc jumping over pitfall sound to pitfalls
Implemented appropriate player lock time to setting up net traps and deadfalls to avoid players from interrupting the action
Implemented appropriate player lock time to dismantling bird snares, box traps, net traps, rabbit snares and deadfalls to avoid players from interrupting the action
Implemented a new function to play sound at a location
This commit is contained in:
Zerken
2023-06-16 06:28:40 +00:00
committed by Ryan
parent 22776e7bb3
commit d04302c99f
8 changed files with 92 additions and 0 deletions
@@ -22,6 +22,7 @@ import org.rs09.consts.NPCs
import core.game.interaction.InteractionListener
import core.game.interaction.IntType
import core.game.world.GameWorld
import org.rs09.consts.Sounds
/*@Initializable
class HunterPitfall : OptionHandler() {
@@ -187,6 +188,7 @@ class PitfallListeners : InteractionListener {
player.setAttribute("pitfall:timestamp:${pit.location.x}:${pit.location.y}", System.currentTimeMillis())
setPitState(player, pit.location, 1)
playAudio(player, getAudio(Sounds.HUNTING_PLACEBRANCHES_2639))
val collapsePulse = object : Pulse(201, player) {
override fun pulse(): Boolean {
val oldTime = player.getAttribute("pitfall:timestamp:${pit.location.x}:${pit.location.y}", System.currentTimeMillis())
@@ -208,6 +210,7 @@ class PitfallListeners : InteractionListener {
if(dir != null) {
val dst = src.transform(dir, 3)
ForceMovement.run(player, src, dst, ForceMovement.WALK_ANIMATION, Animation(1603), dir, 16);
playAudio(player, getAudio(Sounds.HUNTING_JUMP_2635))
val pitfall_npc: Entity? = player.getAttribute("pitfall_npc", null)
if(pitfall_npc != null && pitfall_npc.getLocation().getDistance(src) < 3.0) {
val last_pit_loc: Location? = pitfall_npc.getAttribute("last_pit_loc", null)
@@ -222,6 +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)
pitfall_npc.startDeath(null)
player.removeAttribute("pitfall:timestamp:${pit.location.x}:${pit.location.y}")
player.incrementAttribute("pitfall:count", -1)
@@ -233,6 +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)
pitfall_npc.attack(player)
pitfall_npc.setAttribute("last_pit_loc", pit.location)
}
@@ -242,6 +248,7 @@ class PitfallListeners : InteractionListener {
}
on(SPIKED_PIT, IntType.SCENERY, "dismantle") { player, node ->
val pit = node as Scenery;
playAudio(player, getAudio(Sounds.HUNTING_TAKEBRANCHES_2649))
player.removeAttribute("pitfall:timestamp:${pit.location.x}:${pit.location.y}")
player.incrementAttribute("pitfall:count", -1)
setPitState(player, pit.location, 0)
@@ -274,6 +281,7 @@ class PitfallListeners : InteractionListener {
return@on true
}
entity.attack(player)
playAudio(player, getAudio(Sounds.HUNTING_TEASE_FELINE_2651))
player.setAttribute("pitfall_npc", entity)
return@on true
}
@@ -287,6 +295,7 @@ class PitfallListeners : InteractionListener {
setPitState(player, pit.location, 0)
player.getSkills().addExperience(Skills.HUNTER, xp, true);
player.inventory.add(Item(Items.BIG_BONES_532))
playAudio(player, getAudio(Sounds.HUNTING_TAKEBRANCHES_2649))
// TODO: what's the actual probability of tatty vs perfect fur?
val chance = RandomFunction.getSkillSuccessChance(50.0, 100.0, player.skills.getLevel(Skills.HUNTER))
if(RandomFunction.random(0.0, 100.0) < chance) {