mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-30 17:58:16 +00:00
Add hot_zone filtering for global loot
We do this in GlobalLootEntry::PassesRules since we want to check if the hot zone status changes during run time Value can be null, if null it's not checked. If the value is 0 the zone must not be a hot zone (I guess one might want that) and if it's not 0, the zone must be a hot zone
This commit is contained in:
+6
-1
@@ -464,7 +464,7 @@ void NPC::CheckGlobalLootTables()
|
||||
void ZoneDatabase::LoadGlobalLoot()
|
||||
{
|
||||
auto query = StringFormat("SELECT id, loottable_id, description, min_level, max_level, rare, raid, race, "
|
||||
"class, bodytype, zone FROM global_loot WHERE enabled = 1");
|
||||
"class, bodytype, zone, hot_zone FROM global_loot WHERE enabled = 1");
|
||||
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success() || results.RowCount() == 0)
|
||||
@@ -482,6 +482,7 @@ void ZoneDatabase::LoadGlobalLoot()
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
GlobalLootEntry e(atoi(row[0]), atoi(row[1]), row[2] ? row[2] : "");
|
||||
|
||||
auto min_level = atoi(row[3]);
|
||||
@@ -521,6 +522,10 @@ void ZoneDatabase::LoadGlobalLoot()
|
||||
e.AddRule(GlobalLoot::RuleTypes::BodyType, std::stoi(b));
|
||||
}
|
||||
|
||||
// null is not used
|
||||
if (row[11])
|
||||
e.AddRule(GlobalLoot::RuleTypes::HotZone, atoi(row[11]));
|
||||
|
||||
zone->AddGlobalLootEntry(e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user