From a91309c5f8de3ba136f68ec45691cd60811a8d5e Mon Sep 17 00:00:00 2001 From: EmosewaMC <39972741+EmosewaMC@users.noreply.github.com> Date: Wed, 22 Jun 2022 21:11:31 -0700 Subject: [PATCH] Scripts A-B Gonna be doing this in alphabetical order now. --- dScripts/AgMonumentBirds.cpp | 1 - dScripts/AgPropGuard.cpp | 1 - dScripts/AgSalutingNpcs.cpp | 1 - dScripts/AgShipPlayerDeathTrigger.cpp | 4 ---- dScripts/AgSpaceStuff.cpp | 2 -- dScripts/AgSurvivalBuffStation.cpp | 1 - dScripts/AgSurvivalSpiderling.cpp | 1 - dScripts/AgTurret.cpp | 2 -- dScripts/AllCrateChicken.cpp | 2 -- dScripts/AmConsoleTeleportServer.cpp | 3 ++- dScripts/AmConsoleTeleportServer.h | 2 -- dScripts/AmDarklingDragon.cpp | 5 ----- dScripts/AmDarklingMech.cpp | 1 - dScripts/AmDarklingMech.h | 3 --- dScripts/AmDrawBridge.cpp | 1 - dScripts/AmDropshipComputer.cpp | 1 - dScripts/AmShieldGenerator.cpp | 1 - dScripts/AmShieldGeneratorQuickbuild.cpp | 1 - dScripts/AmSkullkinDrill.cpp | 13 ------------- dScripts/AmSkullkinTower.cpp | 1 - dScripts/BaseConsoleTeleportServer.cpp | 2 -- dScripts/BaseEnemyMech.cpp | 4 ---- dScripts/BasePropertyServer.cpp | 6 ++---- dScripts/BasePropertyServer.h | 2 -- dScripts/BaseRandomServer.cpp | 3 +-- dScripts/BaseRandomServer.h | 3 --- dScripts/BaseSurvivalServer.h | 1 - dScripts/BaseWavesServer.h | 1 - dScripts/BossSpiderQueenEnemyServer.cpp | 7 +++++-- dScripts/BossSpiderQueenEnemyServer.h | 8 +++----- dScripts/BuccaneerValiantShip.cpp | 1 - dScripts/BurningTile.cpp | 2 -- 32 files changed, 13 insertions(+), 74 deletions(-) diff --git a/dScripts/AgMonumentBirds.cpp b/dScripts/AgMonumentBirds.cpp index 212a0631..5870cfff 100644 --- a/dScripts/AgMonumentBirds.cpp +++ b/dScripts/AgMonumentBirds.cpp @@ -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. diff --git a/dScripts/AgPropGuard.cpp b/dScripts/AgPropGuard.cpp index 18fcd7c2..24e06722 100644 --- a/dScripts/AgPropGuard.cpp +++ b/dScripts/AgPropGuard.cpp @@ -1,7 +1,6 @@ #include "AgPropGuard.h" #include "Entity.h" #include "Character.h" -#include "GameMessages.h" #include "EntityManager.h" #include "InventoryComponent.h" #include "Item.h" diff --git a/dScripts/AgSalutingNpcs.cpp b/dScripts/AgSalutingNpcs.cpp index 6a39f06f..618dc631 100644 --- a/dScripts/AgSalutingNpcs.cpp +++ b/dScripts/AgSalutingNpcs.cpp @@ -1,5 +1,4 @@ #include "AgSalutingNpcs.h" - #include "GameMessages.h" diff --git a/dScripts/AgShipPlayerDeathTrigger.cpp b/dScripts/AgShipPlayerDeathTrigger.cpp index 6ba2d193..d20edee7 100644 --- a/dScripts/AgShipPlayerDeathTrigger.cpp +++ b/dScripts/AgShipPlayerDeathTrigger.cpp @@ -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"); } } \ No newline at end of file diff --git a/dScripts/AgSpaceStuff.cpp b/dScripts/AgSpaceStuff.cpp index 507b908f..18e4eb47 100644 --- a/dScripts/AgSpaceStuff.cpp +++ b/dScripts/AgSpaceStuff.cpp @@ -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); diff --git a/dScripts/AgSurvivalBuffStation.cpp b/dScripts/AgSurvivalBuffStation.cpp index 86a2f653..8a6cfb05 100644 --- a/dScripts/AgSurvivalBuffStation.cpp +++ b/dScripts/AgSurvivalBuffStation.cpp @@ -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) { diff --git a/dScripts/AgSurvivalSpiderling.cpp b/dScripts/AgSurvivalSpiderling.cpp index ebb0395b..d44455d8 100644 --- a/dScripts/AgSurvivalSpiderling.cpp +++ b/dScripts/AgSurvivalSpiderling.cpp @@ -1,6 +1,5 @@ #include "AgSurvivalSpiderling.h" #include "BaseCombatAIComponent.h" -#include "GameMessages.h" void AgSurvivalSpiderling::OnStartup(Entity *self) { BaseWavesGenericEnemy::OnStartup(self); diff --git a/dScripts/AgTurret.cpp b/dScripts/AgTurret.cpp index a439ecf1..6db493d5 100644 --- a/dScripts/AgTurret.cpp +++ b/dScripts/AgTurret.cpp @@ -1,6 +1,4 @@ #include "AgTurret.h" -#include "EntityManager.h" -#include "RebuildComponent.h" #include "GameMessages.h" void AgTurret::OnStartup(Entity* self) { diff --git a/dScripts/AllCrateChicken.cpp b/dScripts/AllCrateChicken.cpp index c4aeec80..1a368a80 100644 --- a/dScripts/AllCrateChicken.cpp +++ b/dScripts/AllCrateChicken.cpp @@ -1,6 +1,4 @@ #include "AllCrateChicken.h" -#include "dCommonVars.h" -#include "EntityManager.h" #include "Entity.h" void AllCrateChicken::OnStartup(Entity* self) { diff --git a/dScripts/AmConsoleTeleportServer.cpp b/dScripts/AmConsoleTeleportServer.cpp index 5c60e827..5087aae2 100644 --- a/dScripts/AmConsoleTeleportServer.cpp +++ b/dScripts/AmConsoleTeleportServer.cpp @@ -1,5 +1,6 @@ #include "AmConsoleTeleportServer.h" - +#include "ChooseYourDestinationNsToNt.h" +#include "AMFFormat.h" void AmConsoleTeleportServer::OnStartup(Entity* self) { diff --git a/dScripts/AmConsoleTeleportServer.h b/dScripts/AmConsoleTeleportServer.h index ac241ee5..8236e67e 100644 --- a/dScripts/AmConsoleTeleportServer.h +++ b/dScripts/AmConsoleTeleportServer.h @@ -1,8 +1,6 @@ #pragma once #include "CppScripts.h" -#include "ChooseYourDestinationNsToNt.h" #include "BaseConsoleTeleportServer.h" -#include "AMFFormat.h" class AmConsoleTeleportServer : public CppScripts::Script, BaseConsoleTeleportServer { diff --git a/dScripts/AmDarklingDragon.cpp b/dScripts/AmDarklingDragon.cpp index be87f466..94066167 100644 --- a/dScripts/AmDarklingDragon.cpp +++ b/dScripts/AmDarklingDragon.cpp @@ -6,7 +6,6 @@ #include "SkillComponent.h" #include "BaseCombatAIComponent.h" - void AmDarklingDragon::OnStartup(Entity* self) { self->SetVar(u"weakspot", 0); @@ -48,15 +47,11 @@ void AmDarklingDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t auto* destroyableComponent = self->GetComponent(); if (destroyableComponent != nullptr) { - Game::logger->Log("AmDarklingDragon", "Armor is %i\n", destroyableComponent->GetArmor()); - if (destroyableComponent->GetArmor() > 0) return; auto weakpoint = self->GetVar(u"weakpoint"); if (weakpoint == 0) { - Game::logger->Log("AmDarklingDragon", "Activating weakpoint\n"); - self->AddTimer("ReviveTimer", 12); auto* baseCombatAIComponent = self->GetComponent(); diff --git a/dScripts/AmDarklingMech.cpp b/dScripts/AmDarklingMech.cpp index 59eb6b45..33c3fcbf 100644 --- a/dScripts/AmDarklingMech.cpp +++ b/dScripts/AmDarklingMech.cpp @@ -1,5 +1,4 @@ #include "AmDarklingMech.h" -#include "DestroyableComponent.h" void AmDarklingMech::OnStartup(Entity* self) { diff --git a/dScripts/AmDarklingMech.h b/dScripts/AmDarklingMech.h index 363e4db8..cc179795 100644 --- a/dScripts/AmDarklingMech.h +++ b/dScripts/AmDarklingMech.h @@ -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 diff --git a/dScripts/AmDrawBridge.cpp b/dScripts/AmDrawBridge.cpp index 2c774ca1..8e52e3e4 100644 --- a/dScripts/AmDrawBridge.cpp +++ b/dScripts/AmDrawBridge.cpp @@ -3,7 +3,6 @@ #include "GameMessages.h" #include "SimplePhysicsComponent.h" - void AmDrawBridge::OnStartup(Entity* self) { self->SetNetworkVar(u"InUse", false); diff --git a/dScripts/AmDropshipComputer.cpp b/dScripts/AmDropshipComputer.cpp index 836b09b0..1e48b681 100644 --- a/dScripts/AmDropshipComputer.cpp +++ b/dScripts/AmDropshipComputer.cpp @@ -2,7 +2,6 @@ #include "MissionComponent.h" #include "RebuildComponent.h" #include "InventoryComponent.h" -#include "GameMessages.h" #include "dZoneManager.h" void AmDropshipComputer::OnStartup(Entity* self) diff --git a/dScripts/AmShieldGenerator.cpp b/dScripts/AmShieldGenerator.cpp index 1f9b5f9c..0e942612 100644 --- a/dScripts/AmShieldGenerator.cpp +++ b/dScripts/AmShieldGenerator.cpp @@ -6,7 +6,6 @@ #include "BaseCombatAIComponent.h" #include "SkillComponent.h" - void AmShieldGenerator::OnStartup(Entity* self) { self->SetProximityRadius(20, "shield"); diff --git a/dScripts/AmShieldGeneratorQuickbuild.cpp b/dScripts/AmShieldGeneratorQuickbuild.cpp index a2d99ad2..aa80148c 100644 --- a/dScripts/AmShieldGeneratorQuickbuild.cpp +++ b/dScripts/AmShieldGeneratorQuickbuild.cpp @@ -8,7 +8,6 @@ #include "RebuildComponent.h" #include "MissionComponent.h" - void AmShieldGeneratorQuickbuild::OnStartup(Entity* self) { self->SetProximityRadius(20, "shield"); diff --git a/dScripts/AmSkullkinDrill.cpp b/dScripts/AmSkullkinDrill.cpp index fb4e4c21..d5b7e7e6 100644 --- a/dScripts/AmSkullkinDrill.cpp +++ b/dScripts/AmSkullkinDrill.cpp @@ -3,7 +3,6 @@ #include "MovingPlatformComponent.h" #include "DestroyableComponent.h" #include "ProximityMonitorComponent.h" -#include "dLogger.h" #include "MissionComponent.h" void AmSkullkinDrill::OnStartup(Entity* self) @@ -88,8 +87,6 @@ void AmSkullkinDrill::TriggerDrill(Entity* self) if (standObj != nullptr) { - Game::logger->Log("AmSkullkinDrill", "Disabling knockback\n"); - standObj->SetVar(u"bActive", false); } @@ -214,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); } @@ -303,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(u"ChildSmash"); @@ -324,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); } @@ -352,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(u"userID"); auto* player = EntityManager::Instance()->GetEntity(playerID); @@ -365,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"); diff --git a/dScripts/AmSkullkinTower.cpp b/dScripts/AmSkullkinTower.cpp index 6869b94b..1b9e8c6d 100644 --- a/dScripts/AmSkullkinTower.cpp +++ b/dScripts/AmSkullkinTower.cpp @@ -2,7 +2,6 @@ #include "EntityManager.h" #include "DestroyableComponent.h" #include "MovingPlatformComponent.h" -#include "dCommonVars.h" #include "GameMessages.h" #include "MissionComponent.h" diff --git a/dScripts/BaseConsoleTeleportServer.cpp b/dScripts/BaseConsoleTeleportServer.cpp index ef2d00e0..6475e025 100644 --- a/dScripts/BaseConsoleTeleportServer.cpp +++ b/dScripts/BaseConsoleTeleportServer.cpp @@ -1,8 +1,6 @@ #include "BaseConsoleTeleportServer.h" #include "GameMessages.h" #include "Player.h" -#include "RocketLaunchpadControlComponent.h" - void BaseConsoleTeleportServer::BaseOnUse(Entity* self, Entity* user) { diff --git a/dScripts/BaseEnemyMech.cpp b/dScripts/BaseEnemyMech.cpp index eb95095a..17c7a347 100644 --- a/dScripts/BaseEnemyMech.cpp +++ b/dScripts/BaseEnemyMech.cpp @@ -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 cfg; diff --git a/dScripts/BasePropertyServer.cpp b/dScripts/BasePropertyServer.cpp index 27e3767b..faeb5bfa 100644 --- a/dScripts/BasePropertyServer.cpp +++ b/dScripts/BasePropertyServer.cpp @@ -1,6 +1,4 @@ #include "BasePropertyServer.h" -#include -#include "dCommonVars.h" #include "GameMessages.h" #include "EntityManager.h" #include "dZoneManager.h" @@ -8,7 +6,7 @@ #include "DestroyableComponent.h" #include "Entity.h" #include "RenderComponent.h" -#include "dServer.h" +#include "PropertyManagementComponent.h" void BasePropertyServer::SetGameVariables(Entity *self) { self->SetVar(ClaimMarkerGroup, ""); @@ -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(GuardGroup)); diff --git a/dScripts/BasePropertyServer.h b/dScripts/BasePropertyServer.h index 8d9a2d7e..79a52f54 100644 --- a/dScripts/BasePropertyServer.h +++ b/dScripts/BasePropertyServer.h @@ -1,7 +1,5 @@ #pragma once #include "CppScripts.h" -#include "PropertyManagementComponent.h" -#include "PropertyVendorComponent.h" class BasePropertyServer : public CppScripts::Script { public: diff --git a/dScripts/BaseRandomServer.cpp b/dScripts/BaseRandomServer.cpp index 99de3758..7026178c 100644 --- a/dScripts/BaseRandomServer.cpp +++ b/dScripts/BaseRandomServer.cpp @@ -1,9 +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) { diff --git a/dScripts/BaseRandomServer.h b/dScripts/BaseRandomServer.h index d04414f1..9db5fa83 100644 --- a/dScripts/BaseRandomServer.h +++ b/dScripts/BaseRandomServer.h @@ -1,7 +1,4 @@ #pragma once -#include "CppScripts.h" -#include "Entity.h" -#include "dCommonVars.h" class BaseRandomServer { diff --git a/dScripts/BaseSurvivalServer.h b/dScripts/BaseSurvivalServer.h index 55e1f8f9..c85f1bbf 100644 --- a/dScripts/BaseSurvivalServer.h +++ b/dScripts/BaseSurvivalServer.h @@ -1,6 +1,5 @@ #pragma once #include "ActivityManager.h" -#include "CppScripts.h" /** * State for each active game diff --git a/dScripts/BaseWavesServer.h b/dScripts/BaseWavesServer.h index cb04f50b..3dc90da8 100644 --- a/dScripts/BaseWavesServer.h +++ b/dScripts/BaseWavesServer.h @@ -1,6 +1,5 @@ #pragma once #include "ActivityManager.h" -#include "CppScripts.h" /** * State for each active game diff --git a/dScripts/BossSpiderQueenEnemyServer.cpp b/dScripts/BossSpiderQueenEnemyServer.cpp index 9896fd45..dd0b80c8 100644 --- a/dScripts/BossSpiderQueenEnemyServer.cpp +++ b/dScripts/BossSpiderQueenEnemyServer.cpp @@ -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(); if (missionComponent == nullptr) return; diff --git a/dScripts/BossSpiderQueenEnemyServer.h b/dScripts/BossSpiderQueenEnemyServer.h index 34faf055..f3219cf7 100644 --- a/dScripts/BossSpiderQueenEnemyServer.h +++ b/dScripts/BossSpiderQueenEnemyServer.h @@ -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; diff --git a/dScripts/BuccaneerValiantShip.cpp b/dScripts/BuccaneerValiantShip.cpp index 1cc1e633..710a0d1a 100644 --- a/dScripts/BuccaneerValiantShip.cpp +++ b/dScripts/BuccaneerValiantShip.cpp @@ -1,6 +1,5 @@ #include "BuccaneerValiantShip.h" #include "SkillComponent.h" -#include "dLogger.h" void BuccaneerValiantShip::OnStartup(Entity* self) { self->AddCallbackTimer(1.0F, [self]() { diff --git a/dScripts/BurningTile.cpp b/dScripts/BurningTile.cpp index 95a0bf17..b9a05391 100644 --- a/dScripts/BurningTile.cpp +++ b/dScripts/BurningTile.cpp @@ -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) {