Parrot crash script to become a sneaky ninja and steal the pirate's booty (#752)

This commit is contained in:
Aaron Kimbrell 2022-08-26 22:58:41 -05:00 committed by GitHub
parent 500b7885e2
commit b70e7334e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 0 deletions

View File

@ -116,6 +116,7 @@ set(DSCRIPT_SOURCES "ActivityManager.cpp"
"GfJailWalls.cpp"
"GfMaelstromGeyser.cpp"
"GfOrgan.cpp"
"GfParrotCrash.cpp"
"GfTikiTorch.cpp"
"GrowingFlower.cpp"
"HydrantBroken.cpp"

View File

@ -119,6 +119,7 @@
#include "GfArchway.h"
#include "GfMaelstromGeyser.h"
#include "PirateRep.h"
#include "GfParrotCrash.h"
// SG Scripts
#include "SGCannon.h"
@ -504,6 +505,8 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
script = new GfMaelstromGeyser();
else if (scriptName == "scripts\\ai\\GF\\L_PIRATE_REP.lua")
script = new PirateRep();
else if (scriptName == "scripts\\ai\\GF\\L_GF_PARROT_CRASH.lua")
script = new GfParrotCrash();
// SG
else if (scriptName == "scripts\\ai\\MINIGAME\\SG_GF\\SERVER\\SG_CANNON.lua")

View File

@ -0,0 +1,13 @@
#include "GfParrotCrash.h"
#include "SkillComponent.h"
#include "Entity.h"
#include "dLogger.h"
void GfParrotCrash::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) {
auto* skillComponent = self->GetComponent<SkillComponent>();
if (args == "Slow") {
skillComponent->CalculateBehavior(m_SlowSkillID, m_SlowBehaviorID, sender->GetObjectID());
} else if (args == "Unslow") {
skillComponent->CalculateBehavior(m_UnslowSkillID, m_UnslowBehaviorID, sender->GetObjectID());
}
}

13
dScripts/GfParrotCrash.h Normal file
View File

@ -0,0 +1,13 @@
#pragma once
#include "CppScripts.h"
class GfParrotCrash : public CppScripts::Script {
public:
void OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) override;
private:
const uint32_t m_SlowSkillID = 795;
const uint32_t m_SlowBehaviorID = 14214;
const uint32_t m_UnslowSkillID = 796;
const uint32_t m_UnslowBehaviorID = 14215;
};