mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-12-25 06:00:17 +00:00
Add FlagComponent and msg handlers
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#include "NjNPCMissionSpinjitzuServer.h"
|
||||
#include "Character.h"
|
||||
#include "EntityManager.h"
|
||||
|
||||
#include "eMissionState.h"
|
||||
|
||||
void NjNPCMissionSpinjitzuServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
|
||||
@@ -12,13 +11,11 @@ void NjNPCMissionSpinjitzuServer::OnMissionDialogueOK(Entity* self, Entity* targ
|
||||
|
||||
// Wait for an animation to complete and flag that the player has learned spinjitzu
|
||||
self->AddCallbackTimer(5.0f, [targetID, element]() {
|
||||
auto* target = Game::entityManager->GetEntity(targetID);
|
||||
if (target != nullptr) {
|
||||
auto* character = target->GetCharacter();
|
||||
if (character != nullptr) {
|
||||
character->SetPlayerFlag(ElementFlags.at(element), true);
|
||||
}
|
||||
}
|
||||
GameMessages::SetFlag setFlag{};
|
||||
setFlag.target = targetID;
|
||||
setFlag.iFlagId = ElementFlags.at(element);
|
||||
setFlag.bFlag = true;
|
||||
SEND_ENTITY_MSG(setFlag);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user