Add expedition event loot api

Add SetLootEventByNPCTypeID and SetLootEventBySpawnID quest apis

These associate events with npcs or entities inside the dz to prevent
them from being looted by characters that didn't receive the event
lockout from the current expedition.

This fixes an exploit that allowed a player that already had a lockout
from another expedition being added to loot after the event is complete
This commit is contained in:
hg
2020-06-14 19:21:46 -04:00
parent 06d84b83de
commit f97cc7cdec
9 changed files with 143 additions and 28 deletions
-18
View File
@@ -429,24 +429,6 @@ uint32_t ExpeditionDatabase::GetExpeditionIDFromCharacterID(uint32_t character_i
return expedition_id;
}
uint32_t ExpeditionDatabase::GetExpeditionIDFromInstanceID(uint32_t instance_id)
{
LogExpeditionsDetail("Getting expedition id for instance [{}]", instance_id);
uint32_t expedition_id = 0;
auto query = fmt::format(
"SELECT id FROM expedition_details WHERE instance_id = {};", instance_id
);
auto results = database.QueryDatabase(query);
if (results.Success() && results.RowCount() > 0)
{
auto row = results.begin();
expedition_id = std::strtoul(row[0], nullptr, 10);
}
return expedition_id;
}
ExpeditionMember ExpeditionDatabase::GetExpeditionLeader(uint32_t expedition_id)
{
LogExpeditionsDetail("Getting expedition leader for expedition [{}]", expedition_id);