DarkflameServer/dScripts/Lieutenant.cpp

45 lines
859 B
C++
Raw Permalink Normal View History

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