2021-12-05 17:54:36 +00:00
|
|
|
#include "NjDragonEmblemChestServer.h"
|
|
|
|
#include "Character.h"
|
|
|
|
#include "DestroyableComponent.h"
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
void NjDragonEmblemChestServer::OnUse(Entity* self, Entity* user) {
|
|
|
|
auto* character = user->GetCharacter();
|
|
|
|
if (character != nullptr) {
|
|
|
|
character->SetPlayerFlag(NJ_WU_SHOW_DAILY_CHEST, false);
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
auto* destroyable = self->GetComponent<DestroyableComponent>();
|
|
|
|
if (destroyable != nullptr) {
|
|
|
|
LootGenerator::Instance().DropLoot(user, self, destroyable->GetLootMatrixID(), 0, 0);
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|