diff --git a/scripts/native/CMakeLists.txt b/scripts/native/CMakeLists.txt index 6107d58f..aeaa0094 100644 --- a/scripts/native/CMakeLists.txt +++ b/scripts/native/CMakeLists.txt @@ -39,7 +39,7 @@ foreach(_scriptDir ${children}) endforeach() add_library("script_${_name}" MODULE "${SCRIPT_FILES}" "${SCRIPT_INCLUDE_FILES}" "${_scriptDir}/ScriptLoader.cpp") - target_link_libraries("script_${_name}" sapphire_zone common xivdat ${Boost_LIBRARIES}) + target_link_libraries("script_${_name}" sapphire_zone) if(MSVC) set_target_properties("script_${_name}" PROPERTIES @@ -53,10 +53,6 @@ foreach(_scriptDir ${children}) ) endif() - if(EXISTS "${_scriptDir}/PreInclude.h") - set(PreScriptIncludes "#include \"${_scriptDir}/PreInclude.h\"") - endif() - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ScriptLoader.cpp.in" "${_scriptDir}/ScriptLoader.cpp") add_custom_command(TARGET "script_${_name}" POST_BUILD @@ -67,6 +63,5 @@ foreach(_scriptDir ${children}) unset(ScriptIncludes) unset(ScriptNames) - unset(PreScriptIncludes) endif() endforeach() diff --git a/scripts/native/CmnDef/CmnDefCutSceneReplay.cpp b/scripts/native/CmnDef/CmnDefCutSceneReplay.cpp index 31fde89b..39bf4300 100644 --- a/scripts/native/CmnDef/CmnDefCutSceneReplay.cpp +++ b/scripts/native/CmnDef/CmnDefCutSceneReplay.cpp @@ -1,4 +1,4 @@ -#include +#include "../ScriptObject.h" class CmnDefCutSceneReplay : public EventScript { diff --git a/scripts/native/CmnDef/CmnDefInnBed.cpp b/scripts/native/CmnDef/CmnDefInnBed.cpp index 36ccd739..ac8a0a68 100644 --- a/scripts/native/CmnDef/CmnDefInnBed.cpp +++ b/scripts/native/CmnDef/CmnDefInnBed.cpp @@ -1,4 +1,4 @@ -#include +#include "../ScriptObject.h" class CmnDefInnBed : public EventScript { diff --git a/scripts/native/CmnDef/CmnDefLinkShell.cpp b/scripts/native/CmnDef/CmnDefLinkShell.cpp index 16aa593b..f0df71f9 100644 --- a/scripts/native/CmnDef/CmnDefLinkShell.cpp +++ b/scripts/native/CmnDef/CmnDefLinkShell.cpp @@ -1,4 +1,4 @@ -#include +#include "../ScriptObject.h" #define ACTION_CREATE 2 #define ACTION_RENAME 3 diff --git a/scripts/native/CmnDef/HouFurOrchestrion.cpp b/scripts/native/CmnDef/HouFurOrchestrion.cpp index 51273ed5..9e47c554 100644 --- a/scripts/native/CmnDef/HouFurOrchestrion.cpp +++ b/scripts/native/CmnDef/HouFurOrchestrion.cpp @@ -1,4 +1,4 @@ -#include +#include "../ScriptObject.h" class HouFurOrchestrion : public EventScript { diff --git a/scripts/native/ScriptLoader.cpp.in b/scripts/native/ScriptLoader.cpp.in index c5cbc42b..633ca309 100644 --- a/scripts/native/ScriptLoader.cpp.in +++ b/scripts/native/ScriptLoader.cpp.in @@ -1,5 +1,7 @@ +#include + class ScriptObject; -@PreScriptIncludes@ + @ScriptIncludes@ const ScriptObject* ptrs[] = diff --git a/scripts/native/action/ActionSprint3.cpp b/scripts/native/action/ActionSprint3.cpp index 82bbfc37..076bbf5f 100644 --- a/scripts/native/action/ActionSprint3.cpp +++ b/scripts/native/action/ActionSprint3.cpp @@ -1,4 +1,4 @@ -#include +#include "../ScriptObject.h" class ActionSprint3 : public ActionScript { diff --git a/scripts/native/aetheryte/Aethernet.cpp b/scripts/native/aetheryte/Aethernet.cpp index e0cda163..9a3ccd8f 100644 --- a/scripts/native/aetheryte/Aethernet.cpp +++ b/scripts/native/aetheryte/Aethernet.cpp @@ -1,4 +1,4 @@ -#include +#include "../ScriptObject.h" #define ACTION_ATTUNE 0x13 diff --git a/scripts/native/aetheryte/Aetheryte.cpp b/scripts/native/aetheryte/Aetheryte.cpp index 9f838d13..51ba6cb1 100644 --- a/scripts/native/aetheryte/Aetheryte.cpp +++ b/scripts/native/aetheryte/Aetheryte.cpp @@ -1,4 +1,4 @@ -#include +#include "../ScriptObject.h" #define ACTION_ATTUNE 0x13 #define ACTION_TELEPORT 0x4 diff --git a/scripts/native/debugcommands/Add.cpp b/scripts/native/debugcommands/Add.cpp deleted file mode 100644 index 41031f7a..00000000 --- a/scripts/native/debugcommands/Add.cpp +++ /dev/null @@ -1,102 +0,0 @@ -#include -#include -#include -#include -#include - -class Add : public DebugCommandScript -{ -public: - Add() : DebugCommandScript( "add", "Executes ADD command", 1 ) - { } - - virtual void run( Entity::Player& player, const std::string& data, const std::string &subCommand, const std::string ¶ms ) - { - if( subCommand == "status" ) - { - int32_t id; - int32_t duration; - uint16_t param; - - sscanf( params.c_str(), "%d %d %hu", &id, &duration, ¶m ); - - StatusEffect::StatusEffectPtr effect( new StatusEffect::StatusEffect( id, player.getAsPlayer(), player.getAsPlayer(), duration, 3000 ) ); - effect->setParam( param ); - - player.addStatusEffect( effect ); - } - else if( subCommand == "title" ) - { - uint32_t titleId; - sscanf( params.c_str(), "%u", &titleId ); - - player.addTitle( titleId ); - player.sendNotice( "Added title (ID: " + std::to_string( titleId ) + ")" ); - } - else if( subCommand == "spawn" ) - { - int32_t model, name; - - sscanf( params.c_str(), "%d %d", &model, &name ); - - Entity::BattleNpcPtr pBNpc( new Entity::BattleNpc( model, name, player.getPos() ) ); - - auto pZone = player.getCurrentZone(); - pBNpc->setCurrentZone( pZone ); - pZone->pushActor( pBNpc ); - - } - else if( subCommand == "op" ) - { - // temporary research packet - int32_t opcode; - sscanf( params.c_str(), "%x", &opcode ); - Network::Packets::GamePacketPtr pPe( new Network::Packets::GamePacket( opcode, 0x30, player.getId(), player.getId() ) ); - player.queuePacket( pPe ); - } - else if( subCommand == "actrl" ) - { - - // temporary research packet - - int32_t opcode; - int32_t param1; - int32_t param2; - int32_t param3; - int32_t param4; - int32_t param5; - int32_t param6; - int32_t playerId; - - sscanf( params.c_str(), "%x %x %x %x %x %x %x %x", &opcode, ¶m1, ¶m2, ¶m3, ¶m4, ¶m5, ¶m6, &playerId ); - - player.sendNotice( "Injecting ACTOR_CONTROL " + std::to_string( opcode ) ); - - Network::Packets::ZoneChannelPacket< Network::Packets::Server::FFXIVIpcActorControl143 > actorControl( playerId, player.getId() ); - actorControl.data().category = opcode; - actorControl.data().param1 = param1; - actorControl.data().param2 = param2; - actorControl.data().param3 = param3; - actorControl.data().param4 = param4; - actorControl.data().param5 = param5; - actorControl.data().param6 = param6; - player.queuePacket( actorControl ); - - - /*sscanf(params.c_str(), "%x %x %x %x %x %x %x", &opcode, ¶m1, ¶m2, ¶m3, ¶m4, ¶m5, ¶m6, &playerId); - - Network::Packets::Server::ServerNoticePacket noticePacket( player, "Injecting ACTOR_CONTROL " + std::to_string( opcode ) ); - - player.queuePacket( noticePacket ); - - Network::Packets::Server::ActorControlPacket143 controlPacket( player, opcode, - param1, param2, param3, param4, param5, param6, playerId ); - player.queuePacket( controlPacket );*/ - - } - else - { - player.sendUrgent( subCommand + " is not a valid ADD command." ); - } - } -}; \ No newline at end of file diff --git a/scripts/native/debugcommands/Get.cpp b/scripts/native/debugcommands/Get.cpp deleted file mode 100644 index f20a3abe..00000000 --- a/scripts/native/debugcommands/Get.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include - -#include - -class Get : public DebugCommandScript -{ -public: - Get() : DebugCommandScript( "get", "Executes GET commands", 1 ) - { } - - virtual void run( Entity::Player& player, const std::string& data, const std::string& subCommand, const std::string& params ) - { - if( ( subCommand == "pos" ) ) - { - - int16_t map_id = m_objects->m_exd->m_zoneInfoMap[player.getCurrentZone()->getTerritoryId()].map_id; - - player.sendNotice( "Pos:\n" + - std::to_string( player.getPos().x ) + "\n" + - std::to_string( player.getPos().y ) + "\n" + - std::to_string( player.getPos().z ) + "\n" + - std::to_string( player.getRotation() ) + "\nMapId: " + - std::to_string( map_id ) + "\nZoneID: " + - std::to_string(player.getCurrentZone()->getTerritoryId() ) + "\n" ); - } - else - { - player.sendUrgent( subCommand + " is not a valid GET command." ); - } - } -}; \ No newline at end of file diff --git a/scripts/native/debugcommands/Help.cpp b/scripts/native/debugcommands/Help.cpp deleted file mode 100644 index f7ec3947..00000000 --- a/scripts/native/debugcommands/Help.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include - -#include