mirror of
https://github.com/DarkflameUniverse/DarkflameServer
synced 2024-08-30 18:43:58 +00:00
Add FV Geyser script (#748)
* Add FV Geyser script * remove uneeded include * const
This commit is contained in:
parent
ceb374591f
commit
e707207ffa
@ -99,6 +99,7 @@ set(DSCRIPT_SOURCES "ActivityManager.cpp"
|
||||
"FvFreeGfNinjas.cpp"
|
||||
"FvHorsemenTrigger.cpp"
|
||||
"FvMaelstromCavalry.cpp"
|
||||
"FvMaelstromGeyser.cpp"
|
||||
"FvMaelstromDragon.cpp"
|
||||
"FvNinjaGuard.cpp"
|
||||
"FvPandaServer.cpp"
|
||||
|
@ -147,6 +147,7 @@
|
||||
#include "FvPassThroughWall.h"
|
||||
#include "FvBounceOverWall.h"
|
||||
#include "FvFong.h"
|
||||
#include "FvMaelstromGeyser.h"
|
||||
|
||||
// FB Scripts
|
||||
#include "AgJetEffectServer.h"
|
||||
@ -576,6 +577,9 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
|
||||
script = new FvBounceOverWall();
|
||||
else if (scriptName == "scripts\\02_server\\Map\\FV\\L_NPC_FONG.lua")
|
||||
script = new FvFong();
|
||||
else if (scriptName == "scripts\\ai\\FV\\L_FV_MAELSTROM_GEYSER.lua") {
|
||||
script = new FvMaelstromGeyser();
|
||||
}
|
||||
|
||||
//Misc:
|
||||
if (scriptName == "scripts\\02_server\\Map\\General\\L_EXPLODING_ASSET.lua")
|
||||
|
18
dScripts/FvMaelstromGeyser.cpp
Normal file
18
dScripts/FvMaelstromGeyser.cpp
Normal 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);
|
||||
}
|
||||
}
|
||||
|
18
dScripts/FvMaelstromGeyser.h
Normal file
18
dScripts/FvMaelstromGeyser.h
Normal 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;
|
||||
};
|
Loading…
Reference in New Issue
Block a user