Add FV Geyser script (#748)

* Add FV Geyser script

* remove uneeded include

* const
This commit is contained in:
Aaron Kimbrell 2022-08-25 15:50:13 -05:00 committed by GitHub
parent ceb374591f
commit e707207ffa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 0 deletions

View File

@ -99,6 +99,7 @@ set(DSCRIPT_SOURCES "ActivityManager.cpp"
"FvFreeGfNinjas.cpp" "FvFreeGfNinjas.cpp"
"FvHorsemenTrigger.cpp" "FvHorsemenTrigger.cpp"
"FvMaelstromCavalry.cpp" "FvMaelstromCavalry.cpp"
"FvMaelstromGeyser.cpp"
"FvMaelstromDragon.cpp" "FvMaelstromDragon.cpp"
"FvNinjaGuard.cpp" "FvNinjaGuard.cpp"
"FvPandaServer.cpp" "FvPandaServer.cpp"

View File

@ -147,6 +147,7 @@
#include "FvPassThroughWall.h" #include "FvPassThroughWall.h"
#include "FvBounceOverWall.h" #include "FvBounceOverWall.h"
#include "FvFong.h" #include "FvFong.h"
#include "FvMaelstromGeyser.h"
// FB Scripts // FB Scripts
#include "AgJetEffectServer.h" #include "AgJetEffectServer.h"
@ -576,6 +577,9 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
script = new FvBounceOverWall(); script = new FvBounceOverWall();
else if (scriptName == "scripts\\02_server\\Map\\FV\\L_NPC_FONG.lua") else if (scriptName == "scripts\\02_server\\Map\\FV\\L_NPC_FONG.lua")
script = new FvFong(); script = new FvFong();
else if (scriptName == "scripts\\ai\\FV\\L_FV_MAELSTROM_GEYSER.lua") {
script = new FvMaelstromGeyser();
}
//Misc: //Misc:
if (scriptName == "scripts\\02_server\\Map\\General\\L_EXPLODING_ASSET.lua") if (scriptName == "scripts\\02_server\\Map\\General\\L_EXPLODING_ASSET.lua")

View File

@ -0,0 +1,18 @@
#include "FvMaelstromGeyser.h"
#include "SkillComponent.h"
void FvMaelstromGeyser::OnStartup(Entity* self) {
self->AddTimer(m_StartSkillTimerName, m_StartSkillTimerTime);
self->AddTimer(m_KillSelfTimerName, m_KillSelfTimerTime);
}
void FvMaelstromGeyser::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == m_StartSkillTimerName) {
auto* skillComponent = self->GetComponent<SkillComponent>();
skillComponent->CalculateBehavior(m_SkillID, m_BehaviorID, LWOOBJID_EMPTY, true);
}
if (timerName == m_KillSelfTimerName) {
self->Smash(LWOOBJID_EMPTY, eKillType::SILENT);
}
}

View File

@ -0,0 +1,18 @@
#pragma once
#include "CppScripts.h"
class FvMaelstromGeyser final : public CppScripts::Script
{
public:
void OnStartup(Entity* self) override;
void OnTimerDone(Entity* self, std::string timerName) override;
private:
const std::string m_StartSkillTimerName = "startSkill";
const float m_StartSkillTimerTime = 2.0;
const std::string m_KillSelfTimerName = "killSelf";
const float m_KillSelfTimerTime = 5.5;
const uint32_t m_SkillID = 831;
const uint32_t m_BehaviorID = 15500;
};