mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-23 05:57:20 +00:00
8d37d9b681
* Organize dScripts whitespace Remove parent scope Remove parent scope from initial setter Remove debug Remove helper programs * Fix NtImagimeterVisibility script Co-authored-by: aronwk-aaron <aronwk.aaron@gmail.com>
31 lines
834 B
C++
31 lines
834 B
C++
#include "FvDragonSmashingGolemQb.h"
|
|
#include "GameMessages.h"
|
|
#include "EntityManager.h"
|
|
|
|
void FvDragonSmashingGolemQb::OnStartup(Entity* self) {
|
|
self->AddTimer("GolemBreakTimer", 10.5f);
|
|
}
|
|
|
|
void FvDragonSmashingGolemQb::OnTimerDone(Entity* self, std::string timerName) {
|
|
if (timerName == "GolemBreakTimer") {
|
|
self->Smash();
|
|
}
|
|
}
|
|
|
|
void FvDragonSmashingGolemQb::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
|
if (state == eRebuildState::REBUILD_COMPLETED) {
|
|
GameMessages::SendPlayAnimation(self, u"dragonsmash");
|
|
|
|
const auto dragonId = self->GetVar<LWOOBJID>(u"Dragon");
|
|
|
|
auto* dragon = EntityManager::Instance()->GetEntity(dragonId);
|
|
|
|
if (dragon != nullptr) {
|
|
dragon->OnFireEventServerSide(self, "rebuildDone");
|
|
}
|
|
|
|
self->CancelTimer("GolemBreakTimer");
|
|
self->AddTimer("GolemBreakTimer", 10.5f);
|
|
}
|
|
}
|