2021-12-05 17:54:36 +00:00
|
|
|
#include "FvMaelstromCavalry.h"
|
|
|
|
#include "EntityManager.h"
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
void FvMaelstromCavalry::OnStartup(Entity* self) {
|
|
|
|
for (const auto& group : self->GetGroups()) {
|
|
|
|
const auto& objects = EntityManager::Instance()->GetEntitiesInGroup(group);
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
for (auto* obj : objects) {
|
|
|
|
if (obj->GetLOT() != 8551) continue;
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
obj->OnFireEventServerSide(self, "ISpawned");
|
|
|
|
}
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
void FvMaelstromCavalry::OnDie(Entity* self, Entity* killer) {
|
|
|
|
if (killer == nullptr) {
|
|
|
|
return;
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
if (killer->GetLOT() != 8665) {
|
|
|
|
return;
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
const auto& triggers = EntityManager::Instance()->GetEntitiesInGroup("HorsemenTrigger");
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
for (auto* trigger : triggers) {
|
|
|
|
trigger->OnFireEventServerSide(self, "HorsemenDeath");
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|