Merge remote-tracking branch 'upstream/main' into PetFixes

This commit is contained in:
jadebenn
2024-03-05 23:02:35 -06:00
105 changed files with 1679 additions and 1029 deletions

View File

@@ -30,15 +30,28 @@ endforeach()
add_subdirectory(Pets)
add_library(dScriptsServer STATIC ${DSCRIPTS_SOURCES_02_SERVER})
target_include_directories(dScriptsServer PUBLIC "."
add_library(dScriptsServerBase OBJECT ${DSCRIPTS_SOURCES_02_SERVER})
target_include_directories(dScriptsServerBase PUBLIC "."
"DLU"
"Equipment"
"Minigame"
"Minigame/General"
"Objects"
"Pets")
)
target_precompile_headers(dScriptsServerBase REUSE_FROM dScriptsBase)
add_library(dScriptsServer INTERFACE)
target_sources(dScriptsServer INTERFACE
$<TARGET_OBJECTS:dScriptsServerBase>
$<TARGET_OBJECTS:dScriptsServerEnemy>
$<TARGET_OBJECTS:dScriptsServerPets>
)
target_link_libraries(dScriptsServer INTERFACE
dScriptsServerEnemy
dScriptsServerMap)
target_precompile_headers(dScriptsServer REUSE_FROM dScriptsBase)
dScriptsServerMap
)
target_include_directories(dScriptsServer INTERFACE
$<TARGET_PROPERTY:dScriptsServerBase,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsServerEnemy,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsServerMap,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsServerPets,INTERFACE_INCLUDE_DIRECTORIES>
)

View File

@@ -5,20 +5,17 @@
#include "RenderComponent.h"
void DLUVanityTeleportingObject::OnStartup(Entity* self) {
if (!self->HasVar(u"npcName") || !self->HasVar(u"teleport")) return;
m_Object = VanityUtilities::GetObject(self->GetVarAsString(u"npcName"));
if (!self->HasVar(u"npcName")) return;
m_Object = VanityUtilities::GetObject(self->GetVarAsString(u"npcName"));
if (!m_Object) return;
if (self->HasVar(u"teleportInterval")) m_TeleportInterval = self->GetVar<float>(u"teleportInterval");
if (self->GetVar<bool>(u"teleport")) {
self->AddTimer("setupTeleport", m_TeleportInterval);
}
self->AddTimer("setupTeleport", m_TeleportInterval);
}
void DLUVanityTeleportingObject::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "setupTeleport") {
RenderComponent::PlayAnimation(self, u"interact");
GameMessages::SendPlayFXEffect(self->GetObjectID(), 6478, u"teleportBeam", "teleportBeam");
GameMessages::SendPlayFXEffect(self->GetObjectID(), 6478, u"teleportRings", "teleportRings");
@@ -40,7 +37,6 @@ void DLUVanityTeleportingObject::OnTimerDone(Entity* self, std::string timerName
self->SetPosition(newLocation.m_Position);
self->SetRotation(newLocation.m_Rotation);
self->SetScale(newLocation.m_Scale);
GameMessages::SendPlayFXEffect(self->GetObjectID(), 6478, u"teleportBeam", "teleportBeam");
GameMessages::SendPlayFXEffect(self->GetObjectID(), 6478, u"teleportRings", "teleportRings");
self->AddTimer("stopFX", 2.0f);

View File

@@ -42,7 +42,7 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_ENEMY_WAVES})
set(DSCRIPTS_SOURCES_02_SERVER_ENEMY ${DSCRIPTS_SOURCES_02_SERVER_ENEMY} "Waves/${file}")
endforeach()
add_library(dScriptsServerEnemy STATIC ${DSCRIPTS_SOURCES_02_SERVER_ENEMY})
add_library(dScriptsServerEnemy OBJECT ${DSCRIPTS_SOURCES_02_SERVER_ENEMY})
target_link_libraries(dScriptsServerEnemy dScriptsBase)
target_include_directories(dScriptsServerEnemy PUBLIC "."
"AG"

View File

@@ -14,6 +14,6 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_AG
"NpcCowboyServer.cpp"
"NpcPirateServer.cpp")
add_library(dScriptsServerMapAG ${DSCRIPTS_SOURCES_02_SERVER_MAP_AG})
add_library(dScriptsServerMapAG OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_AG})
target_include_directories(dScriptsServerMapAG PUBLIC ".")
target_precompile_headers(dScriptsServerMapAG REUSE_FROM dScriptsBase)

View File

@@ -2,7 +2,7 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_AG_SPIDER_QUEEN
"ZoneAgSpiderQueen.cpp"
"SpiderBossTreasureChestServer.cpp")
add_library(dScriptsServerMapAGSpiderQueen ${DSCRIPTS_SOURCES_02_SERVER_MAP_AG_SPIDER_QUEEN})
add_library(dScriptsServerMapAGSpiderQueen OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_AG_SPIDER_QUEEN})
target_include_directories(dScriptsServerMapAGSpiderQueen PUBLIC ".")
target_link_libraries(dScriptsServerMapAGSpiderQueen dScriptsServerMapProperty)
target_precompile_headers(dScriptsServerMapAGSpiderQueen REUSE_FROM dScriptsBase)

View File

@@ -15,8 +15,10 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_AM
"AmSkullkinDrillStand.cpp"
"AmSkullkinTower.cpp"
"AmBlueX.cpp"
"AmTeapotServer.cpp")
"AmTeapotServer.cpp"
"WanderingVendor.cpp"
)
add_library(dScriptsServerMapAM ${DSCRIPTS_SOURCES_02_SERVER_MAP_AM})
add_library(dScriptsServerMapAM OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_AM})
target_include_directories(dScriptsServerMapAM PUBLIC ".")
target_precompile_headers(dScriptsServerMapAM REUSE_FROM dScriptsBase)

View File

@@ -0,0 +1,33 @@
#include "WanderingVendor.h"
#include "MovementAIComponent.h"
#include "ProximityMonitorComponent.h"
void WanderingVendor::OnStartup(Entity* self) {
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
if (!movementAIComponent) return;
// movementAIComponent->Resume();
self->SetProximityRadius(10, "playermonitor");
}
void WanderingVendor::OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) {
if (status == "ENTER" && entering->IsPlayer()) {
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
if (!movementAIComponent) return;
// movementAIComponent->Pause();
self->CancelTimer("startWalking");
} else if (status == "LEAVE") {
auto* proximityMonitorComponent = self->GetComponent<ProximityMonitorComponent>();
if (!proximityMonitorComponent) self->AddComponent<ProximityMonitorComponent>();
const auto proxObjs = proximityMonitorComponent->GetProximityObjects("playermonitor");
if (proxObjs.empty()) self->AddTimer("startWalking", 1.5);
}
}
void WanderingVendor::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "startWalking") {
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
if (!movementAIComponent) return;
// movementAIComponent->Resume();
}
}

View File

@@ -0,0 +1,13 @@
#ifndef __WANDERINGVENDOR__H__
#define __WANDERINGVENDOR__H__
#include "CppScripts.h"
class WanderingVendor : public CppScripts::Script {
public:
void OnStartup(Entity* self) override;
void OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) override;
void OnTimerDone(Entity* self, std::string timerName) override;
};
#endif //!__WANDERINGVENDOR__H__

View File

@@ -13,17 +13,33 @@ add_subdirectory(SS)
add_subdirectory(VE)
add_library(dScriptsServerMap INTERFACE)
target_link_libraries(dScriptsServerMap INTERFACE
dScriptsServerMapAG
dScriptsServerMapAGSpiderQueen
dScriptsServerMapAM
dScriptsServerMapFV
dScriptsServerMapGeneral
dScriptsServerMapGF
dScriptsServerMapNJHub
dScriptsServerMapNS
dScriptsServerMapNT
dScriptsServerMapPR
dScriptsServerMapProperty
dScriptsServerMapSS
dScriptsServerMapVE)
target_sources(dScriptsServerMap INTERFACE
$<TARGET_OBJECTS:dScriptsServerMapAG>
$<TARGET_OBJECTS:dScriptsServerMapAGSpiderQueen>
$<TARGET_OBJECTS:dScriptsServerMapAM>
$<TARGET_OBJECTS:dScriptsServerMapFV>
$<TARGET_OBJECTS:dScriptsServerMapGeneral>
$<TARGET_OBJECTS:dScriptsServerMapGF>
$<TARGET_OBJECTS:dScriptsServerMapNJHub>
$<TARGET_OBJECTS:dScriptsServerMapNS>
$<TARGET_OBJECTS:dScriptsServerMapNT>
$<TARGET_OBJECTS:dScriptsServerMapPR>
$<TARGET_OBJECTS:dScriptsServerMapProperty>
$<TARGET_OBJECTS:dScriptsServerMapSS>
$<TARGET_OBJECTS:dScriptsServerMapVE>
)
target_include_directories(dScriptsServerMap INTERFACE
$<TARGET_PROPERTY:dScriptsServerMapAG,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsServerMapAGSpiderQueen,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsServerMapAM,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsServerMapFV,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsServerMapGeneral,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsServerMapGF,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsServerMapNJHub,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsServerMapNS,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsServerMapNT,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsServerMapPR,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsServerMapProperty,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsServerMapSS,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsServerMapVE,INTERFACE_INCLUDE_DIRECTORIES>
)

View File

@@ -11,6 +11,6 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_FV_RACING})
set(DSCRIPTS_SOURCES_02_SERVER_MAP_FV ${DSCRIPTS_SOURCES_02_SERVER_MAP_FV} "Racing/${file}")
endforeach()
add_library(dScriptsServerMapFV ${DSCRIPTS_SOURCES_02_SERVER_MAP_FV})
add_library(dScriptsServerMapFV OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_FV})
target_include_directories(dScriptsServerMapFV PUBLIC "." "Racing")
target_precompile_headers(dScriptsServerMapFV REUSE_FROM dScriptsBase)

View File

@@ -4,6 +4,6 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_GF
"MastTeleport.cpp"
"SpawnLionServer.cpp")
add_library(dScriptsServerMapGF ${DSCRIPTS_SOURCES_02_SERVER_MAP_GF})
add_library(dScriptsServerMapGF OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_GF})
target_include_directories(dScriptsServerMapGF PUBLIC ".")
target_precompile_headers(dScriptsServerMapGF REUSE_FROM dScriptsBase)

View File

@@ -27,6 +27,6 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL_NINJAGO})
set(DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL ${DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL} "Ninjago/${file}")
endforeach()
add_library(dScriptsServerMapGeneral ${DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL})
add_library(dScriptsServerMapGeneral OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL})
target_include_directories(dScriptsServerMapGeneral PUBLIC "." "Ninjago")
target_precompile_headers(dScriptsServerMapGeneral REUSE_FROM dScriptsBase)

View File

@@ -6,7 +6,7 @@
#include "Entity.h"
void StoryBoxInteractServer::OnUse(Entity* self, Entity* user) {
if (self->GetVar<bool>(u"hasCustomText")) {
if (self->HasVar(u"customText")) {
const auto& customText = self->GetVar<std::string>(u"customText");
{
@@ -29,15 +29,19 @@ void StoryBoxInteractServer::OnUse(Entity* self, Entity* user) {
return;
}
if (!self->HasVar(u"storyText") || !self->HasVar(u"altFlagID")) return;
const auto storyText = self->GetVarAsString(u"storyText");
if (storyText.length() > 2) {
auto storyValue = GeneralUtils::TryParse<uint32_t>(storyText.substr(storyText.length() - 2));
if(!storyValue) return;
int32_t boxFlag = self->GetVar<int32_t>(u"altFlagID");
if (boxFlag <= 0) {
boxFlag = (10000 + Game::server->GetZoneID() + storyValue.value());
}
int32_t boxFlag = self->GetVar<int32_t>(u"altFlagID");
if (boxFlag <= 0) {
boxFlag = (10000 + Game::server->GetZoneID() + std::stoi(storyText.substr(storyText.length() - 2)));
}
if (user->GetCharacter()->GetPlayerFlag(boxFlag) == false) {
user->GetCharacter()->SetPlayerFlag(boxFlag, true);
GameMessages::SendFireEventClientSide(self->GetObjectID(), user->GetSystemAddress(), u"achieve", LWOOBJID_EMPTY, 0, -1, LWOOBJID_EMPTY);
if (user->GetCharacter()->GetPlayerFlag(boxFlag) == false) {
user->GetCharacter()->SetPlayerFlag(boxFlag, true);
GameMessages::SendFireEventClientSide(self->GetObjectID(), user->GetSystemAddress(), u"achieve", LWOOBJID_EMPTY, 0, -1, LWOOBJID_EMPTY);
}
}
}

View File

@@ -10,6 +10,6 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_NS_WAVES})
set(DSCRIPTS_SOURCES_02_SERVER_MAP_NS ${DSCRIPTS_SOURCES_02_SERVER_MAP_NS} "Waves/${file}")
endforeach()
add_library(dScriptsServerMapNS ${DSCRIPTS_SOURCES_02_SERVER_MAP_NS})
add_library(dScriptsServerMapNS OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_NS})
target_include_directories(dScriptsServerMapNS PUBLIC "." "Waves")
target_precompile_headers(dScriptsServerMapNS REUSE_FROM dScriptsBase)

View File

@@ -27,6 +27,6 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_NT
"NtBcSubmitServer.cpp"
"NtNaomiBreadcrumbServer.cpp")
add_library(dScriptsServerMapNT ${DSCRIPTS_SOURCES_02_SERVER_MAP_NT})
add_library(dScriptsServerMapNT OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_NT})
target_include_directories(dScriptsServerMapNT PUBLIC ".")
target_precompile_headers(dScriptsServerMapNT REUSE_FROM dScriptsBase)

View File

@@ -3,6 +3,6 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_PR
"PrSeagullFly.cpp"
"SpawnGryphonServer.cpp")
add_library(dScriptsServerMapPR ${DSCRIPTS_SOURCES_02_SERVER_MAP_PR})
add_library(dScriptsServerMapPR OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_PR})
target_include_directories(dScriptsServerMapPR PUBLIC ".")
target_precompile_headers(dScriptsServerMapPR REUSE_FROM dScriptsBase)

View File

@@ -19,7 +19,7 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_PROPERTY_NS_MED})
set(DSCRIPTS_SOURCES_02_SERVER_MAP_PROPERTY ${DSCRIPTS_SOURCES_02_SERVER_MAP_PROPERTY} "NS_Med/${file}")
endforeach()
add_library(dScriptsServerMapProperty ${DSCRIPTS_SOURCES_02_SERVER_MAP_PROPERTY})
add_library(dScriptsServerMapProperty OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_PROPERTY})
target_precompile_headers(dScriptsServerMapProperty REUSE_FROM dScriptsBase)
target_include_directories(dScriptsServerMapProperty PUBLIC "."
"AG_Med"

View File

@@ -1,6 +1,6 @@
set(DSCRIPTS_SOURCES_02_SERVER_MAP_SS
"SsModularBuildServer.cpp")
add_library(dScriptsServerMapSS ${DSCRIPTS_SOURCES_02_SERVER_MAP_SS})
add_library(dScriptsServerMapSS OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_SS})
target_include_directories(dScriptsServerMapSS PUBLIC ".")
target_precompile_headers(dScriptsServerMapSS REUSE_FROM dScriptsBase)

View File

@@ -3,6 +3,6 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_VE
"VeEpsilonServer.cpp"
"VeBricksampleServer.cpp")
add_library(dScriptsServerMapVE ${DSCRIPTS_SOURCES_02_SERVER_MAP_VE})
add_library(dScriptsServerMapVE OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_VE})
target_include_directories(dScriptsServerMapVE PUBLIC ".")
target_precompile_headers(dScriptsServerMapVE REUSE_FROM dScriptsBase)

View File

@@ -28,7 +28,7 @@ foreach(file ${DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB_BOSS_INSTANCE})
set(DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB ${DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB} "boss_instance/${file}")
endforeach()
add_library(dScriptsServerMapNJHub ${DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB})
add_library(dScriptsServerMapNJHub OBJECT ${DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB})
target_include_directories(dScriptsServerMapNJHub PUBLIC "." "boss_instance")
target_link_libraries(dScriptsServerMapNJHub
dScriptsServerPets

View File

@@ -3,7 +3,7 @@ set(DSCRIPTS_SOURCES_02_SERVER_PETS
"PetFromObjectServer.cpp"
"DamagingPets.cpp")
add_library(dScriptsServerPets STATIC ${DSCRIPTS_SOURCES_02_SERVER_PETS})
add_library(dScriptsServerPets OBJECT ${DSCRIPTS_SOURCES_02_SERVER_PETS})
target_include_directories(dScriptsServerPets PUBLIC ".")
target_precompile_headers(dScriptsServerPets REUSE_FROM dScriptsBase)

View File

@@ -17,18 +17,22 @@ set(DSCRIPTS_SOURCES
link_libraries(dDatabase dPhysics)
add_library(dScriptsBase STATIC ${DSCRIPTS_SOURCES})
target_include_directories(dScriptsBase PUBLIC .)
target_link_libraries(dScriptsBase
INTERFACE dGameBase)
add_library(dScriptsBase OBJECT ${DSCRIPTS_SOURCES})
target_link_libraries(dScriptsBase INTERFACE dGameBase dComponents)
target_precompile_headers(dScriptsBase PRIVATE ${HEADERS_DGAME})
include_directories(
${PROJECT_SOURCE_DIR}/dScripts
${PROJECT_SOURCE_DIR}/dGame
"${PROJECT_SOURCE_DIR}/dScripts"
"${PROJECT_SOURCE_DIR}/dGame"
"${PROJECT_SOURCE_DIR}/dGame/dComponents" # e.g. ScriptedActivityComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dGameMessages" # e.g. direct ActivityManager
"${PROJECT_SOURCE_DIR}/dGame/dUtilities" # e.g. direct ActivityManager
"${PROJECT_SOURCE_DIR}/dGame/dEntity" # via dZoneManager.h
"${PROJECT_SOURCE_DIR}/dGame/dMission" # via MissionComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # viaInventoryComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dInventory" # via InventoryComponent.h
"${PROJECT_SOURCE_DIR}/dZoneManager"
)
link_libraries(dScriptsBase)
# dComponents
add_subdirectory(02_server)
add_subdirectory(ai)
@@ -37,14 +41,22 @@ add_subdirectory(EquipmentScripts)
add_subdirectory(EquipmentTriggers)
add_subdirectory(zone)
add_library(dScripts STATIC "CppScripts.cpp")
add_library(dScripts STATIC
$<TARGET_OBJECTS:dScriptsBase>
$<TARGET_OBJECTS:dScriptsClient>
$<TARGET_OBJECTS:dScriptsEquipmentScripts>
$<TARGET_OBJECTS:dScriptsEquipmentTriggers>
$<TARGET_OBJECTS:dScriptsZone>
"CppScripts.cpp"
)
target_link_libraries(dScripts PRIVATE dScriptsAI dScriptsServer)
target_include_directories(dScripts PRIVATE
$<TARGET_PROPERTY:dScriptsBase,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsServer,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsAI,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsClient,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsEquipmentScripts,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsEquipmentTriggers,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsZone,INTERFACE_INCLUDE_DIRECTORIES>
)
target_precompile_headers(dScripts REUSE_FROM dScriptsBase)
target_include_directories(dScripts PUBLIC ".")
target_link_libraries(dScripts
dScriptsBase
dScriptsServer
dScriptsAI
dScriptsClient
dScriptsEquipmentScripts
dScriptsEquipmentTriggers
dScriptsZone)

View File

@@ -240,6 +240,7 @@
#include "AmDarklingDragon.h"
#include "AmBlueX.h"
#include "AmTeapotServer.h"
#include "WanderingVendor.h"
// NJ Scripts
#include "NjGarmadonCelebration.h"
@@ -317,6 +318,8 @@
#include "WildNinjaSensei.h"
#include "WildNinjaBricks.h"
#include "VisToggleNotifierServer.h"
#include "LupGenericInteract.h"
#include "WblRobotCitizen.h"
namespace {
InvalidScript* invalidToReturn = new InvalidScript();
@@ -547,7 +550,7 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
//PR:
else if (scriptName == "scripts\\client\\ai\\PR\\L_PR_WHISTLE.lua")
script = new PrWhistle();
else if (scriptName == "scripts\\02_server\\Map\\PR\\L_PR_SEAGULL_FLY.lua")
if (scriptName == "scripts\\02_server\\Map\\PR\\L_PR_SEAGULL_FLY.lua")
script = new PrSeagullFly();
else if (scriptName == "scripts\\ai\\PETS\\L_HYDRANT_SMASHABLE.lua")
script = new HydrantSmashable();
@@ -642,6 +645,8 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
script = new MailBoxServer();
else if (scriptName == "scripts\\ai\\ACT\\L_ACT_MINE.lua")
script = new ActMine();
else if (scriptName == "scripts\\02_server\\Map\\AM\\L_WANDERING_VENDOR.lua")
script = new WanderingVendor();
//Racing:
else if (scriptName == "scripts\\ai\\RACING\\OBJECTS\\RACE_IMAGINE_CRATE_SERVER.lua")
@@ -726,7 +731,7 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
script = new NTNaomiDirtServer();
//AM:
else if (scriptName == "scripts\\02_server\\Map\\AM\\L_AM_CONSOLE_TELEPORT_SERVER.lua")
if (scriptName == "scripts\\02_server\\Map\\AM\\L_AM_CONSOLE_TELEPORT_SERVER.lua")
script = new AmConsoleTeleportServer();
else if (scriptName == "scripts\\02_server\\Map\\AM\\L_RANDOM_SPAWNER_FIN.lua")
script = new RandomSpawnerFin();
@@ -806,7 +811,7 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
script = new Lieutenant();
else if (scriptName == "scripts\\02_server\\Map\\njhub\\L_RAIN_OF_ARROWS.lua")
script = new RainOfArrows();
else if (scriptName == "scripts\\02_server\\Map\\njhub\\L_CAVE_PRISON_CAGE.lua")
if (scriptName == "scripts\\02_server\\Map\\njhub\\L_CAVE_PRISON_CAGE.lua")
script = new CavePrisonCage();
else if (scriptName == "scripts\\02_server\\Map\\njhub\\boss_instance\\L_MONASTERY_BOSS_INSTANCE_SERVER.lua")
script = new NjMonastryBossInstance();
@@ -938,6 +943,10 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
script = new WildNinjaStudent();
else if (scriptName == "scripts\\ai\\WILD\\L_WILD_NINJA_SENSEI.lua")
script = new WildNinjaSensei();
else if (scriptName == "scripts\\ai\\WILD\\L_LUP_generic_interact.lua")
script = new LupGenericInteract();
else if (scriptName.rfind("scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizen", 0) == 0)
script = new WblRobotCitizen();
// handle invalid script reporting if the path is greater than zero and it's not an ignored script
// information not really needed for sys admins but is for developers

View File

@@ -8,6 +8,6 @@ set(DSCRIPTS_SOURCES_EQUIPMENTSCRIPTS
"FireFirstSkillonStartup.cpp"
"StunImmunity.cpp")
add_library(dScriptsEquipmentScripts STATIC ${DSCRIPTS_SOURCES_EQUIPMENTSCRIPTS})
add_library(dScriptsEquipmentScripts OBJECT ${DSCRIPTS_SOURCES_EQUIPMENTSCRIPTS})
target_include_directories(dScriptsEquipmentScripts PUBLIC ".")
target_precompile_headers(dScriptsEquipmentScripts REUSE_FROM dScriptsBase)

View File

@@ -1,6 +1,6 @@
set(DSCRIPTS_SOURCES_EQUIPMENTTRIGGERSSCRIPTS
"CoilBackpackBase.cpp")
add_library(dScriptsEquipmentTriggers STATIC ${DSCRIPTS_SOURCES_EQUIPMENTTRIGGERSSCRIPTS})
add_library(dScriptsEquipmentTriggers OBJECT ${DSCRIPTS_SOURCES_EQUIPMENTTRIGGERSSCRIPTS})
target_include_directories(dScriptsEquipmentTriggers PUBLIC ".")
target_precompile_headers(dScriptsEquipmentTriggers REUSE_FROM dScriptsBase)

View File

@@ -9,6 +9,6 @@ foreach(file ${DSCRIPTS_SOURCES_AI_ACT_FOOTRACE})
set(DSCRIPTS_SOURCES_AI_ACT ${DSCRIPTS_SOURCES_AI_ACT} "FootRace/${file}")
endforeach()
add_library(dScriptsAiAct STATIC ${DSCRIPTS_SOURCES_AI_ACT})
add_library(dScriptsAiAct OBJECT ${DSCRIPTS_SOURCES_AI_ACT})
target_include_directories(dScriptsAiAct PUBLIC "." "FootRace")
target_precompile_headers(dScriptsAiAct REUSE_FROM dScriptsBase)

View File

@@ -16,6 +16,6 @@ set(DSCRIPTS_SOURCES_AI_AG
"AgStagePlatforms.cpp"
"AgQbWall.cpp")
add_library(dScriptsAiAG STATIC ${DSCRIPTS_SOURCES_AI_AG})
add_library(dScriptsAiAG OBJECT ${DSCRIPTS_SOURCES_AI_AG})
target_include_directories(dScriptsAiAG PUBLIC ".")
target_precompile_headers(dScriptsAiAG REUSE_FROM dScriptsBase)

View File

@@ -15,18 +15,34 @@ add_subdirectory(SPEC)
add_subdirectory(WILD)
add_library(dScriptsAI INTERFACE)
target_link_libraries(dScriptsAI INTERFACE
dScriptsAiAct
dScriptsAiAG
dScriptsAiFV
dScriptsAiGeneral
dScriptsAiGF
dScriptsAiMinigame
dScriptsAiNP
dScriptsAiNS
dScriptsAiPets
dScriptsAiProperty
dScriptsAiRacing
dScriptsAiSpec
dScriptsAiWild
target_sources(dScriptsAI INTERFACE
$<TARGET_OBJECTS:dScriptsAiAct>
$<TARGET_OBJECTS:dScriptsAiAG>
$<TARGET_OBJECTS:dScriptsAiFV>
$<TARGET_OBJECTS:dScriptsAiGeneral>
$<TARGET_OBJECTS:dScriptsAiGF>
$<TARGET_OBJECTS:dScriptsAiMinigame>
$<TARGET_OBJECTS:dScriptsAiNP>
$<TARGET_OBJECTS:dScriptsAiNS>
$<TARGET_OBJECTS:dScriptsAiPets>
$<TARGET_OBJECTS:dScriptsAiProperty>
$<TARGET_OBJECTS:dScriptsAiRacing>
$<TARGET_OBJECTS:dScriptsAiSpec>
$<TARGET_OBJECTS:dScriptsAiWild>
)
target_include_directories(dScriptsAI INTERFACE
$<TARGET_PROPERTY:dScriptsAiAct,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsAiAG,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsAiFV,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsAiGeneral,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsAiGF,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsAiMinigame,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsAiNP,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsAiNS,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsAiPets,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsAiProperty,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsAiRacing,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsAiSpec,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:dScriptsAiWild,INTERFACE_INCLUDE_DIRECTORIES>
)

View File

@@ -18,7 +18,7 @@ set(DSCRIPTS_SOURCES_AI_FV
"FvMaelstromGeyser.cpp"
"TriggerGas.cpp")
add_library(dScriptsAiFV STATIC ${DSCRIPTS_SOURCES_AI_FV})
add_library(dScriptsAiFV OBJECT ${DSCRIPTS_SOURCES_AI_FV})
target_include_directories(dScriptsAiFV PUBLIC ".")
target_precompile_headers(dScriptsAiFV REUSE_FROM dScriptsBase)

View File

@@ -2,7 +2,7 @@ set(DSCRIPTS_SOURCES_AI_GENERAL
"InstanceExitTransferPlayerToLastNonInstance.cpp"
"LegoDieRoll.cpp")
add_library(dScriptsAiGeneral STATIC ${DSCRIPTS_SOURCES_AI_GENERAL})
add_library(dScriptsAiGeneral OBJECT ${DSCRIPTS_SOURCES_AI_GENERAL})
target_include_directories(dScriptsAiGeneral PUBLIC ".")
target_precompile_headers(dScriptsAiGeneral REUSE_FROM dScriptsBase)

View File

@@ -12,6 +12,6 @@ set(DSCRIPTS_SOURCES_AI_GF
"PirateRep.cpp"
"GfParrotCrash.cpp")
add_library(dScriptsAiGF STATIC ${DSCRIPTS_SOURCES_AI_GF})
add_library(dScriptsAiGF OBJECT ${DSCRIPTS_SOURCES_AI_GF})
target_include_directories(dScriptsAiGF PUBLIC ".")
target_precompile_headers(dScriptsAiGF REUSE_FROM dScriptsBase)

View File

@@ -12,6 +12,6 @@ foreach(file ${DSCRIPTS_SOURCES_AI_MINIGAME_OBJECTS})
set(DSCRIPTS_SOURCES_AI_MINIGAME ${DSCRIPTS_SOURCES_AI_MINIGAME} "Objects/${file}")
endforeach()
add_library(dScriptsAiMinigame STATIC ${DSCRIPTS_SOURCES_AI_MINIGAME})
add_library(dScriptsAiMinigame OBJECT ${DSCRIPTS_SOURCES_AI_MINIGAME})
target_include_directories(dScriptsAiMinigame PUBLIC "." "Objects" "SG_GF" "SG_GF/SERVER")
target_precompile_headers(dScriptsAiMinigame REUSE_FROM dScriptsBase)

View File

@@ -1,6 +1,6 @@
set(DSCRIPTS_SOURCES_AI_NP
"NpcNpSpacemanBob.cpp")
add_library(dScriptsAiNP STATIC ${DSCRIPTS_SOURCES_AI_NP})
add_library(dScriptsAiNP OBJECT ${DSCRIPTS_SOURCES_AI_NP})
target_include_directories(dScriptsAiNP PUBLIC ".")
target_precompile_headers(dScriptsAiNP REUSE_FROM dScriptsBase)

View File

@@ -21,7 +21,7 @@ foreach(file ${DSCRIPTS_SOURCES_AI_NS_WH})
set(DSCRIPTS_SOURCES_AI_NS ${DSCRIPTS_SOURCES_AI_NS} "WH/${file}")
endforeach()
add_library(dScriptsAiNS STATIC ${DSCRIPTS_SOURCES_AI_NS})
add_library(dScriptsAiNS OBJECT ${DSCRIPTS_SOURCES_AI_NS})
target_include_directories(dScriptsAiNS PUBLIC "." "NS_PP_01" "WH"
PRIVATE
${PROJECT_SOURCE_DIR}/dScripts/02_server/Map/NS) # NsConcertChoiceBuildManager.h

View File

@@ -1,6 +1,6 @@
set(DSCRIPTS_SOURCES_AI_PETS
"HydrantSmashable.cpp")
add_library(dScriptsAiPets STATIC ${DSCRIPTS_SOURCES_AI_PETS})
add_library(dScriptsAiPets OBJECT ${DSCRIPTS_SOURCES_AI_PETS})
target_include_directories(dScriptsAiPets PUBLIC "." "NS_PP_01" "WH")
target_precompile_headers(dScriptsAiPets REUSE_FROM dScriptsBase)

View File

@@ -8,6 +8,6 @@ foreach(file ${DSCRIPTS_SOURCES_AI_PROPERTY_AG})
set(DSCRIPTS_SOURCES_AI_PROPERTY ${DSCRIPTS_SOURCES_AI_PROPERTY} "AG/${file}")
endforeach()
add_library(dScriptsAiProperty STATIC ${DSCRIPTS_SOURCES_AI_PROPERTY})
add_library(dScriptsAiProperty OBJECT ${DSCRIPTS_SOURCES_AI_PROPERTY})
target_include_directories(dScriptsAiProperty PUBLIC "." "AG")
target_precompile_headers(dScriptsAiProperty REUSE_FROM dScriptsBase)

View File

@@ -6,6 +6,6 @@ foreach(file ${DSCRIPTS_SOURCES_AI_RACING_OBJECTS})
set(DSCRIPTS_SOURCES_AI_RACING ${DSCRIPTS_SOURCES_AI_RACING} "OBJECTS/${file}")
endforeach()
add_library(dScriptsAiRacing STATIC ${DSCRIPTS_SOURCES_AI_RACING})
add_library(dScriptsAiRacing OBJECT ${DSCRIPTS_SOURCES_AI_RACING})
target_include_directories(dScriptsAiRacing PUBLIC "." "OBJECTS")
target_precompile_headers(dScriptsAiRacing REUSE_FROM dScriptsBase)

View File

@@ -3,6 +3,6 @@ set(DSCRIPTS_SOURCES_AI_SPEC
"SpecialPowerupSpawner.cpp"
"SpecialSpeedBuffSpawner.cpp")
add_library(dScriptsAiSpec STATIC ${DSCRIPTS_SOURCES_AI_SPEC})
add_library(dScriptsAiSpec OBJECT ${DSCRIPTS_SOURCES_AI_SPEC})
target_include_directories(dScriptsAiSpec PUBLIC ".")
target_precompile_headers(dScriptsAiSpec REUSE_FROM dScriptsBase)

View File

@@ -1,5 +1,6 @@
set(DSCRIPTS_SOURCES_AI_WILD
"AllCrateChicken.cpp"
"LupGenericInteract.cpp"
"WildAmbients.cpp"
"WildAmbientCrab.cpp"
"WildAndScared.cpp"
@@ -9,6 +10,6 @@ set(DSCRIPTS_SOURCES_AI_WILD
"WildNinjaSensei.cpp"
"WildPants.cpp")
add_library(dScriptsAiWild STATIC ${DSCRIPTS_SOURCES_AI_WILD})
add_library(dScriptsAiWild OBJECT ${DSCRIPTS_SOURCES_AI_WILD})
target_include_directories(dScriptsAiWild PUBLIC ".")
target_precompile_headers(dScriptsAiWild REUSE_FROM dScriptsBase)

View File

@@ -0,0 +1,6 @@
#include "LupGenericInteract.h"
#include "GameMessages.h"
void LupGenericInteract::OnUse(Entity* self, Entity* user) {
GameMessages::SendPlayAnimation(self, u"interact");
}

View File

@@ -0,0 +1,12 @@
#ifndef __LUCGENERICINTERACT__H__
#define __LUCGENERICINTERACT__H__
#include "CppScripts.h"
class LupGenericInteract : public CppScripts::Script {
public:
void OnUse(Entity* self, Entity* user) override;
};
#endif //!__LUCGENERICINTERACT__H__

View File

@@ -6,6 +6,6 @@ foreach(file ${DSCRIPTS_SOURCES_CLIENT_AI})
set(DSCRIPTS_SOURCES_CLIENT ${DSCRIPTS_SOURCES_CLIENT} "ai/${file}")
endforeach()
add_library(dScriptsClient STATIC ${DSCRIPTS_SOURCES_CLIENT})
add_library(dScriptsClient OBJECT ${DSCRIPTS_SOURCES_CLIENT})
target_include_directories(dScriptsClient PUBLIC "." "ai" "ai/PR")
target_precompile_headers(dScriptsClient REUSE_FROM dScriptsBase)

View File

@@ -18,10 +18,11 @@ foreach(file ${DSCRIPTS_SOURCES_ZONE_PROPERTY})
set(DSCRIPTS_SOURCES_ZONE ${DSCRIPTS_SOURCES_ZONE} "PROPERTY/${file}")
endforeach()
add_library(dScriptsZone STATIC ${DSCRIPTS_SOURCES_ZONE})
add_library(dScriptsZone OBJECT ${DSCRIPTS_SOURCES_ZONE})
target_include_directories(dScriptsZone PUBLIC "."
"AG"
"LUPs"
"LUPs/RobotCity_Intro"
"PROPERTY"
"PROPERTY/FV"
"PROPERTY/GF"

View File

@@ -1,3 +1,11 @@
set(DSCRIPTS_SOURCES_ZONE_LUPS
set(DSCRIPTS_SOURCES_ZONE_LUPS
"WblGenericZone.cpp"
PARENT_SCOPE)
)
add_subdirectory(RobotCity_Intro)
foreach(file ${DSCRIPTS_SOURCES_ZONE_LUPS_ROBOTCITYINTRO})
set(DSCRIPTS_SOURCES_ZONE_LUPS ${DSCRIPTS_SOURCES_ZONE_LUPS} "RobotCity_Intro/${file}")
endforeach()
set(DSCRIPTS_SOURCES_ZONE_LUPS ${DSCRIPTS_SOURCES_ZONE_LUPS} PARENT_SCOPE)

View File

@@ -0,0 +1,3 @@
set(DSCRIPTS_SOURCES_ZONE_LUPS_ROBOTCITYINTRO
"WblRobotCitizen.cpp"
PARENT_SCOPE)

View File

@@ -0,0 +1,24 @@
#include "WblRobotCitizen.h"
#include "MovementAIComponent.h"
#include "RenderComponent.h"
void WblRobotCitizen::OnStartup(Entity* self) {
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
if (!movementAIComponent) return;
// movementAIComponent->Resume();
}
void WblRobotCitizen::OnUse(Entity* self, Entity* user) {
// auto movementAIComponent = self->GetComponent<MovementAIComponent>();
// if (!movementAIComponent) movementAIComponent->Pause();
auto face = NiQuaternion::LookAt(self->GetPosition(), user->GetPosition());
self->SetRotation(face);
auto timer = RenderComponent::PlayAnimation(self, "wave");
self->AddTimer("animation time", timer);
}
void WblRobotCitizen::OnTimerDone(Entity* self, std::string timerName) {
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
if (!movementAIComponent) return;
// movementAIComponent->Resume();
}

View File

@@ -0,0 +1,13 @@
#ifndef __WBLROBOTCITIZEN__H__
#define __WBLROBOTCITIZEN__H__
#include "CppScripts.h"
class WblRobotCitizen : public CppScripts::Script {
public:
void OnStartup(Entity* self) override;
void OnUse(Entity* self, Entity* user) override;
void OnTimerDone(Entity* self, std::string timerName) override;
};
#endif //!__WBLROBOTCITIZEN__H__