DarkflameServer/dScripts/ai/FV/FvNinjaGuard.cpp

36 lines
914 B
C++
Raw Normal View History

2022-08-06 03:01:59 +00:00
#include "FvNinjaGuard.h"
#include "GameMessages.h"
#include "MissionComponent.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) {
GameMessages::SendPlayAnimation(self, u"no");
return;
}
GameMessages::SendPlayAnimation(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) {
GameMessages::SendPlayAnimation(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) {
GameMessages::SendPlayAnimation(leftGuard, u"laugh_lt");
}
}
}