2021-12-05 17:54:36 +00:00
|
|
|
#include "NjDragonEmblemChestServer.h"
|
|
|
|
#include "Character.h"
|
2023-01-07 05:17:05 +00:00
|
|
|
#include "EntityInfo.h"
|
|
|
|
#include "Loot.h"
|
|
|
|
#include "Entity.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
#include "DestroyableComponent.h"
|
2023-05-02 22:39:21 +00:00
|
|
|
#include "ePlayerFlag.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
void NjDragonEmblemChestServer::OnUse(Entity* self, Entity* user) {
|
|
|
|
auto* character = user->GetCharacter();
|
|
|
|
if (character != nullptr) {
|
2023-05-02 22:39:21 +00:00
|
|
|
character->SetPlayerFlag(ePlayerFlag::NJ_WU_SHOW_DAILY_CHEST, false);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2023-06-09 08:27:05 +00:00
|
|
|
auto* destroyable = self->GetComponent<DestroyableComponent>();
|
2021-12-05 17:54:36 +00:00
|
|
|
if (destroyable != nullptr) {
|
2021-12-20 10:25:45 +00:00
|
|
|
LootGenerator::Instance().DropLoot(user, self, destroyable->GetLootMatrixID(), 0, 0);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
}
|