Files
ets-module-collection/modules/items/badge-of-justice.ts
2024-01-12 15:59:04 -05:00

28 lines
798 B
TypeScript

/**
* Badge Of Justice Multiplier
* Increases the number of Badges of Justice a player will receive.
*/
/**
* Config
*/
const BADGE_OF_JUSTICE_BONUS = 1;
const HEROIC_FOCUS_AURA = 95000;
const BADGE_OF_JUSTICE_ENTRY = 29434;
const LootToken: player_event_on_loot_item = (event: number, player: Player, item: Item) => {
if(item.GetEntry() == BADGE_OF_JUSTICE_ENTRY) {
player.AddItem(BADGE_OF_JUSTICE_ENTRY, BADGE_OF_JUSTICE_BONUS);
if(player.HasAura(HEROIC_FOCUS_AURA)) {
const randomNumber = Math.floor(Math.random() * 3) + 1;
player.AddItem(BADGE_OF_JUSTICE_ENTRY, randomNumber);
}
}
}
RegisterPlayerEvent(PlayerEvents.PLAYER_EVENT_ON_LOOT_ITEM, (...args) => LootToken(...args));