Initial NPC script and gating

- TEMP: Adds guilds gating.
- FV Guild Master script added which will toggle the guild UI.
This commit is contained in:
Neal Spellman
2022-12-19 17:51:49 -05:00
parent 2fdcf62ec6
commit 192948a87f
6 changed files with 35 additions and 3 deletions

View File

@@ -139,6 +139,7 @@
#include "TreasureChestDragonServer.h"
#include "InstanceExitTransferPlayerToLastNonInstance.h"
#include "FvFreeGfNinjas.h"
#include "FvGuildCreate.h"
#include "FvPandaServer.h"
#include "FvPandaSpawnerServer.h"
#include "ZoneFvProperty.h"
@@ -569,6 +570,8 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
script = new InstanceExitTransferPlayerToLastNonInstance();
else if (scriptName == "scripts\\ai\\FV\\L_NPC_FREE_GF_NINJAS.lua")
script = new FvFreeGfNinjas();
else if (scriptName == "scripts\\ai\\FV\\L_GUILD_CREATE.lua")
script = new FvGuildCreate();
else if (scriptName == "scripts\\ai\\FV\\L_FV_PANDA_SPAWNER_SERVER.lua")
script = new FvPandaSpawnerServer();
else if (scriptName == "scripts\\ai\\FV\\L_FV_PANDA_SERVER.lua")

View File

@@ -3,6 +3,7 @@ set(DSCRIPTS_SOURCES_AI_FV
"FvFlyingCreviceDragon.cpp"
"FvDragonSmashingGolemQb.cpp"
"FvFreeGfNinjas.cpp"
"FvGuildCreate.cpp"
"FvPandaSpawnerServer.cpp"
"FvPandaServer.cpp"
"FvBrickPuzzleServer.cpp"

View File

@@ -0,0 +1,14 @@
#include "FvGuildCreate.h"
#include "GameMessages.h"
// Server script for Guild Master NPC in FV area.
// This NPC will react to a user interaction and display
// the guild creation screen.
void FvGuildCreate::OnUse(Entity* self, Entity* user) {
AMFStringValue* value = new AMFStringValue();
value->SetStringValue("ToggleGuildCreate");
AMFArrayValue args;
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), value->GetStringValue(), &args);
delete value;
}

View File

@@ -0,0 +1,7 @@
#pragma once
#include "CppScripts.h"
class FvGuildCreate : public CppScripts::Script {
public:
void OnUse(Entity* self, Entity* user) override;
};