Implement global loot system Fixes #619

This should allow us to emulate lives global tables

The options available to filter tables are min_level, max_level, race,
rare, raid, race, class, bodytype, and zone.

race, class, bodytype, and zone are a pipe | separated list of IDs
This commit is contained in:
Michael Cook (mackal)
2018-02-10 22:15:21 -05:00
parent 0b97db9fd2
commit c5e4bb08f4
23 changed files with 372 additions and 27 deletions
+5 -1
View File
@@ -168,6 +168,8 @@ void Trap::Trigger(Mob* trigger)
auto spawnPosition = randomOffset + glm::vec4(m_Position, 0.0f);
auto new_npc = new NPC(tmp, nullptr, spawnPosition, FlyMode3);
new_npc->AddLootTable();
if (new_npc->DropsGlobalLoot())
new_npc->CheckGlobalLootTables();
entity_list.AddNPC(new_npc);
new_npc->AddToHateList(trigger,1);
}
@@ -191,6 +193,8 @@ void Trap::Trigger(Mob* trigger)
auto spawnPosition = randomOffset + glm::vec4(m_Position, 0.0f);
auto new_npc = new NPC(tmp, nullptr, spawnPosition, FlyMode3);
new_npc->AddLootTable();
if (new_npc->DropsGlobalLoot())
new_npc->CheckGlobalLootTables();
entity_list.AddNPC(new_npc);
new_npc->AddToHateList(trigger,1);
}
@@ -555,4 +559,4 @@ void Trap::UpdateTrap(bool respawn, bool repopnow)
{
database.SetTrapData(this, repopnow);
}
}
}