mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 21:47:24 +00:00
Merge pull request #531 Add Fong Architect Script
Added the Fong Architect script and split out the Darkitect method into its own file so it can be used across multiple scripts.
This commit is contained in:
commit
427c4a8c33
@ -147,6 +147,7 @@
|
|||||||
#include "FvNinjaGuard.h"
|
#include "FvNinjaGuard.h"
|
||||||
#include "FvPassThroughWall.h"
|
#include "FvPassThroughWall.h"
|
||||||
#include "FvBounceOverWall.h"
|
#include "FvBounceOverWall.h"
|
||||||
|
#include "FvFong.h"
|
||||||
|
|
||||||
// FB Scripts
|
// FB Scripts
|
||||||
#include "AgJetEffectServer.h"
|
#include "AgJetEffectServer.h"
|
||||||
@ -568,6 +569,8 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
|
|||||||
script = new FvPassThroughWall();
|
script = new FvPassThroughWall();
|
||||||
else if (scriptName == "scripts\\ai\\FV\\L_ACT_BOUNCE_OVER_WALL.lua")
|
else if (scriptName == "scripts\\ai\\FV\\L_ACT_BOUNCE_OVER_WALL.lua")
|
||||||
script = new FvBounceOverWall();
|
script = new FvBounceOverWall();
|
||||||
|
else if (scriptName == "scripts\\02_server\\Map\\FV\\L_NPC_FONG.lua")
|
||||||
|
script = new FvFong();
|
||||||
|
|
||||||
//Misc:
|
//Misc:
|
||||||
if (scriptName == "scripts\\02_server\\Map\\General\\L_EXPLODING_ASSET.lua")
|
if (scriptName == "scripts\\02_server\\Map\\General\\L_EXPLODING_ASSET.lua")
|
||||||
|
35
dScripts/Darkitect.cpp
Normal file
35
dScripts/Darkitect.cpp
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
#include "Darkitect.h"
|
||||||
|
#include "MissionComponent.h"
|
||||||
|
#include "DestroyableComponent.h"
|
||||||
|
#include "EntityManager.h"
|
||||||
|
#include "GameMessages.h"
|
||||||
|
#include "Character.h"
|
||||||
|
|
||||||
|
void Darkitect::Reveal(Entity* self, Entity* player)
|
||||||
|
{
|
||||||
|
const auto playerID = player->GetObjectID();
|
||||||
|
|
||||||
|
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"reveal", 0, 0, playerID, "", player->GetSystemAddress());
|
||||||
|
|
||||||
|
self->AddCallbackTimer(20, [this, self, playerID]() {
|
||||||
|
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||||
|
|
||||||
|
if (!player) return;
|
||||||
|
|
||||||
|
auto* destroyableComponent = player->GetComponent<DestroyableComponent>();
|
||||||
|
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||||
|
auto* character = player->GetCharacter();
|
||||||
|
|
||||||
|
if (destroyableComponent != nullptr && missionComponent != nullptr && character != nullptr) {
|
||||||
|
destroyableComponent->SetArmor(0);
|
||||||
|
destroyableComponent->SetHealth(1);
|
||||||
|
destroyableComponent->SetImagination(0);
|
||||||
|
|
||||||
|
if (missionComponent->GetMissionState(1295) == MissionState::MISSION_STATE_ACTIVE) {
|
||||||
|
character->SetPlayerFlag(1911, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityManager::Instance()->SerializeEntity(player);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
9
dScripts/Darkitect.h
Normal file
9
dScripts/Darkitect.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
class Entity;
|
||||||
|
|
||||||
|
class Darkitect
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void Reveal(Entity* self, Entity* player);
|
||||||
|
};
|
12
dScripts/FvFong.cpp
Normal file
12
dScripts/FvFong.cpp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#include "FvFong.h"
|
||||||
|
#include "Darkitect.h"
|
||||||
|
#include "MissionComponent.h"
|
||||||
|
|
||||||
|
void FvFong::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState)
|
||||||
|
{
|
||||||
|
if (missionID == 734 && missionState == MissionState::MISSION_STATE_READY_TO_COMPLETE)
|
||||||
|
{
|
||||||
|
Darkitect Baron;
|
||||||
|
Baron.Reveal(self, target);
|
||||||
|
}
|
||||||
|
}
|
8
dScripts/FvFong.h
Normal file
8
dScripts/FvFong.h
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "CppScripts.h"
|
||||||
|
|
||||||
|
class FvFong : public CppScripts::Script
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState) override;
|
||||||
|
};
|
@ -1,14 +1,11 @@
|
|||||||
#include "NtDarkitectRevealServer.h"
|
#include "NtDarkitectRevealServer.h"
|
||||||
|
#include "Darkitect.h"
|
||||||
#include "MissionComponent.h"
|
#include "MissionComponent.h"
|
||||||
#include "DestroyableComponent.h"
|
|
||||||
#include "EntityManager.h"
|
|
||||||
#include "GameMessages.h"
|
|
||||||
#include "Character.h"
|
|
||||||
|
|
||||||
|
|
||||||
void NtDarkitectRevealServer::OnUse(Entity* self, Entity* user)
|
void NtDarkitectRevealServer::OnUse(Entity* self, Entity* user)
|
||||||
{
|
{
|
||||||
Darkitect(self, user);
|
Darkitect Baron;
|
||||||
|
Baron.Reveal(self, user);
|
||||||
|
|
||||||
auto* missionComponent = user->GetComponent<MissionComponent>();
|
auto* missionComponent = user->GetComponent<MissionComponent>();
|
||||||
|
|
||||||
@ -17,37 +14,3 @@ void NtDarkitectRevealServer::OnUse(Entity* self, Entity* user)
|
|||||||
missionComponent->ForceProgressTaskType(1344, 1, 14293);
|
missionComponent->ForceProgressTaskType(1344, 1, 14293);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NtDarkitectRevealServer::Darkitect(Entity* self, Entity* player)
|
|
||||||
{
|
|
||||||
const auto playerID = player->GetObjectID();
|
|
||||||
|
|
||||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"reveal", 0, 0, playerID, "", player->GetSystemAddress());
|
|
||||||
|
|
||||||
self->AddCallbackTimer(20, [this, self, playerID]() {
|
|
||||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
|
||||||
|
|
||||||
if (player == nullptr)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto* destroyableComponent = player->GetComponent<DestroyableComponent>();
|
|
||||||
auto* missionComponent = player->GetComponent<MissionComponent>();
|
|
||||||
auto* character = player->GetCharacter();
|
|
||||||
|
|
||||||
if (destroyableComponent != nullptr && missionComponent != nullptr && character != nullptr)
|
|
||||||
{
|
|
||||||
destroyableComponent->SetArmor(0);
|
|
||||||
destroyableComponent->SetHealth(1);
|
|
||||||
destroyableComponent->SetImagination(0);
|
|
||||||
|
|
||||||
if (missionComponent->GetMissionState(1295) == MissionState::MISSION_STATE_ACTIVE)
|
|
||||||
{
|
|
||||||
character->SetPlayerFlag(1911, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
EntityManager::Instance()->SerializeEntity(player);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
@ -5,5 +5,4 @@ class NtDarkitectRevealServer : public CppScripts::Script
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void OnUse(Entity* self, Entity* user) override;
|
void OnUse(Entity* self, Entity* user) override;
|
||||||
void Darkitect(Entity* self, Entity* player);
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user