mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-21 21:17:25 +00:00
Test frakjaw fix
This commit is contained in:
parent
9440af0d67
commit
7d40585211
@ -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());
|
||||
|
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user