Merge branch 'main' into scripting-lua

This commit is contained in:
Jett
2022-07-17 16:15:17 +01:00
committed by GitHub
328 changed files with 4228 additions and 2250 deletions

53
dScripts/ActMine.cpp Normal file
View File

@@ -0,0 +1,53 @@
#include "ActMine.h"
#include "SkillComponent.h"
#include "DestroyableComponent.h"
#include "RebuildComponent.h"
void ActMine::OnStartup(Entity* self) {
self->SetVar(u"RebuildComplete", false);
self->SetProximityRadius(MINE_RADIUS, "mineRadius");
}
void ActMine::OnRebuildNotifyState(Entity* self, eRebuildState state)
{
if (state == eRebuildState::REBUILD_COMPLETED) {
auto* rebuild = self->GetComponent<RebuildComponent>();
if (rebuild) {
auto* builder = rebuild->GetBuilder();
self->SetVar(u"Builder", builder->GetObjectID());
}
self->SetVar(u"RebuildComplete", true);
self->SetVar(u"NumWarnings", 0);
self->AddToGroup("reset");
}
}
void ActMine::OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) {
auto* detroyable = self->GetComponent<DestroyableComponent>();
if (!detroyable) return;
if (status == "ENTER" && self->GetVar<bool>(u"RebuildComplete") == true && detroyable->IsEnemy(entering)) {
GameMessages::SendPlayFXEffect(self->GetObjectID(), 242, u"orange", "sirenlight_B");
self->AddTimer("Tick", TICK_TIME);
}
}
void ActMine::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "Tick") {
if (self->GetVar<int>(u"NumWarnings") >= MAX_WARNINGS){
auto* skill = self->GetComponent<SkillComponent>();
if (!skill) return;
skill->CalculateBehavior(SKILL_ID, BEHAVIOR_ID, LWOOBJID_EMPTY);
self->AddTimer("BlowedUp", BLOWED_UP_TIME);
} else {
GameMessages::SendPlayFXEffect(self->GetObjectID(), 242, u"orange", "sirenlight_B");
self->AddTimer("Tick", TICK_TIME);
self->SetVar(u"NumWarnings", self->GetVar<int>(u"NumWarnings") + 1);
}
}
if (timerName == "BlowedUp") {
self->Kill(self);
}
}

18
dScripts/ActMine.h Normal file
View File

@@ -0,0 +1,18 @@
#pragma once
#include "CppScripts.h"
class ActMine : public CppScripts::Script {
public:
void OnStartup(Entity* self) override;
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
void OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) override;
void OnTimerDone(Entity* self, std::string timerName) override;
private:
int MAX_WARNINGS = 3;
float MINE_RADIUS = 10.0;
float TICK_TIME = 0.25;
float BLOWED_UP_TIME = 0.1;
uint32_t SKILL_ID = 317;
uint32_t BEHAVIOR_ID = 3719;
};

View File

@@ -2,18 +2,12 @@
void ActNinjaTurret::OnRebuildNotifyState(Entity* self, eRebuildState state)
{
Game::logger->Log("ActNinjaTurret", "Rebuild state: %i\n", state);
if (state == eRebuildState::REBUILD_COMPLETED)
{
Game::logger->Log("ActNinjaTurret", "I am build\n");
self->SetVar(u"AmBuilt", true);
}
else if (state == eRebuildState::REBUILD_RESETTING)
{
Game::logger->Log("ActNinjaTurret", "I am not build\n");
self->SetVar(u"AmBuilt", false);
}
}
@@ -22,8 +16,6 @@ void
ActNinjaTurret::OnFireEventServerSide(Entity *self, Entity *sender, std::string args, int32_t param1, int32_t param2,
int32_t param3)
{
Game::logger->Log("ActNinjaTurret", "Got server side event %s\n", args.c_str());
if (args == "ISpawned" && self->GetVar<bool>(u"AmBuilt"))
{
sender->Smash();

View File

@@ -1,24 +1,17 @@
#include "ActSharkPlayerDeathTrigger.h"
#include "MissionComponent.h"
#include "MissionTaskType.h"
#include "Entity.h"
#include "GameMessages.h"
#include "Game.h"
#include "dLogger.h"
void ActSharkPlayerDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
}
void ActSharkPlayerDeathTrigger::OnFireEventServerSide(Entity *self, Entity *sender, std::string args, int32_t param1,
int32_t param2, int32_t param3) {
if (args == "achieve") {
MissionComponent* mis = static_cast<MissionComponent*>(sender->GetComponent(COMPONENT_TYPE_MISSION));
if (!mis) return;
auto missionComponent = sender->GetComponent<MissionComponent>();
if (!missionComponent) return;
mis->Progress(MissionTaskType::MISSION_TASK_TYPE_SCRIPT, 8419);
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_SCRIPT, 8419);
if (sender->GetIsDead() || !sender->GetPlayerReadyForUpdates()) return; //Don't kill already dead players or players not ready
Game::logger->Log("ActSharkPlayerDeathTrigger", "%i\n", self->GetLOT());
if (sender->GetCharacter()) {
sender->Smash(self->GetObjectID(), eKillType::VIOLENT, u"big-shark-death");

View File

@@ -4,8 +4,7 @@
class ActSharkPlayerDeathTrigger : public CppScripts::Script
{
public:
void OnCollisionPhantom(Entity* self, Entity* target);
void OnFireEventServerSide(Entity *self, Entity *sender, std::string args, int32_t param1, int32_t param2,
int32_t param3);
int32_t param3) override;
};

View File

@@ -4,6 +4,7 @@
#include "LeaderboardManager.h"
#include "GameMessages.h"
#include <algorithm>
#include "dLogger.h"
bool ActivityManager::IsPlayerInActivity(Entity *self, LWOOBJID playerID) {
const auto* sac = self->GetComponent<ScriptedActivityComponent>();

View File

@@ -1,7 +1,6 @@
#include "AgBugsprayer.h"
#include "SkillComponent.h"
void AgBugsprayer::OnRebuildComplete(Entity* self, Entity* target)
{
self->AddTimer("castSkill", 1);

View File

@@ -1,8 +1,6 @@
#include "AgBusDoor.h"
#include "Entity.h"
#include "GameMessages.h"
#include "Game.h"
#include "dLogger.h"
#include "ProximityMonitorComponent.h"
void AgBusDoor::OnStartup(Entity* self) {

View File

@@ -12,7 +12,11 @@ void AgCagedBricksServer::OnUse(Entity* self, Entity* user) {
}
//Set the flag & mission status:
user->GetCharacter()->SetPlayerFlag(74, true);
auto character = user->GetCharacter();
if (!character) return;
character->SetPlayerFlag(74, true);
//Remove the maelstrom cube:
auto inv = static_cast<InventoryComponent*>(user->GetComponent(COMPONENT_TYPE_INVENTORY));

View File

@@ -1,5 +1,8 @@
#include "AgFans.h"
#include "EntityManager.h"
#include "GameMessages.h"
#include "PhantomPhysicsComponent.h"
#include "RenderComponent.h"
void AgFans::OnStartup(Entity* self) {

View File

@@ -1,8 +1,5 @@
#pragma once
#include "CppScripts.h"
#include "GameMessages.h"
#include "EntityManager.h"
#include "PhantomPhysicsComponent.h"
class AgFans : public CppScripts::Script
{

View File

@@ -4,7 +4,6 @@
class AgImagSmashable : public CppScripts::Script {
public:
void OnDie(Entity* self, Entity* killer);
private:
void CrateAnimal(Entity* self);
};

View File

@@ -1,15 +1,8 @@
#include "AgJetEffectServer.h"
#include "GameMessages.h"
#include "EntityManager.h"
#include "PhantomPhysicsComponent.h"
#include "SkillComponent.h"
void AgJetEffectServer::OnStartup(Entity* self)
{
}
void AgJetEffectServer::OnUse(Entity* self, Entity* user)
{
if (inUse)
@@ -41,7 +34,6 @@ void AgJetEffectServer::OnUse(Entity* self, Entity* user)
GameMessages::SendPlayFXEffect(effect, 641, u"create", "radarDish", LWOOBJID_EMPTY, 1, 1, true);
self->AddTimer("radarDish", 2);
//self->AddTimer("PlayEffect", 2.5f);
self->AddTimer("CineDone", 9);
}

View File

@@ -4,16 +4,12 @@
class AgJetEffectServer final : public CppScripts::Script
{
public:
void OnStartup(Entity* self) override;
void OnUse(Entity* self, Entity* user) override;
void OnRebuildComplete(Entity* self, Entity* target) override;
void OnTimerDone(Entity* self, std::string timerName) override;
private:
LWOOBJID builder;
bool inUse;
};

View File

@@ -1,5 +1,9 @@
#include "AgLaserSensorServer.h"
#include "PhantomPhysicsComponent.h"
#include "SkillComponent.h"
#include "EntityManager.h"
#include "AgMonumentLaserServer.h"
#include "EntityManager.h"
void AgLaserSensorServer::OnStartup(Entity* self) {

View File

@@ -1,9 +1,7 @@
#pragma once
#include "CppScripts.h"
#include "PhantomPhysicsComponent.h"
#include "SkillComponent.h"
#include "EntityManager.h"
#include "AgMonumentLaserServer.h"
class SkillComponent;
class AgLaserSensorServer : public CppScripts::Script {
public:

View File

@@ -1,6 +1,5 @@
#include "AgMonumentBirds.h"
#include "GameMessages.h"
#include "DestroyableComponent.h"
//--------------------------------------------------------------
//Makes the ag birds fly away when you get close and smashes them.

View File

@@ -1,9 +1,9 @@
#include "AgPropGuard.h"
#include "Entity.h"
#include "Character.h"
#include "GameMessages.h"
#include "EntityManager.h"
#include "InventoryComponent.h"
#include "MissionComponent.h"
#include "Item.h"
void AgPropGuard::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState)

View File

@@ -1,5 +1,4 @@
#include "AgSalutingNpcs.h"
#include "GameMessages.h"

View File

@@ -1,12 +1,8 @@
#include "AgShipPlayerDeathTrigger.h"
#include "Entity.h"
#include "GameMessages.h"
#include "Game.h"
#include "dLogger.h"
void AgShipPlayerDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
if (target->GetLOT() == 1 && !target->GetIsDead()) {
Game::logger->Log("CppScripts::AgShipPlayerDeathTrigger", "Attempting to kill %llu\n", target->GetObjectID());
target->Smash(self->GetObjectID(), eKillType::VIOLENT, u"electro-shock-death");
}
}

View File

@@ -1,9 +1,7 @@
#include "AgSpaceStuff.h"
#include "GeneralUtils.h"
#include "GameMessages.h"
#include "dZoneManager.h"
#include "EntityManager.h"
#include "Game.h"
void AgSpaceStuff::OnStartup(Entity* self) {
self->AddTimer("FloaterScale", 5.0f);

View File

@@ -3,7 +3,6 @@
#include "EntityManager.h"
#include "GameMessages.h"
#include "SkillComponent.h"
#include "dLogger.h"
#include "TeamManager.h"
void AgSurvivalBuffStation::OnRebuildComplete(Entity* self, Entity* target) {

View File

@@ -1,6 +1,5 @@
#include "AgSurvivalSpiderling.h"
#include "BaseCombatAIComponent.h"
#include "GameMessages.h"
void AgSurvivalSpiderling::OnStartup(Entity *self) {
BaseWavesGenericEnemy::OnStartup(self);

View File

@@ -1,6 +1,4 @@
#include "AgTurret.h"
#include "EntityManager.h"
#include "RebuildComponent.h"
#include "GameMessages.h"
void AgTurret::OnStartup(Entity* self) {

View File

@@ -1,6 +1,4 @@
#include "AllCrateChicken.h"
#include "dCommonVars.h"
#include "EntityManager.h"
#include "Entity.h"
void AllCrateChicken::OnStartup(Entity* self) {

View File

@@ -1,5 +1,6 @@
#include "AmConsoleTeleportServer.h"
#include "ChooseYourDestinationNsToNt.h"
#include "AMFFormat.h"
void AmConsoleTeleportServer::OnStartup(Entity* self)
{

View File

@@ -1,8 +1,6 @@
#pragma once
#include "CppScripts.h"
#include "ChooseYourDestinationNsToNt.h"
#include "BaseConsoleTeleportServer.h"
#include "AMFFormat.h"
class AmConsoleTeleportServer : public CppScripts::Script, BaseConsoleTeleportServer
{

View File

@@ -6,7 +6,6 @@
#include "SkillComponent.h"
#include "BaseCombatAIComponent.h"
void AmDarklingDragon::OnStartup(Entity* self) {
self->SetVar<int32_t>(u"weakspot", 0);
@@ -48,15 +47,11 @@ void AmDarklingDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
if (destroyableComponent != nullptr) {
Game::logger->Log("AmDarklingDragon", "Armor is %i\n", destroyableComponent->GetArmor());
if (destroyableComponent->GetArmor() > 0) return;
auto weakpoint = self->GetVar<int32_t>(u"weakpoint");
if (weakpoint == 0) {
Game::logger->Log("AmDarklingDragon", "Activating weakpoint\n");
self->AddTimer("ReviveTimer", 12);
auto* baseCombatAIComponent = self->GetComponent<BaseCombatAIComponent>();

View File

@@ -1,5 +1,4 @@
#include "AmDarklingMech.h"
#include "DestroyableComponent.h"
void AmDarklingMech::OnStartup(Entity* self)
{

View File

@@ -1,8 +1,5 @@
#pragma once
#include "CppScripts.h"
#include "ChooseYourDestinationNsToNt.h"
#include "BaseConsoleTeleportServer.h"
#include "AMFFormat.h"
#include "BaseEnemyMech.h"
class AmDarklingMech : public BaseEnemyMech

View File

@@ -3,7 +3,6 @@
#include "GameMessages.h"
#include "SimplePhysicsComponent.h"
void AmDrawBridge::OnStartup(Entity* self)
{
self->SetNetworkVar(u"InUse", false);

View File

@@ -2,7 +2,6 @@
#include "MissionComponent.h"
#include "RebuildComponent.h"
#include "InventoryComponent.h"
#include "GameMessages.h"
#include "dZoneManager.h"
void AmDropshipComputer::OnStartup(Entity* self)
@@ -27,12 +26,12 @@ void AmDropshipComputer::OnUse(Entity* self, Entity* user)
return;
}
if (inventoryComponent->GetLotCount(12323) != 0)
if (inventoryComponent->GetLotCount(m_NexusTalonDataCard) != 0 || missionComponent->GetMission(979)->GetMissionState() == MissionState::MISSION_STATE_COMPLETE)
{
return;
}
inventoryComponent->AddItem(12323, 1, eLootSourceType::LOOT_SOURCE_NONE);
inventoryComponent->AddItem(m_NexusTalonDataCard, 1, eLootSourceType::LOOT_SOURCE_NONE);
}
void AmDropshipComputer::OnDie(Entity* self, Entity* killer)

View File

@@ -8,4 +8,6 @@ public:
void OnUse(Entity* self, Entity* user) override;
void OnDie(Entity* self, Entity* killer) override;
void OnTimerDone(Entity* self, std::string timerName) override;
private:
const LOT m_NexusTalonDataCard = 12323;
};

View File

@@ -6,7 +6,6 @@
#include "BaseCombatAIComponent.h"
#include "SkillComponent.h"
void AmShieldGenerator::OnStartup(Entity* self)
{
self->SetProximityRadius(20, "shield");

View File

@@ -8,7 +8,6 @@
#include "RebuildComponent.h"
#include "MissionComponent.h"
void AmShieldGeneratorQuickbuild::OnStartup(Entity* self)
{
self->SetProximityRadius(20, "shield");

View File

@@ -87,8 +87,6 @@ void AmSkullkinDrill::TriggerDrill(Entity* self)
if (standObj != nullptr)
{
Game::logger->Log("AmSkullkinDrill", "Disabling knockback\n");
standObj->SetVar(u"bActive", false);
}
@@ -213,8 +211,6 @@ void AmSkullkinDrill::OnArrived(Entity* self, uint32_t waypointIndex)
if (standObj != nullptr)
{
Game::logger->Log("AmSkullkinDrill", "Disabling knockback\n");
standObj->SetVar(u"bActive", false);
}
@@ -302,8 +298,6 @@ void AmSkullkinDrill::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t
void AmSkullkinDrill::OnTimerDone(Entity* self, std::string timerName)
{
Game::logger->Log("AmSkullkinDrill", "Timer: %s\n", timerName.c_str());
if (timerName == "killDrill")
{
const auto childID = self->GetVar<LWOOBJID>(u"ChildSmash");
@@ -323,8 +317,6 @@ void AmSkullkinDrill::OnTimerDone(Entity* self, std::string timerName)
if (standObj != nullptr)
{
Game::logger->Log("AmSkullkinDrill", "Enabling knockback\n");
standObj->SetVar(u"bActive", true);
}
@@ -351,8 +343,6 @@ void AmSkullkinDrill::OnTimerDone(Entity* self, std::string timerName)
{
const auto& animName = data[1];
Game::logger->Log("AmSkullkinDrill", "Anim done: %s\n", animName.c_str());
const auto playerID = self->GetVar<LWOOBJID>(u"userID");
auto* player = EntityManager::Instance()->GetEntity(playerID);
@@ -364,8 +354,6 @@ void AmSkullkinDrill::OnTimerDone(Entity* self, std::string timerName)
if (animName == "spinjitzu-staff-windup")
{
Game::logger->Log("AmSkullkinDrill", "Triggering drill\n");
TriggerDrill(self);
GameMessages::SendPlayAnimation(player, u"spinjitzu-staff-loop");

View File

@@ -2,7 +2,6 @@
#include "EntityManager.h"
#include "DestroyableComponent.h"
#include "MovingPlatformComponent.h"
#include "dCommonVars.h"
#include "GameMessages.h"
#include "MissionComponent.h"

View File

@@ -1,8 +1,6 @@
#include "BaseConsoleTeleportServer.h"
#include "GameMessages.h"
#include "Player.h"
#include "RocketLaunchpadControlComponent.h"
void BaseConsoleTeleportServer::BaseOnUse(Entity* self, Entity* user)
{

View File

@@ -1,8 +1,5 @@
#include "BaseEnemyMech.h"
#include "Entity.h"
#include "GameMessages.h"
#include "Game.h"
#include "dLogger.h"
#include "ControllablePhysicsComponent.h"
#include "EntityManager.h"
#include "dpWorld.h"
@@ -21,7 +18,6 @@ void BaseEnemyMech::OnDie(Entity* self, Entity* killer) {
if (!controlPhys) return;
NiPoint3 newLoc = {controlPhys->GetPosition().x, dpWorld::Instance().GetHeightAtPoint(controlPhys->GetPosition()), controlPhys->GetPosition().z };
//NiPoint3 newLoc = { controlPhys->GetPosition().x, controlPhys->GetPosition().y, controlPhys->GetPosition().z };
EntityInfo info = EntityInfo();
std::vector<LDFBaseData*> cfg;

View File

@@ -12,7 +12,7 @@ void BaseFootRaceManager::OnFireEventServerSide(Entity *self, Entity *sender, st
if (splitArguments.size() > 1) {
const auto eventName = splitArguments[0];
const auto player = EntityManager::Instance()->GetEntity(std::stol(splitArguments[1]));
const auto player = EntityManager::Instance()->GetEntity(std::stoull(splitArguments[1]));
if (player != nullptr) {
if (eventName == "updatePlayer") {

View File

@@ -1,6 +1,4 @@
#include "BasePropertyServer.h"
#include <utility>
#include "dCommonVars.h"
#include "GameMessages.h"
#include "EntityManager.h"
#include "dZoneManager.h"
@@ -8,7 +6,8 @@
#include "DestroyableComponent.h"
#include "Entity.h"
#include "RenderComponent.h"
#include "dServer.h"
#include "PropertyManagementComponent.h"
#include "MissionComponent.h"
void BasePropertyServer::SetGameVariables(Entity *self) {
self->SetVar<std::string>(ClaimMarkerGroup, "");
@@ -170,11 +169,10 @@ void BasePropertyServer::BaseZonePropertyRented(Entity* self, Entity* player) co
EntityManager::Instance()->DestructEntity(plaque);
}
if (self->GetVar<int32_t>(brickLinkMissionIDFlag) != 0) {
auto plaques = EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(PropertyPlaqueGroup));
for (auto* plaque : plaques) {
EntityManager::Instance()->DestructEntity(plaque);
}
auto brickLinkMissionID = self->GetVar<uint32_t>(brickLinkMissionIDFlag);
if (brickLinkMissionID != 0) {
auto missionComponent = player->GetComponent<MissionComponent>();
if (missionComponent) missionComponent->CompleteMission(brickLinkMissionID, true);
}
ActivateSpawner(self->GetVar<std::string>(PropObjsSpawner));
@@ -337,7 +335,7 @@ void BasePropertyServer::BaseTimerDone(Entity* self, const std::string& timerNam
const auto zoneId = dZoneManager::Instance()->GetZone()->GetWorldID();
// No guard for the spider instance fight
if (Game::server->GetZoneID() == 1150)
if (dZoneManager::Instance()->GetZoneID().GetMapID() == 1150)
return;
const auto entities = EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(GuardGroup));

View File

@@ -1,7 +1,5 @@
#pragma once
#include "CppScripts.h"
#include "PropertyManagementComponent.h"
#include "PropertyVendorComponent.h"
class BasePropertyServer : public CppScripts::Script {
public:

View File

@@ -1,8 +1,8 @@
#include "BaseRandomServer.h"
#include "EntityManager.h"
#include "dZoneManager.h"
#include "DestroyableComponent.h"
#include "Spawner.h"
#include "dLogger.h"
#include "Entity.h"
void BaseRandomServer::BaseStartup(Entity* self)
{

View File

@@ -1,8 +1,8 @@
#pragma once
#include "CppScripts.h"
#include "Entity.h"
#include "dCommonVars.h"
#include <map>
class Spawner;
class BaseRandomServer
{
public:

View File

@@ -4,6 +4,8 @@
#include "EntityManager.h"
#include "dZoneManager.h"
#include "Player.h"
#include "MissionTaskType.h"
#include "MissionComponent.h"
#include "Character.h"
void BaseSurvivalServer::SetGameVariables(Entity *self) {

View File

@@ -1,6 +1,5 @@
#pragma once
#include "ActivityManager.h"
#include "CppScripts.h"
/**
* State for each active game

View File

@@ -4,6 +4,8 @@
#include "EntityManager.h"
#include "dZoneManager.h"
#include "Player.h"
#include "MissionTaskType.h"
#include "MissionComponent.h"
#include "Character.h"
// Done
@@ -60,8 +62,11 @@ void BaseWavesServer::BaseStartup(Entity* self) {
// Done
void BaseWavesServer::BasePlayerExit(Entity* self, Entity* player) {
state.waitingPlayers.erase(std::find(state.waitingPlayers.begin(), state.waitingPlayers.end(), player->GetObjectID()));
state.players.erase(std::find(state.players.begin(), state.players.end(), player->GetObjectID()));
auto waitingPlayerToErase = std::find(state.waitingPlayers.begin(), state.waitingPlayers.end(), player->GetObjectID());
if (waitingPlayerToErase != state.waitingPlayers.end()) state.waitingPlayers.erase(waitingPlayerToErase);
auto playerToErase = std::find(state.players.begin(), state.players.end(), player->GetObjectID());
if (playerToErase != state.players.end()) state.players.erase(playerToErase);
if (!self->GetNetworkVar<bool>(WavesStartedVariable)) {
PlayerConfirmed(self);

View File

@@ -1,6 +1,5 @@
#pragma once
#include "ActivityManager.h"
#include "CppScripts.h"
/**
* State for each active game

View File

@@ -1,6 +1,8 @@
#include "BootyDigServer.h"
#include "EntityManager.h"
#include "RenderComponent.h"
#include "MissionComponent.h"
#include "MissionTaskType.h"
void BootyDigServer::OnStartup(Entity *self) {
auto* zoneControlObject = EntityManager::Instance()->GetZoneControlEntity();

View File

@@ -6,7 +6,10 @@
#include "EntityManager.h"
#include "Entity.h"
#include "dZoneManager.h"
#include "dServer.h"
#include "DestroyableComponent.h"
#include "ControllablePhysicsComponent.h"
#include "BaseCombatAIComponent.h"
#include "GameMessages.h"
#include "SkillComponent.h"
@@ -49,7 +52,7 @@ void BossSpiderQueenEnemyServer::OnStartup(Entity* self) {
}
void BossSpiderQueenEnemyServer::OnDie(Entity* self, Entity* killer) {
if (Game::server->GetZoneID() == instanceZoneID) {
if (dZoneManager::Instance()->GetZoneID().GetMapID() == instanceZoneID) {
auto* missionComponent = killer->GetComponent<MissionComponent>();
if (missionComponent == nullptr)
return;

View File

@@ -1,10 +1,6 @@
#pragma once
#include "CppScripts.h"
#include "DestroyableComponent.h"
#include "ControllablePhysicsComponent.h"
#include "BaseCombatAIComponent.h"
/*
--------------------------------------------------------------
@@ -17,7 +13,9 @@
--------------------------------------------------------------
*/
class DestroyableComponent;
class ControllablePhysicsComponent;
class BaseCombatAIComponent;
class BossSpiderQueenEnemyServer final : public CppScripts::Script {
public:
void OnStartup(Entity* self) override;

View File

@@ -1,6 +1,5 @@
#include "BuccaneerValiantShip.h"
#include "SkillComponent.h"
#include "dLogger.h"
void BuccaneerValiantShip::OnStartup(Entity* self) {
self->AddCallbackTimer(1.0F, [self]() {

View File

@@ -1,7 +1,5 @@
#include "BurningTile.h"
#include "SkillComponent.h"
#include "GameMessages.h"
void BurningTile::OnFireEventServerSide(Entity *self, Entity *sender, std::string args, int32_t param1, int32_t param2, int32_t param3)
{

253
dScripts/CMakeLists.txt Normal file
View File

@@ -0,0 +1,253 @@
set(DSCRIPT_SOURCES "ActivityManager.cpp"
"ActMine.cpp"
"ActNinjaTurret.cpp"
"ActParadoxPipeFix.cpp"
"ActPlayerDeathTrigger.cpp"
"ActSharkPlayerDeathTrigger.cpp"
"ActVehicleDeathTrigger.cpp"
"AgBugsprayer.cpp"
"AgBusDoor.cpp"
"AgCagedBricksServer.cpp"
"AgDarkSpiderling.cpp"
"AgFans.cpp"
"AgImagSmashable.cpp"
"AgJetEffectServer.cpp"
"AgLaserSensorServer.cpp"
"AgMonumentBirds.cpp"
"AgMonumentLaserServer.cpp"
"AgMonumentRaceCancel.cpp"
"AgMonumentRaceGoal.cpp"
"AgPicnicBlanket.cpp"
"AgPropGuard.cpp"
"AgPropguards.cpp"
"AgQbElevator.cpp"
"AgSalutingNpcs.cpp"
"AgShipPlayerDeathTrigger.cpp"
"AgShipPlayerShockServer.cpp"
"AgSpaceStuff.cpp"
"AgStagePlatforms.cpp"
"AgStromlingProperty.cpp"
"AgSurvivalBuffStation.cpp"
"AgSurvivalMech.cpp"
"AgSurvivalSpiderling.cpp"
"AgSurvivalStromling.cpp"
"AgTurret.cpp"
"AllCrateChicken.cpp"
"AmBlueX.cpp"
"AmBridge.cpp"
"AmConsoleTeleportServer.cpp"
"AmDarklingDragon.cpp"
"AmDarklingMech.cpp"
"AmDrawBridge.cpp"
"AmDropshipComputer.cpp"
"AmScrollReaderServer.cpp"
"AmShieldGenerator.cpp"
"AmShieldGeneratorQuickbuild.cpp"
"AmSkeletonEngineer.cpp"
"AmSkullkinDrill.cpp"
"AmSkullkinDrillStand.cpp"
"AmSkullkinTower.cpp"
"AmTeapotServer.cpp"
"AmTemplateSkillVolume.cpp"
"AnvilOfArmor.cpp"
"BankInteractServer.cpp"
"BaseConsoleTeleportServer.cpp"
"BaseEnemyApe.cpp"
"BaseEnemyMech.cpp"
"BaseFootRaceManager.cpp"
"BaseInteractDropLootServer.cpp"
"BasePropertyServer.cpp"
"BaseRandomServer.cpp"
"BaseSurvivalServer.cpp"
"BaseWavesGenericEnemy.cpp"
"BaseWavesServer.cpp"
"Binoculars.cpp"
"BootyDigServer.cpp"
"BossSpiderQueenEnemyServer.cpp"
"BuccaneerValiantShip.cpp"
"BurningTile.cpp"
"CatapultBaseServer.cpp"
"CatapultBouncerServer.cpp"
"CauldronOfLife.cpp"
"CavePrisonCage.cpp"
"ChooseYourDestinationNsToNt.cpp"
"ClRing.cpp"
"CppScripts.cpp"
"CrabServer.cpp"
"DamagingPets.cpp"
"Darkitect.cpp"
"DLUVanityNPC.cpp"
"EnemyNjBuff.cpp"
"EnemyRoninSpawner.cpp"
"EnemySkeletonSpawner.cpp"
"EnemySpiderSpawner.cpp"
"ExplodingAsset.cpp"
"FallingTile.cpp"
"FireFirstSkillonStartup.cpp"
"FlameJetServer.cpp"
"ForceVolumeServer.cpp"
"FountainOfImagination.cpp"
"FvBounceOverWall.cpp"
"FvBrickPuzzleServer.cpp"
"FvCandle.cpp"
"FvConsoleLeftQuickbuild.cpp"
"FvConsoleRightQuickbuild.cpp"
"FvDragonSmashingGolemQb.cpp"
"FvFacilityBrick.cpp"
"FvFlyingCreviceDragon.cpp"
"FvFong.cpp"
"FvFreeGfNinjas.cpp"
"FvHorsemenTrigger.cpp"
"FvMaelstromCavalry.cpp"
"FvMaelstromDragon.cpp"
"FvNinjaGuard.cpp"
"FvPandaServer.cpp"
"FvPandaSpawnerServer.cpp"
"FvPassThroughWall.cpp"
"FvRaceSmashEggImagineServer.cpp"
"GfApeSmashingQB.cpp"
"GfBanana.cpp"
"GfBananaCluster.cpp"
"GfCampfire.cpp"
"GfCaptainsCannon.cpp"
"GfJailkeepMission.cpp"
"GfJailWalls.cpp"
"GfOrgan.cpp"
"GfTikiTorch.cpp"
"GrowingFlower.cpp"
"HydrantBroken.cpp"
"HydrantSmashable.cpp"
"ImaginationBackpackHealServer.cpp"
"ImaginationShrineServer.cpp"
"ImgBrickConsoleQB.cpp"
"InstanceExitTransferPlayerToLastNonInstance.cpp"
"InvalidScript.cpp"
"LegoDieRoll.cpp"
"Lieutenant.cpp"
"MaestromExtracticatorServer.cpp"
"MailBoxServer.cpp"
"MastTeleport.cpp"
"MinigameTreasureChestServer.cpp"
"MonCoreNookDoors.cpp"
"MonCoreSmashableDoors.cpp"
"NjColeNPC.cpp"
"NjDragonEmblemChestServer.cpp"
"NjEarthDragonPetServer.cpp"
"NjEarthPetServer.cpp"
"NjGarmadonCelebration.cpp"
"NjhubLavaPlayerDeathTrigger.cpp"
"NjIceRailActivator.cpp"
"NjJayMissionItems.cpp"
"NjMonastryBossInstance.cpp"
"NjNPCMissionSpinjitzuServer.cpp"
"NjNyaMissionitems.cpp"
"NjRailActivatorsServer.cpp"
"NjRailPostServer.cpp"
"NjRailSwitch.cpp"
"NjScrollChestServer.cpp"
"NjWuNPC.cpp"
"NPCAddRemoveItem.cpp"
"NpcAgCourseStarter.cpp"
"NpcCowboyServer.cpp"
"NpcEpsilonServer.cpp"
"NpcNjAssistantServer.cpp"
"NpcNpSpacemanBob.cpp"
"NpcPirateServer.cpp"
"NpcWispServer.cpp"
"NsConcertChoiceBuild.cpp"
"NsConcertChoiceBuildManager.cpp"
"NsConcertInstrument.cpp"
"NsConcertQuickBuild.cpp"
"NsGetFactionMissionServer.cpp"
"NsJohnnyMissionServer.cpp"
"NsLegoClubDoor.cpp"
"NsLupTeleport.cpp"
"NsModularBuild.cpp"
"NsQbImaginationStatue.cpp"
"NsTokenConsoleServer.cpp"
"NtAssemblyTubeServer.cpp"
"NtBeamImaginationCollectors.cpp"
"NtCombatChallengeDummy.cpp"
"NtCombatChallengeExplodingDummy.cpp"
"NtCombatChallengeServer.cpp"
"NtConsoleTeleportServer.cpp"
"NtDarkitectRevealServer.cpp"
"NtDirtCloudServer.cpp"
"NtDukeServer.cpp"
"NtFactionSpyServer.cpp"
"NtHaelServer.cpp"
"NtImagBeamBuffer.cpp"
"NtOverbuildServer.cpp"
"NtParadoxPanelServer.cpp"
"NtParadoxTeleServer.cpp"
"NtSentinelWalkwayServer.cpp"
"NtSleepingGuard.cpp"
"NtVandaServer.cpp"
"NtVentureCannonServer.cpp"
"NtVentureSpeedPadServer.cpp"
"NtXRayServer.cpp"
"PersonalFortress.cpp"
"PetDigBuild.cpp"
"PetDigServer.cpp"
"PetFromDigServer.cpp"
"PetFromObjectServer.cpp"
"PropertyBankInteract.cpp"
"PropertyDeathPlane.cpp"
"PropertyDevice.cpp"
"PropertyFXDamage.cpp"
"PropertyPlatform.cpp"
"PrSeagullFly.cpp"
"PrWhistle.cpp"
"QbEnemyStunner.cpp"
"RaceImagineCrateServer.cpp"
"RaceImaginePowerup.cpp"
"RaceMaelstromGeiser.cpp"
"RaceSmashServer.cpp"
"RainOfArrows.cpp"
"RandomSpawnerFin.cpp"
"RandomSpawnerPit.cpp"
"RandomSpawnerStr.cpp"
"RandomSpawnerZip.cpp"
"RemoveRentalGear.cpp"
"RockHydrantBroken.cpp"
"RockHydrantSmashable.cpp"
"ScriptComponent.cpp"
"ScriptedPowerupSpawner.cpp"
"SGCannon.cpp"
"SpawnGryphonServer.cpp"
"SpawnLionServer.cpp"
"SpawnPetBaseServer.cpp"
"SpawnSaberCatServer.cpp"
"SpawnShrakeServer.cpp"
"SpawnStegoServer.cpp"
"SpecialImaginePowerupSpawner.cpp"
"SpiderBossTreasureChestServer.cpp"
"SsModularBuildServer.cpp"
"StinkyFishTarget.cpp"
"StoryBoxInteractServer.cpp"
"Sunflower.cpp"
"TokenConsoleServer.cpp"
"TouchMissionUpdateServer.cpp"
"TreasureChestDragonServer.cpp"
"TriggerAmbush.cpp"
"VeBricksampleServer.cpp"
"VeEpsilonServer.cpp"
"VeMech.cpp"
"VeMissionConsole.cpp"
"WaveBossApe.cpp"
"WaveBossHammerling.cpp"
"WaveBossHorsemen.cpp"
"WaveBossSpiderling.cpp"
"WhFans.cpp"
"WildAmbients.cpp"
"WishingWellServer.cpp"
"ZoneAgMedProperty.cpp"
"ZoneAgProperty.cpp"
"ZoneAgSpiderQueen.cpp"
"ZoneAgSurvival.cpp"
"ZoneFvProperty.cpp"
"ZoneGfProperty.cpp"
"ZoneNsMedProperty.cpp"
"ZoneNsProperty.cpp"
"ZoneNsWaves.cpp"
"ZoneSGServer.cpp" PARENT_SCOPE)

View File

@@ -1,8 +1,6 @@
#include "CatapultBaseServer.h"
#include "GameMessages.h"
#include "EntityManager.h"
#include "dZoneManager.h"
void CatapultBaseServer::OnNotifyObject(Entity *self, Entity *sender, const std::string& name, int32_t param1, int32_t param2)
{

View File

@@ -1,8 +1,5 @@
#pragma once
#include "CppScripts.h"
#include "Spawner.h"
#include "dZoneManager.h"
#include "dCommonVars.h"
class CatapultBaseServer : public CppScripts::Script {
public:

View File

@@ -1,7 +1,6 @@
#include "CatapultBouncerServer.h"
#include "GameMessages.h"
#include "EntityManager.h"
#include "dZoneManager.h"
void CatapultBouncerServer::OnRebuildComplete(Entity* self, Entity* target)
{

View File

@@ -1,8 +1,5 @@
#pragma once
#include "CppScripts.h"
#include "Spawner.h"
#include "dZoneManager.h"
#include "dCommonVars.h"
class CatapultBouncerServer : public CppScripts::Script {
public:

View File

@@ -1,9 +1,9 @@
#include "CavePrisonCage.h"
#include "EntityManager.h"
#include "RebuildComponent.h"
#include "MovingPlatformComponent.h"
#include "GameMessages.h"
#include "Character.h"
#include "dZoneManager.h"
void CavePrisonCage::OnStartup(Entity *self)
{

View File

@@ -1,8 +1,5 @@
#pragma once
#include "CppScripts.h"
#include "Spawner.h"
#include "dZoneManager.h"
#include "dCommonVars.h"
class CavePrisonCage : public CppScripts::Script {
public:

View File

@@ -1,8 +1,6 @@
#include "ChooseYourDestinationNsToNt.h"
#include "Character.h"
#include "GameMessages.h"
#include "dZoneManager.h"
#include "EntityManager.h"
bool ChooseYourDestinationNsToNt::CheckChoice(Entity* self, Entity* player)
{

View File

@@ -1,5 +1,4 @@
#pragma once
#include "CppScripts.h"
class ChooseYourDestinationNsToNt
{

View File

@@ -1,6 +1,4 @@
#include "ClRing.h"
#include "EntityManager.h"
#include "Character.h"
void ClRing::OnCollisionPhantom(Entity* self, Entity* target)
{

View File

@@ -4,10 +4,8 @@
#include "CppScripts.h"
#include "GameMessages.h"
#include "dpWorld.h"
#include "Entity.h"
#include "ScriptComponent.h"
#include "EntityManager.h"
#include "Game.h"
#include "dLogger.h"
#include "InvalidScript.h"
@@ -164,6 +162,8 @@
#include "BaseFootRaceManager.h"
#include "PropertyPlatform.h"
#include "MailBoxServer.h"
#include "ActMine.h"
#include "FireFirstSkillonStartup.h"
// Racing Scripts
#include "RaceImagineCrateServer.h"
@@ -591,6 +591,8 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
return new VeBricksampleServer();
else if (scriptName == "scripts\\02_server\\Map\\General\\L_MAIL_BOX_SERVER.lua")
script = new MailBoxServer();
else if (scriptName == "scripts\\ai\\ACT\\L_ACT_MINE.lua")
script = new ActMine();
//Racing:
else if (scriptName == "scripts\\ai\\RACING\\OBJECTS\\RACE_IMAGINE_CRATE_SERVER.lua")
@@ -801,7 +803,8 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
script = new LegoDieRoll();
else if (scriptName == "scripts\\EquipmentScripts\\BuccaneerValiantShip.lua")
script = new BuccaneerValiantShip();
else if (scriptName == "scripts\\EquipmentScripts\\FireFirstSkillonStartup.lua")
script = new FireFirstSkillonStartup();
// FB
else if (scriptName == "scripts\\ai\\NS\\WH\\L_ROCKHYDRANT_BROKEN.lua")
script = new RockHydrantBroken();

View File

@@ -1,12 +1,8 @@
#pragma once
#include "dCommonVars.h"
#include "RakNetTypes.h"
#include <string>
#include "MissionComponent.h"
#include "MissionState.h"
#include "Game.h"
#include "dLogger.h"
#include "Loot.h"
#include <string>
#include <vector>
class User;
class Entity;

View File

@@ -1,6 +1,7 @@
#include "DLUVanityNPC.h"
#include "GameMessages.h"
#include "dServer.h"
#include "VanityUtilities.h"
void DLUVanityNPC::OnStartup(Entity* self)
{

View File

@@ -1,7 +1,7 @@
#pragma once
#include "CppScripts.h"
#include "VanityUtilities.h"
class VanityNPC;
class DLUVanityNPC : public CppScripts::Script
{
public:

View File

@@ -1,5 +1,4 @@
#pragma once
#include "CppScripts.h"
/**

View File

@@ -1,5 +1,4 @@
#pragma once
class Entity;
class Darkitect

View File

@@ -1,9 +1,7 @@
#include "EnemySpiderSpawner.h"
#include "GameMessages.h"
#include "SimplePhysicsComponent.h"
#include "EntityManager.h"
#include "DestroyableComponent.h"
#include "MovementAIComponent.h"
//----------------------------------------------
//--Initiate egg hatching on call

View File

@@ -1,7 +1,7 @@
#include "ExplodingAsset.h"
#include "DestroyableComponent.h"
#include "GameMessages.h"
#include "MissionComponent.h"
#include "SkillComponent.h"
//TODO: this has to be updated so that you only get killed if you're in a certain radius.

View File

@@ -2,7 +2,6 @@
#include "MovingPlatformComponent.h"
#include "GameMessages.h"
void FallingTile::OnStartup(Entity* self)
{
auto* movingPlatfromComponent = self->GetComponent<MovingPlatformComponent>();

View File

@@ -0,0 +1,24 @@
#include "FireFirstSkillonStartup.h"
#include "Entity.h"
#include "SkillComponent.h"
#include "CDClientDatabase.h"
#include "CDObjectSkillsTable.h"
void FireFirstSkillonStartup::OnStartup(Entity* self) {
auto skillComponent = self->GetComponent<SkillComponent>();
if (!skillComponent) return;
// Get the skill IDs of this object.
CDObjectSkillsTable* skillsTable = CDClientManager::Instance()->GetTable<CDObjectSkillsTable>("ObjectSkills");
std::vector<CDObjectSkills> skills = skillsTable->Query([=](CDObjectSkills entry) {return (entry.objectTemplate == self->GetLOT()); });
// For each skill, cast it with the associated behavior ID.
for (auto skill : skills) {
CDSkillBehaviorTable* skillBehaviorTable = CDClientManager::Instance()->GetTable<CDSkillBehaviorTable>("SkillBehavior");
CDSkillBehavior behaviorData = skillBehaviorTable->GetSkillByID(skill.skillID);
// Should parent entity be null, make the originator self.
const auto target = self->GetParentEntity() ? self->GetParentEntity()->GetObjectID() : self->GetObjectID();
skillComponent->CalculateBehavior(skill.skillID, behaviorData.behaviorID, LWOOBJID_EMPTY, false, false, target);
}
}

View File

@@ -0,0 +1,12 @@
#pragma once
#ifndef __FIREFIRSTSKILLONSTARTUP__H__
#define __FIREFIRSTSKILLONSTARTUP__H__
#include "CppScripts.h"
class FireFirstSkillonStartup : public CppScripts::Script {
public:
void OnStartup(Entity* self) override;
};
#endif //!__FIREFIRSTSKILLONSTARTUP__H__

View File

@@ -1,5 +1,4 @@
#include "FlameJetServer.h"
#include "SkillComponent.h"
#include "GameMessages.h"

View File

@@ -2,17 +2,11 @@
#include "PhantomPhysicsComponent.h"
#include "EntityManager.h"
void ForceVolumeServer::OnStartup(Entity* self)
{
auto* phantomPhysicsComponent = self->GetComponent<PhantomPhysicsComponent>();
if (phantomPhysicsComponent == nullptr)
{
Game::logger->Log("ForceVolumeServer", "Failed to find PhantomPhysicsComponent\n");
return;
}
if (phantomPhysicsComponent == nullptr) return;
const auto forceAmount = self->GetVar<float>(u"ForceAmt");
const auto forceX = self->GetVar<float>(u"ForceX");

View File

@@ -1,4 +1,6 @@
#include "FountainOfImagination.h"
#include "dCommonVars.h"
#include "Entity.h"
void FountainOfImagination::OnStartup(Entity *self) {
self->SetVar<uint32_t>(u"numCycles", 6);

View File

@@ -1,4 +1,5 @@
#include "FvBounceOverWall.h"
#include "MissionComponent.h"
void FvBounceOverWall::OnCollisionPhantom(Entity* self, Entity* target) {
auto missionComponent = target->GetComponent<MissionComponent>();

View File

@@ -1,5 +1,6 @@
#include "FvCandle.h"
#include "MissionComponent.h"
#include "RenderComponent.h"
std::vector<int32_t> FvCandle::m_Missions = {850, 1431, 1529, 1566, 1603};

View File

@@ -1,6 +1,5 @@
#pragma once
#include "CppScripts.h"
#include "RenderComponent.h"
class FvCandle : public CppScripts::Script
{

View File

@@ -1,7 +1,4 @@
#include "FvConsoleLeftQuickbuild.h"
#include "RebuildComponent.h"
#include "GeneralUtils.h"
#include "dZoneManager.h"
#include "EntityManager.h"
#include "GameMessages.h"

View File

@@ -1,7 +1,4 @@
#include "FvConsoleRightQuickbuild.h"
#include "RebuildComponent.h"
#include "GeneralUtils.h"
#include "dZoneManager.h"
#include "EntityManager.h"
#include "GameMessages.h"

View File

@@ -1,10 +1,8 @@
#include "FvFacilityBrick.h"
#include "GameMessages.h"
#include "GeneralUtils.h"
#include "dZoneManager.h"
#include "EntityManager.h"
void FvFacilityBrick::OnStartup(Entity* self)
{
self->SetVar(u"ConsoleLEFTActive", false);
@@ -13,8 +11,6 @@ void FvFacilityBrick::OnStartup(Entity* self)
void FvFacilityBrick::OnNotifyObject(Entity *self, Entity *sender, const std::string& name, int32_t param1, int32_t param2)
{
Game::logger->Log("FvFacilityBrick", "Notify: %s\n", name.c_str());
auto* brickSpawner = dZoneManager::Instance()->GetSpawnersByName("ImaginationBrick")[0];
auto* bugSpawner = dZoneManager::Instance()->GetSpawnersByName("MaelstromBug")[0];
auto* canisterSpawner = dZoneManager::Instance()->GetSpawnersByName("BrickCanister")[0];

View File

@@ -1,6 +1,6 @@
#include "FvFong.h"
#include "Darkitect.h"
#include "MissionComponent.h"
#include "MissionState.h"
void FvFong::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState)
{

View File

@@ -1,5 +1,6 @@
#include "FvFreeGfNinjas.h"
#include "Character.h"
#include "MissionComponent.h"
void FvFreeGfNinjas::OnMissionDialogueOK(Entity *self, Entity *target, int missionID, MissionState missionState) {
if (missionID == 705 && missionState == MissionState::MISSION_STATE_AVAILABLE) {

View File

@@ -11,8 +11,6 @@ void FvHorsemenTrigger::OnStartup(Entity* self)
void FvHorsemenTrigger::OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status)
{
Game::logger->Log("FvHorsemenTrigger", "Proximity update\n");
if (name != "horsemenTrigger" || !entering->IsPlayer())
{
return;
@@ -24,12 +22,10 @@ void FvHorsemenTrigger::OnProximityUpdate(Entity* self, Entity* entering, std::s
if (status == "ENTER" && iter == players.end())
{
Game::logger->Log("FvHorsemenTrigger", "Proximity enter\n");
players.push_back(entering->GetObjectID());
}
else if (status == "LEAVE" && iter != players.end())
{
Game::logger->Log("FvHorsemenTrigger", "Proximity leave\n");
players.erase(iter);
}
@@ -42,7 +38,6 @@ FvHorsemenTrigger::OnFireEventServerSide(Entity *self, Entity *sender, std::stri
{
auto players = self->GetVar<std::vector<LWOOBJID>>(u"players");
Game::logger->Log("FvHorsemenTrigger", "Got event %s with %i players\n", args.c_str(), players.size());
if (args == "HorsemenDeath")
{
for (const auto& playerId : self->GetVar<std::vector<LWOOBJID>>(u"players"))

View File

@@ -5,16 +5,12 @@ void FvMaelstromCavalry::OnStartup(Entity* self)
{
for (const auto& group : self->GetGroups())
{
Game::logger->Log("FvMaelstromCavalry", "Got group: %s\n", group.c_str());
const auto& objects = EntityManager::Instance()->GetEntitiesInGroup(group);
for (auto* obj : objects)
{
if (obj->GetLOT() != 8551) continue;
Game::logger->Log("FvMaelstromCavalry", "Trigger in group: %s\n", group.c_str());
obj->OnFireEventServerSide(self, "ISpawned");
}
}
@@ -27,8 +23,6 @@ void FvMaelstromCavalry::OnDie(Entity* self, Entity* killer)
return;
}
Game::logger->Log("FvMaelstromCavalry", "Killer: %i\n", killer->GetLOT());
if (killer->GetLOT() != 8665)
{
return;
@@ -38,8 +32,6 @@ void FvMaelstromCavalry::OnDie(Entity* self, Entity* killer)
for (auto* trigger : triggers)
{
Game::logger->Log("FvMaelstromCavalry", "Trigger for: %i\n", killer->GetLOT());
trigger->OnFireEventServerSide(self, "HorsemenDeath");
}
}

View File

@@ -1,6 +1,5 @@
#pragma once
#include "CppScripts.h"
#include "RenderComponent.h"
class FvMaelstromCavalry : public CppScripts::Script
{

View File

@@ -2,7 +2,6 @@
#include "EntityManager.h"
#include "SkillComponent.h"
#include "BaseCombatAIComponent.h"
#include "RenderComponent.h"
#include "DestroyableComponent.h"
void FvMaelstromDragon::OnStartup(Entity* self)

View File

@@ -1,6 +1,5 @@
#pragma once
#include "CppScripts.h"
#include "RenderComponent.h"
class FvMaelstromDragon : public CppScripts::Script
{

View File

@@ -1,5 +1,6 @@
#include "FvPassThroughWall.h"
#include "InventoryComponent.h"
#include "MissionComponent.h"
void FvPassThroughWall::OnCollisionPhantom(Entity* self, Entity* target) {
auto missionComponent = target->GetComponent<MissionComponent>();

View File

@@ -1,9 +1,10 @@
#include "FvRaceSmashEggImagineServer.h"
#include "CharacterComponent.h"
#include "DestroyableComponent.h"
#include "EntityManager.h"
#include "FvRaceSmashEggImagineServer.h"
#include "PossessableComponent.h"
#include "RacingTaskParam.h"
#include "MissionComponent.h"
void FvRaceSmashEggImagineServer::OnDie(Entity *self, Entity *killer) {
if (killer != nullptr) {

View File

@@ -3,12 +3,9 @@
#include "Entity.h"
#include "DestroyableComponent.h"
#include "EntityManager.h"
#include "dLogger.h"
void GfBanana::SpawnBanana(Entity* self)
{
Game::logger->Log("GfBanana", "Spawning banana\n");
auto position = self->GetPosition();
const auto rotation = self->GetRotation();
@@ -44,8 +41,6 @@ void GfBanana::OnStartup(Entity* self)
void GfBanana::OnHit(Entity* self, Entity* attacker)
{
Game::logger->Log("GfBanana", "Spawning cluster\n");
auto* destroyable = self->GetComponent<DestroyableComponent>();
destroyable->SetHealth(9999);

View File

@@ -1,4 +1,5 @@
#include "GfBananaCluster.h"
#include "Entity.h"
void GfBananaCluster::OnStartup(Entity* self)
{

View File

@@ -1,11 +1,8 @@
#include "GfCampfire.h"
#include "GameMessages.h"
#include "RenderComponent.h"
#include "SkillComponent.h"
#include "MissionComponent.h"
#include "RenderComponent.h"
#include "ProximityMonitorComponent.h"
#include "EntityManager.h"
void GfCampfire::OnStartup(Entity* self) {

View File

@@ -1,5 +1,4 @@
#include "GfJailWalls.h"
#include "EntityManager.h"
#include "dZoneManager.h"
#include "GeneralUtils.h"

View File

@@ -1,7 +1,7 @@
#include "GfTikiTorch.h"
#include "GameMessages.h"
#include "EntityManager.h"
#include "MissionComponent.h"
#include "RenderComponent.h"
void GfTikiTorch::OnStartup(Entity* self) {

View File

@@ -1,5 +1,6 @@
#include "ImaginationBackpackHealServer.h"
#include "GameMessages.h"
#include "MissionComponent.h"
void ImaginationBackpackHealServer::OnSkillEventFired(Entity *self, Entity *caster, const std::string &message) {
if (message == "CastImaginationBackpack") {

View File

@@ -1,7 +1,6 @@
#include "ImaginationShrineServer.h"
#include "RebuildComponent.h"
void ImaginationShrineServer::OnUse(Entity* self, Entity* user)
{
// If the rebuild component is complete, use the shrine

View File

@@ -197,8 +197,6 @@ void ImgBrickConsoleQB::OnDie(Entity* self, Entity* killer)
self->SetVar(u"Died", true);
Game::logger->Log("ImgBrickConsoleQB", "On Die...\n");
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
if (rebuildComponent->GetState() == REBUILD_COMPLETED)
@@ -266,16 +264,12 @@ void ImgBrickConsoleQB::OnDie(Entity* self, Entity* killer)
}
self->SetNetworkVar(u"used", false);
Game::logger->Log("ImgBrickConsoleQB", "Died...\n");
}
void ImgBrickConsoleQB::OnTimerDone(Entity* self, std::string timerName)
{
if (timerName == "reset")
{
Game::logger->Log("ImgBrickConsoleQB", "Resetting...\n");
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
if (rebuildComponent->GetState() == REBUILD_OPEN)
@@ -285,8 +279,6 @@ void ImgBrickConsoleQB::OnTimerDone(Entity* self, std::string timerName)
}
else if (timerName == "Die")
{
Game::logger->Log("ImgBrickConsoleQB", "Die...\n");
const auto consoles = EntityManager::Instance()->GetEntitiesInGroup("Console");
for (auto* console : consoles)

Some files were not shown because too many files have changed in this diff Show More