mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-12 19:28:21 +00:00
Add GF geyser script (#749)
* Add GF geyser script * remove uneeeded include * const
This commit is contained in:
parent
e707207ffa
commit
47f0830483
@ -114,6 +114,7 @@ set(DSCRIPT_SOURCES "ActivityManager.cpp"
|
||||
"GfCaptainsCannon.cpp"
|
||||
"GfJailkeepMission.cpp"
|
||||
"GfJailWalls.cpp"
|
||||
"GfMaelstromGeyser.cpp"
|
||||
"GfOrgan.cpp"
|
||||
"GfTikiTorch.cpp"
|
||||
"GrowingFlower.cpp"
|
||||
|
@ -117,6 +117,7 @@
|
||||
#include "GfApeSmashingQB.h"
|
||||
#include "ZoneGfProperty.h"
|
||||
#include "GfArchway.h"
|
||||
#include "GfMaelstromGeyser.h"
|
||||
|
||||
// SG Scripts
|
||||
#include "SGCannon.h"
|
||||
@ -496,9 +497,10 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
|
||||
script = new GfApeSmashingQB();
|
||||
else if (scriptName == "scripts\\zone\\PROPERTY\\GF\\L_ZONE_GF_PROPERTY.lua")
|
||||
script = new ZoneGfProperty();
|
||||
else if (scriptName == "scripts\\ai\\GF\\L_GF_ARCHWAY.lua") {
|
||||
else if (scriptName == "scripts\\ai\\GF\\L_GF_ARCHWAY.lua")
|
||||
script = new GfArchway();
|
||||
}
|
||||
else if (scriptName == "scripts\\ai\\GF\\L_GF_MAELSTROM_GEYSER.lua")
|
||||
script = new GfMaelstromGeyser();
|
||||
|
||||
// SG
|
||||
else if (scriptName == "scripts\\ai\\MINIGAME\\SG_GF\\SERVER\\SG_CANNON.lua")
|
||||
|
18
dScripts/GfMaelstromGeyser.cpp
Normal file
18
dScripts/GfMaelstromGeyser.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include "GfMaelstromGeyser.h"
|
||||
#include "SkillComponent.h"
|
||||
|
||||
void GfMaelstromGeyser::OnStartup(Entity* self) {
|
||||
self->AddTimer(m_StartSkillTimerName, m_StartSkillTimerTime);
|
||||
self->AddTimer(m_KillSelfTimerName, m_KillSelfTimerTime);
|
||||
}
|
||||
|
||||
void GfMaelstromGeyser::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);
|
||||
}
|
||||
}
|
||||
|
17
dScripts/GfMaelstromGeyser.h
Normal file
17
dScripts/GfMaelstromGeyser.h
Normal file
@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class GfMaelstromGeyser 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 = 7.5;
|
||||
const uint32_t m_SkillID = 607;
|
||||
const uint32_t m_BehaviorID = 10500;
|
||||
};
|
Loading…
Reference in New Issue
Block a user