mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-04-27 00:56:30 +00:00
19 lines
555 B
C++
19 lines
555 B
C++
#include "NjDragonEmblemChestServer.h"
|
|
#include "Loot.h"
|
|
#include "Entity.h"
|
|
#include "DestroyableComponent.h"
|
|
#include "ePlayerFlag.h"
|
|
|
|
void NjDragonEmblemChestServer::OnUse(Entity* self, Entity* user) {
|
|
GameMessages::SetFlag setFlag{};
|
|
setFlag.target = user->GetObjectID();
|
|
setFlag.iFlagId = ePlayerFlag::NJ_WU_SHOW_DAILY_CHEST;
|
|
setFlag.bFlag = false;
|
|
SEND_ENTITY_MSG(setFlag);
|
|
|
|
auto* destroyable = self->GetComponent<DestroyableComponent>();
|
|
if (destroyable != nullptr) {
|
|
Loot::DropLoot(user, self, destroyable->GetLootMatrixID(), 0, 0);
|
|
}
|
|
}
|