mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-25 15:07:28 +00:00
Added script for Friend of the Ninja mission (#406)
* Added script for Friend of the Ninja mission * Added comments
This commit is contained in:
parent
6ba9eea993
commit
828c457614
@ -145,6 +145,7 @@
|
||||
#include "ImgBrickConsoleQB.h"
|
||||
#include "ActParadoxPipeFix.h"
|
||||
#include "FvNinjaGuard.h"
|
||||
#include "FvPassThroughWall.h"
|
||||
#include "FvBounceOverWall.h"
|
||||
|
||||
// FB Scripts
|
||||
@ -557,6 +558,8 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
|
||||
script = new ActParadoxPipeFix();
|
||||
else if (scriptName == "scripts\\ai\\FV\\L_FV_NINJA_GUARDS.lua")
|
||||
script = new FvNinjaGuard();
|
||||
else if (scriptName == "scripts\\ai\\FV\\L_ACT_PASS_THROUGH_WALL.lua")
|
||||
script = new FvPassThroughWall();
|
||||
else if (scriptName == "scripts\\ai\\FV\\L_ACT_BOUNCE_OVER_WALL.lua")
|
||||
script = new FvBounceOverWall();
|
||||
|
||||
|
17
dScripts/FvPassThroughWall.cpp
Normal file
17
dScripts/FvPassThroughWall.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
#include "FvPassThroughWall.h"
|
||||
#include "InventoryComponent.h"
|
||||
|
||||
void FvPassThroughWall::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
auto missionComponent = target->GetComponent<MissionComponent>();
|
||||
if (missionComponent == nullptr) return;
|
||||
|
||||
//Because at the moment we do not have an ItemComponent component, we check to make sure a Maelstrom-Infused hood is equipped. There are only three in the game right now.
|
||||
auto inventoryComponent = target->GetComponent<InventoryComponent>();
|
||||
// If no inventory component is found then abort.
|
||||
if (inventoryComponent == nullptr) return;
|
||||
// If no Maelstrom hoods are equipped then abort.
|
||||
if (!inventoryComponent->IsEquipped(WhiteMaelstromHood) && !inventoryComponent->IsEquipped(BlackMaelstromHood) && !inventoryComponent->IsEquipped(RedMaelstromHood)) return;
|
||||
|
||||
// Progress mission Friend of the Ninja since all prerequisites are met.
|
||||
missionComponent->ForceProgress(friendOfTheNinjaMissionId, friendOfTheNinjaMissionUid, 1);
|
||||
}
|
34
dScripts/FvPassThroughWall.h
Normal file
34
dScripts/FvPassThroughWall.h
Normal file
@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class FvPassThroughWall : public CppScripts::Script
|
||||
{
|
||||
/**
|
||||
* @brief This method is called when there is a collision with self from target.
|
||||
*
|
||||
* @param self The Entity that called this method.
|
||||
* @param target The Entity that self is targetting.
|
||||
*/
|
||||
void OnCollisionPhantom(Entity* self, Entity* target) override;
|
||||
private:
|
||||
/**
|
||||
* Mission ID for Friend of the Ninjas.
|
||||
*/
|
||||
int32_t friendOfTheNinjaMissionId = 848;
|
||||
/**
|
||||
* Mission UID for Friend of the Ninjas.
|
||||
*/
|
||||
int32_t friendOfTheNinjaMissionUid = 1221;
|
||||
/**
|
||||
* Item LOT for Maelstrom-Infused White Ninja Hood
|
||||
*/
|
||||
int32_t WhiteMaelstromHood = 2641;
|
||||
/**
|
||||
* Item LOT for Maelstrom-Infused Black Ninja Hood
|
||||
*/
|
||||
int32_t BlackMaelstromHood = 2642;
|
||||
/**
|
||||
* Item LOT for Red Ninja Hood - Maelstrom Infused
|
||||
*/
|
||||
int32_t RedMaelstromHood = 1889;
|
||||
};
|
Loading…
Reference in New Issue
Block a user