DarkflameServer/dScripts/FvMaelstromCavalry.cpp

31 lines
704 B
C++
Raw Permalink Normal View History

#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);
2022-07-28 13:39:57 +00:00
for (auto* obj : objects) {
if (obj->GetLOT() != 8551) continue;
2022-07-28 13:39:57 +00:00
obj->OnFireEventServerSide(self, "ISpawned");
}
}
}
2022-07-28 13:39:57 +00:00
void FvMaelstromCavalry::OnDie(Entity* self, Entity* killer) {
if (killer == nullptr) {
return;
}
2022-07-28 13:39:57 +00:00
if (killer->GetLOT() != 8665) {
return;
}
2022-07-28 13:39:57 +00:00
const auto& triggers = EntityManager::Instance()->GetEntitiesInGroup("HorsemenTrigger");
2022-07-28 13:39:57 +00:00
for (auto* trigger : triggers) {
trigger->OnFireEventServerSide(self, "HorsemenDeath");
}
}