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
+8
View File
@@ -210,6 +210,8 @@ Mob* QuestManager::spawn2(int npc_type, int grid, int unused, const glm::vec4& p
{
auto npc = new NPC(tmp, nullptr, position, FlyMode3);
npc->AddLootTable();
if (npc->DropsGlobalLoot())
npc->CheckGlobalLootTables();
entity_list.AddNPC(npc,true,true);
if(grid > 0)
{
@@ -232,6 +234,8 @@ Mob* QuestManager::unique_spawn(int npc_type, int grid, int unused, const glm::v
{
auto npc = new NPC(tmp, nullptr, position, FlyMode3);
npc->AddLootTable();
if (npc->DropsGlobalLoot())
npc->CheckGlobalLootTables();
entity_list.AddNPC(npc,true,true);
if(grid > 0)
{
@@ -308,6 +312,8 @@ Mob* QuestManager::spawn_from_spawn2(uint32 spawn2_id)
found_spawn->SetNPCPointer(npc);
npc->AddLootTable();
if (npc->DropsGlobalLoot())
npc->CheckGlobalLootTables();
npc->SetSp2(found_spawn->SpawnGroupID());
entity_list.AddNPC(npc);
entity_list.LimitAddNPC(npc);
@@ -1656,6 +1662,8 @@ void QuestManager::respawn(int npcTypeID, int grid) {
{
owner = new NPC(npcType, nullptr, owner->GetPosition(), FlyMode3);
owner->CastToNPC()->AddLootTable();
if (owner->CastToNPC()->DropsGlobalLoot())
owner->CastToNPC()->CheckGlobalLootTables();
entity_list.AddNPC(owner->CastToNPC(),true,true);
if(grid > 0)
owner->CastToNPC()->AssignWaypoints(grid);