DarkflameServer/dScripts/ai/FV/FvNinjaGuard.cpp

38 lines
966 B
C++
Raw Normal View History

2022-08-06 03:01:59 +00:00
#include "FvNinjaGuard.h"
#include "GameMessages.h"
#include "MissionComponent.h"
#include "RenderComponent.h"
#include "EntityManager.h"
2022-07-28 13:39:57 +00:00
void FvNinjaGuard::OnStartup(Entity* self) {
if (self->GetLOT() == 7412) {
m_LeftGuard = self->GetObjectID();
2022-07-28 13:39:57 +00:00
} else if (self->GetLOT() == 11128) {
m_RightGuard = self->GetObjectID();
}
}
2022-07-28 13:39:57 +00:00
void FvNinjaGuard::OnEmoteReceived(Entity* self, const int32_t emote, Entity* target) {
if (emote != 392) {
RenderComponent::PlayAnimation(self, u"no");
return;
}
RenderComponent::PlayAnimation(self, u"scared");
2022-07-28 13:39:57 +00:00
if (self->GetLOT() == 7412) {
auto* rightGuard = EntityManager::Instance()->GetEntity(m_RightGuard);
2022-07-28 13:39:57 +00:00
if (rightGuard != nullptr) {
RenderComponent::PlayAnimation(rightGuard, u"laugh_rt");
}
2022-07-28 13:39:57 +00:00
} else if (self->GetLOT() == 11128) {
auto* leftGuard = EntityManager::Instance()->GetEntity(m_LeftGuard);
2022-07-28 13:39:57 +00:00
if (leftGuard != nullptr) {
RenderComponent::PlayAnimation(leftGuard, u"laugh_lt");
}
}
}