2021-12-05 17:54:36 +00:00
|
|
|
#include "Lieutenant.h"
|
|
|
|
#include "SkillComponent.h"
|
|
|
|
#include "dZoneManager.h"
|
|
|
|
|
|
|
|
void Lieutenant::OnStartup(Entity* self) {
|
2023-06-07 07:23:50 +00:00
|
|
|
auto skillComponent = self->GetComponent<SkillComponent>();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
if (skillComponent == nullptr) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
skillComponent->CalculateBehavior(1127, 24812, self->GetObjectID(), true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Lieutenant::OnDie(Entity* self, Entity* killer) {
|
|
|
|
const auto myLOT = self->GetLOT();
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
std::string spawnerName;
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
switch (myLOT) {
|
|
|
|
case 16047:
|
|
|
|
spawnerName = "EarthShrine_ERail";
|
|
|
|
break;
|
|
|
|
case 16050:
|
|
|
|
spawnerName = "IceShrine_QBBouncer";
|
|
|
|
break;
|
|
|
|
case 16049:
|
|
|
|
spawnerName = "LightningShrine_LRail";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
const auto spawners = dZoneManager::Instance()->GetSpawnersByName(spawnerName);
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
if (spawners.empty()) {
|
|
|
|
return;
|
|
|
|
}
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
for (auto* spawner : spawners) {
|
|
|
|
spawner->Reset();
|
|
|
|
spawner->Activate();
|
|
|
|
}
|
|
|
|
}
|