Test frakjaw fix

This commit is contained in:
Jett 2021-12-24 01:14:15 +00:00
parent 9440af0d67
commit 7d40585211
2 changed files with 16 additions and 3 deletions

View File

@ -18,14 +18,24 @@ void MinigameTreasureChestServer::OnUse(Entity *self, Entity *user) {
UpdatePlayer(self, user->GetObjectID());
auto* team = TeamManager::Instance()->GetTeam(user->GetObjectID());
uint32_t activityRating = 0;
if (team != nullptr) {
for (const auto& teamMemberID : team->members) {
auto* teamMember = EntityManager::Instance()->GetEntity(teamMemberID);
if (teamMember != nullptr)
LootGenerator::Instance().DropActivityLoot(teamMember, self, sac->GetActivityID(), CalculateActivityRating(self, teamMemberID));
if (teamMember != nullptr) {
activityRating = CalculateActivityRating(self, teamMemberID);
if (self->GetLOT() == frakjawChestId) activityRating = team->members.size();
LootGenerator::Instance().DropActivityLoot(teamMember, self, sac->GetActivityID(), activityRating);
}
}
} else {
LootGenerator::Instance().DropActivityLoot(user, self, sac->GetActivityID(), CalculateActivityRating(self, user->GetObjectID()));
activityRating = CalculateActivityRating(self, user->GetObjectID());
if (self->GetLOT() == frakjawChestId) activityRating = 1;
LootGenerator::Instance().DropActivityLoot(user, self, sac->GetActivityID(), activityRating);
}
sac->PlayerRemove(user->GetObjectID());

View File

@ -2,7 +2,10 @@
#include "ActivityManager.h"
class MinigameTreasureChestServer : public ActivityManager {
public:
void OnStartup(Entity* self) override;
void OnUse(Entity* self, Entity* user) override;
uint32_t CalculateActivityRating(Entity *self, LWOOBJID playerID) override;
private:
const uint32_t frakjawChestId = 16486;
};