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
|
|
|
}
|
|
|
|
|
|
|
|
auto* destroyable = self->GetComponent<DestroyableComponent>();
|
|
|
|
if (destroyable != nullptr) {
|
2023-10-09 20:33:22 +00:00
|
|
|
Loot::DropLoot(user, self, destroyable->GetLootMatrixID(), 0, 0);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
}
|