mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-22 12:18:27 +00:00
[Loot] Add #lootsim (Loot Simulator) command (#2375)
* [Loot] Add #lootsim (Loot Simulator) command * Validation * Add global loot
This commit is contained in:
@@ -264,6 +264,7 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
|
||||
HasAISpell = false;
|
||||
HasAISpellEffects = false;
|
||||
innate_proc_spell_id = 0;
|
||||
m_record_loot_stats = false;
|
||||
|
||||
if (GetClass() == MERCENARY_MASTER && RuleB(Mercs, AllowMercs)) {
|
||||
LoadMercTypes();
|
||||
@@ -3689,3 +3690,35 @@ std::vector<int> NPC::GetLootList() {
|
||||
}
|
||||
return npc_items;
|
||||
}
|
||||
|
||||
bool NPC::IsRecordLootStats() const
|
||||
{
|
||||
return m_record_loot_stats;
|
||||
}
|
||||
|
||||
void NPC::SetRecordLootStats(bool record_loot_stats)
|
||||
{
|
||||
NPC::m_record_loot_stats = record_loot_stats;
|
||||
}
|
||||
|
||||
void NPC::FlushLootStats()
|
||||
{
|
||||
m_rolled_items = {};
|
||||
}
|
||||
|
||||
const std::vector<uint32> &NPC::GetRolledItems() const
|
||||
{
|
||||
return m_rolled_items;
|
||||
}
|
||||
|
||||
int NPC::GetRolledItemCount(uint32 item_id)
|
||||
{
|
||||
int rolled_count = 0;
|
||||
for (auto &e: m_rolled_items) {
|
||||
if (item_id == e) {
|
||||
rolled_count++;
|
||||
}
|
||||
}
|
||||
|
||||
return rolled_count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user