Removed debug code from audio player and fixed issue with gambler chest.

This commit is contained in:
2024-03-02 23:39:18 -05:00
parent f3fbd97d67
commit b97ed8f261
5 changed files with 380 additions and 255 deletions

View File

@@ -2,9 +2,7 @@
let aio: AIO = {};
if(!aio.AddAddon()) {
const audioHandlers = aio.AddHandlers('AIOAudioPlayer', {});
audioHandlers.PlaySingleSound = (sound: string) => {
print("Playing Source Sound: " + sound);
audioHandlers.PlaySingleSound = (sound: string) => {
PlaySoundFile(sound, "Master");
};
}

View File

@@ -107,9 +107,11 @@ const onLootStateChange: gameobject_event_on_loot_state_change = (event: number,
const player = gameObject.GetNearestPlayer(15);
const sound = TrapSounds[Math.floor(Math.random() * TrapSounds.length)];
aio.Handle(player, 'AIOAudioPlayer', 'PlaySingleSound', sound);
player.SendNotification("Your rolled a 1, Critical Fail!");
const players = gameObject.GetPlayersInRange(50);
for(let i = 0; i < players.length; i++) {
const player = players[i];
aio.Handle(player, 'AIOAudioPlayer', 'PlaySingleSound', sound);
}
for(let i =0; i < 20; i++) {
if(player.IsAlive()) {
@@ -119,11 +121,15 @@ const onLootStateChange: gameobject_event_on_loot_state_change = (event: number,
creature1.DespawnOrUnsummon();
} else {
aio.Handle(gameObject.GetNearestPlayer(), 'AIOAudioPlayer', 'PlaySingleSound', LootGoodSound);
const players = gameObject.GetPlayersInRange(50);
for(let i = 0; i < players.length; i++) {
const player = players[i];
aio.Handle(player, 'AIOAudioPlayer', 'PlaySingleSound', LootGoodSound);
}
}
gameObject.RemoveEventById(event);
gameObject.Despawn();
gameObject.RemoveEventById(event);
}
};