diff --git a/src/scripts/common/warptaxi/WarpTaxi131088.cpp b/src/scripts/common/warptaxi/WarpTaxi131088.cpp new file mode 100644 index 00000000..d5049503 --- /dev/null +++ b/src/scripts/common/warptaxi/WarpTaxi131088.cpp @@ -0,0 +1,32 @@ +#include +#include + +#include +#include + +using namespace Sapphire; +using namespace Sapphire::Network::Packets; +using namespace Sapphire::Network::Packets::Server; + +class WarpTaxi131088 : public Sapphire::ScriptAPI::EventScript +{ +public: + WarpTaxi131088() : + Sapphire::ScriptAPI::EventScript( 131088 ) + { + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + player.eventFinish( getId(), 1 ); + player.sendDebug( "enter the walking sand..." ); + auto instance = player.getOrCreatePrivateInstance( 212 ); + if( instance ) + { + Common::FFXIVARR_POSITION3 pos { 30, 1, 0 }; + player.setInstance( instance, pos ); + } + } +}; + +EXPOSE_SCRIPT( WarpTaxi131088 ); \ No newline at end of file diff --git a/src/scripts/common/warptaxi/WarpTaxi131091.cpp b/src/scripts/common/warptaxi/WarpTaxi131091.cpp new file mode 100644 index 00000000..b2c1f994 --- /dev/null +++ b/src/scripts/common/warptaxi/WarpTaxi131091.cpp @@ -0,0 +1,28 @@ +#include +#include + +#include +#include + +using namespace Sapphire; +using namespace Sapphire::Network::Packets; +using namespace Sapphire::Network::Packets::Server; + +class WarpTaxi131091 : public Sapphire::ScriptAPI::EventScript +{ +public: + WarpTaxi131091() : + Sapphire::ScriptAPI::EventScript( 131091 ) + { + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + player.eventFinish( getId(), 1 ); + player.sendDebug( "exit the walking sand..." ); + player.sendUrgent( "to go to other side of the door, walk up against it and type \"!nudge 4\"." ); + player.exitInstance(); + } +}; + +EXPOSE_SCRIPT( WarpTaxi131091 ); \ No newline at end of file diff --git a/src/scripts/common/warptaxi/WarpTaxi131137.cpp b/src/scripts/common/warptaxi/WarpTaxi131137.cpp new file mode 100644 index 00000000..24045225 --- /dev/null +++ b/src/scripts/common/warptaxi/WarpTaxi131137.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +using namespace Sapphire; +using namespace Sapphire::Network::Packets; +using namespace Sapphire::Network::Packets::Server; + +class WarpTaxi131137 : public Sapphire::ScriptAPI::EventScript +{ +public: + WarpTaxi131137() : + Sapphire::ScriptAPI::EventScript( 131137 ) + { + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + player.eventFinish( getId(), 1 ); + player.setPosAndSendActorMove( 24.7, 20.1, -679.2, 0.82 ); + } +}; + +EXPOSE_SCRIPT( WarpTaxi131137 ); \ No newline at end of file diff --git a/src/scripts/common/warptaxi/WarpTaxi131142.cpp b/src/scripts/common/warptaxi/WarpTaxi131142.cpp new file mode 100644 index 00000000..ed3d904e --- /dev/null +++ b/src/scripts/common/warptaxi/WarpTaxi131142.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +using namespace Sapphire; +using namespace Sapphire::Network::Packets; +using namespace Sapphire::Network::Packets::Server; + +class WarpTaxi131142 : public Sapphire::ScriptAPI::EventScript +{ +public: + WarpTaxi131142() : + Sapphire::ScriptAPI::EventScript( 131142 ) + { + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + player.eventFinish( getId(), 1 ); + player.setPosAndSendActorMove( 0, -2, -31, 3.1415 ); + } +}; + +EXPOSE_SCRIPT( WarpTaxi131142 ); \ No newline at end of file diff --git a/src/scripts/common/warptaxi/WarpTaxi131143.cpp b/src/scripts/common/warptaxi/WarpTaxi131143.cpp new file mode 100644 index 00000000..b21a46c5 --- /dev/null +++ b/src/scripts/common/warptaxi/WarpTaxi131143.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +using namespace Sapphire; +using namespace Sapphire::Network::Packets; +using namespace Sapphire::Network::Packets::Server; + +class WarpTaxi131143 : public Sapphire::ScriptAPI::EventScript +{ +public: + WarpTaxi131143() : + Sapphire::ScriptAPI::EventScript( 131143 ) + { + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + player.eventFinish( getId(), 1 ); + player.setPosAndSendActorMove( 0, -2, -23, 0 ); + } +}; + +EXPOSE_SCRIPT( WarpTaxi131143 ); \ No newline at end of file diff --git a/src/scripts/common/warptaxi/WarpTaxi131144.cpp b/src/scripts/common/warptaxi/WarpTaxi131144.cpp new file mode 100644 index 00000000..440275db --- /dev/null +++ b/src/scripts/common/warptaxi/WarpTaxi131144.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +using namespace Sapphire; +using namespace Sapphire::Network::Packets; +using namespace Sapphire::Network::Packets::Server; + +class WarpTaxi131144 : public Sapphire::ScriptAPI::EventScript +{ +public: + WarpTaxi131144() : + Sapphire::ScriptAPI::EventScript( 131144 ) + { + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + player.eventFinish( getId(), 1 ); + player.enterPredefinedPrivateInstance( 351 ); + } +}; + +EXPOSE_SCRIPT( WarpTaxi131144 ); \ No newline at end of file diff --git a/src/scripts/common/warptaxi/WarpTaxi131166.cpp b/src/scripts/common/warptaxi/WarpTaxi131166.cpp new file mode 100644 index 00000000..e16dd658 --- /dev/null +++ b/src/scripts/common/warptaxi/WarpTaxi131166.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +using namespace Sapphire; +using namespace Sapphire::Network::Packets; +using namespace Sapphire::Network::Packets::Server; + +class WarpTaxi131166 : public Sapphire::ScriptAPI::EventScript +{ +public: + WarpTaxi131166() : + Sapphire::ScriptAPI::EventScript( 131166 ) + { + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + player.eventFinish( getId(), 1 ); + player.enterPredefinedPrivateInstance( 395 ); + } +}; + +EXPOSE_SCRIPT( WarpTaxi131166 ); \ No newline at end of file diff --git a/src/scripts/common/warptaxi/WarpTaxi131180.cpp b/src/scripts/common/warptaxi/WarpTaxi131180.cpp new file mode 100644 index 00000000..b23216f2 --- /dev/null +++ b/src/scripts/common/warptaxi/WarpTaxi131180.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +using namespace Sapphire; +using namespace Sapphire::Network::Packets; +using namespace Sapphire::Network::Packets::Server; + +class WarpTaxi131180 : public Sapphire::ScriptAPI::EventScript +{ +public: + WarpTaxi131180() : + Sapphire::ScriptAPI::EventScript( 131180 ) + { + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + player.eventFinish( getId(), 1 ); + player.forceZoneing( 144, -42, 0, 100, -1.58, true ); + } +}; + +EXPOSE_SCRIPT( WarpTaxi131180 ); \ No newline at end of file diff --git a/src/scripts/common/warptaxi/WarpTaxi131185.cpp b/src/scripts/common/warptaxi/WarpTaxi131185.cpp new file mode 100644 index 00000000..f6c96ed5 --- /dev/null +++ b/src/scripts/common/warptaxi/WarpTaxi131185.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +using namespace Sapphire; +using namespace Sapphire::Network::Packets; +using namespace Sapphire::Network::Packets::Server; + +class WarpTaxi131185 : public Sapphire::ScriptAPI::EventScript +{ +public: + WarpTaxi131185() : + Sapphire::ScriptAPI::EventScript( 131185 ) + { + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + player.eventFinish( getId(), 1 ); + player.forceZoneing( 418, 0, -2.6, 141.3, -3.1415, true ); + } +}; + +EXPOSE_SCRIPT( WarpTaxi131185 ); \ No newline at end of file diff --git a/src/scripts/common/warptaxi/WarpTaxi131186.cpp b/src/scripts/common/warptaxi/WarpTaxi131186.cpp new file mode 100644 index 00000000..ae5eec6d --- /dev/null +++ b/src/scripts/common/warptaxi/WarpTaxi131186.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +using namespace Sapphire; +using namespace Sapphire::Network::Packets; +using namespace Sapphire::Network::Packets::Server; + +class WarpTaxi131186 : public Sapphire::ScriptAPI::EventScript +{ +public: + WarpTaxi131186() : + Sapphire::ScriptAPI::EventScript( 131186 ) + { + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + player.eventFinish( getId(), 1 ); + player.forceZoneing( 155, -165, 304, -325, 0.78, true ); + } +}; + +EXPOSE_SCRIPT( WarpTaxi131186 ); \ No newline at end of file diff --git a/src/scripts/common/warptaxi/WarpTaxi131192.cpp b/src/scripts/common/warptaxi/WarpTaxi131192.cpp new file mode 100644 index 00000000..626337a6 --- /dev/null +++ b/src/scripts/common/warptaxi/WarpTaxi131192.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +using namespace Sapphire; +using namespace Sapphire::Network::Packets; +using namespace Sapphire::Network::Packets::Server; + +class WarpTaxi131192 : public Sapphire::ScriptAPI::EventScript +{ +public: + WarpTaxi131192() : + Sapphire::ScriptAPI::EventScript( 131192 ) + { + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + player.eventFinish( getId(), 1 ); + player.enterPredefinedPrivateInstance( 433 ); + } +}; + +EXPOSE_SCRIPT( WarpTaxi131192 ); \ No newline at end of file diff --git a/src/scripts/common/warptaxi/WarpTaxi131201.cpp b/src/scripts/common/warptaxi/WarpTaxi131201.cpp new file mode 100644 index 00000000..c9b6bcd2 --- /dev/null +++ b/src/scripts/common/warptaxi/WarpTaxi131201.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +using namespace Sapphire; +using namespace Sapphire::Network::Packets; +using namespace Sapphire::Network::Packets::Server; + +class WarpTaxi131201 : public Sapphire::ScriptAPI::EventScript +{ +public: + WarpTaxi131201() : + Sapphire::ScriptAPI::EventScript( 131201 ) + { + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + player.eventFinish( getId(), 1 ); + player.enterPredefinedPrivateInstance( 463 ); + } +}; + +EXPOSE_SCRIPT( WarpTaxi131201 ); \ No newline at end of file diff --git a/src/scripts/common/warptaxi/WarpTaxi131256.cpp b/src/scripts/common/warptaxi/WarpTaxi131256.cpp new file mode 100644 index 00000000..d6d391f0 --- /dev/null +++ b/src/scripts/common/warptaxi/WarpTaxi131256.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +using namespace Sapphire; +using namespace Sapphire::Network::Packets; +using namespace Sapphire::Network::Packets::Server; + +class WarpTaxi131256 : public Sapphire::ScriptAPI::EventScript +{ +public: + WarpTaxi131256() : + Sapphire::ScriptAPI::EventScript( 131256 ) + { + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + player.eventFinish( getId(), 1 ); + player.setPosAndSendActorMove( 676, 60, 465, 0 ); + } +}; + +EXPOSE_SCRIPT( WarpTaxi131256 ); \ No newline at end of file diff --git a/src/scripts/common/warptaxi/WarpTaxi131261.cpp b/src/scripts/common/warptaxi/WarpTaxi131261.cpp new file mode 100644 index 00000000..c12aca41 --- /dev/null +++ b/src/scripts/common/warptaxi/WarpTaxi131261.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +using namespace Sapphire; +using namespace Sapphire::Network::Packets; +using namespace Sapphire::Network::Packets::Server; + +class WarpTaxi131261 : public Sapphire::ScriptAPI::EventScript +{ +public: + WarpTaxi131261() : + Sapphire::ScriptAPI::EventScript( 131261 ) + { + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + player.eventFinish( getId(), 1 ); + player.enterPredefinedPrivateInstance( 639 ); + } +}; + +EXPOSE_SCRIPT( WarpTaxi131261 ); \ No newline at end of file diff --git a/src/scripts/common/warptaxi/WarpTaxi131264.cpp b/src/scripts/common/warptaxi/WarpTaxi131264.cpp new file mode 100644 index 00000000..9284791e --- /dev/null +++ b/src/scripts/common/warptaxi/WarpTaxi131264.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +using namespace Sapphire; +using namespace Sapphire::Network::Packets; +using namespace Sapphire::Network::Packets::Server; + +class WarpTaxi131264 : public Sapphire::ScriptAPI::EventScript +{ +public: + WarpTaxi131264() : + Sapphire::ScriptAPI::EventScript( 131264 ) + { + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + player.eventFinish( getId(), 1 ); + player.enterPredefinedPrivateInstance( 681 ); + } +}; + +EXPOSE_SCRIPT( WarpTaxi131264 ); \ No newline at end of file diff --git a/src/scripts/common/warptaxi/WarpTaxi131268.cpp b/src/scripts/common/warptaxi/WarpTaxi131268.cpp new file mode 100644 index 00000000..357515ae --- /dev/null +++ b/src/scripts/common/warptaxi/WarpTaxi131268.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +using namespace Sapphire; +using namespace Sapphire::Network::Packets; +using namespace Sapphire::Network::Packets::Server; + +class WarpTaxi131268 : public Sapphire::ScriptAPI::EventScript +{ +public: + WarpTaxi131268() : + Sapphire::ScriptAPI::EventScript( 131268 ) + { + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + player.eventFinish( getId(), 1 ); + player.forceZoneing( 614, -491.1, 1.137, 540.47, 2.258, true ); + } +}; + +EXPOSE_SCRIPT( WarpTaxi131268 ); \ No newline at end of file diff --git a/src/scripts/common/warptaxi/WarpTaxi131293.cpp b/src/scripts/common/warptaxi/WarpTaxi131293.cpp new file mode 100644 index 00000000..c309d3bd --- /dev/null +++ b/src/scripts/common/warptaxi/WarpTaxi131293.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include +#include + +using namespace Sapphire; +using namespace Sapphire::Network::Packets; +using namespace Sapphire::Network::Packets::Server; + +class WarpTaxi131293 : public Sapphire::ScriptAPI::EventScript +{ +public: + WarpTaxi131293() : + Sapphire::ScriptAPI::EventScript( 131293 ) + { + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + player.eventFinish( getId(), 1 ); + player.forceZoneing( 759, 146.2, -4.17, 55.15, 0, true ); + } +}; + +EXPOSE_SCRIPT( WarpTaxi131293 ); \ No newline at end of file diff --git a/src/world/Actor/Player.cpp b/src/world/Actor/Player.cpp index 6380d084..3bad0375 100644 --- a/src/world/Actor/Player.cpp +++ b/src/world/Actor/Player.cpp @@ -2787,6 +2787,19 @@ void* Sapphire::Entity::Player::getTerritoryMgr() return &Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); } +void Sapphire::Entity::Player::setPosAndSendActorMove( float x, float y, float z, float rot ) +{ + setRot( rot ); + setPos( x, y, z, true ); + + auto setActorPosPacket = makeZonePacket< FFXIVIpcActorSetPos >( getId() ); + setActorPosPacket->data().r16 = Common::Util::floatToUInt16Rot( rot ); + setActorPosPacket->data().x = x; + setActorPosPacket->data().y = y; + setActorPosPacket->data().z = z; + queuePacket( setActorPosPacket ); +} + Sapphire::TerritoryPtr Sapphire::Entity::Player::getOrCreatePrivateInstance( uint32_t zoneId ) { auto instance = m_privateInstanceMap[ zoneId ]; diff --git a/src/world/Actor/Player.h b/src/world/Actor/Player.h index 7af0a9d3..d74457e7 100644 --- a/src/world/Actor/Player.h +++ b/src/world/Actor/Player.h @@ -1047,6 +1047,7 @@ namespace Sapphire::Entity void foreachPartyMember( std::function< void( PlayerPtr member ) > callback); ////////////////////////////////////////////////////////////////////////////////////////////////////// + void setPosAndSendActorMove( float x, float y, float z, float rot ); std::unordered_map< uint32_t, TerritoryPtr > m_privateInstanceMap; TerritoryPtr getOrCreatePrivateInstance( uint32_t zoneId ); bool enterPredefinedPrivateInstance( uint32_t zoneId ); diff --git a/src/world/Manager/TerritoryMgr.cpp b/src/world/Manager/TerritoryMgr.cpp index 12629db2..549b5c90 100644 --- a/src/world/Manager/TerritoryMgr.cpp +++ b/src/world/Manager/TerritoryMgr.cpp @@ -644,6 +644,11 @@ bool Sapphire::World::Manager::TerritoryMgr::movePlayer( TerritoryPtr pZone, Sap // map player to instanceId so it can be tracked. m_playerIdToInstanceMap[ pPlayer->getId() ] = pZone->getGuId(); } + else + { + pPlayer->removeFromInRange(); + pPlayer->clearInRangeSet(); + } pPlayer->sendZonePackets(); @@ -714,6 +719,14 @@ std::unordered_map< uint32_t, Sapphire::World::Manager::TerritoryMgr::InstanceSp { 507, { { -0.7, 0, 11.5 }, 3.1415 } }, { 636, { { 0, 0, 8 }, -3.1416 } }, { 680, { { 0, 16.35, -16.46 }, 0 } }, + { 639, { { 0, 0, 10 }, -3.14 } }, + { 681, { { 20, -1, 15 }, -2.25 } }, + { 682, { { 144.15, -4.178, 55 }, 0 } }, + { 683, { { 0, -5.169, 30 }, -3.14 } }, + { 727, { { -454, 383, -127 }, 1.578 } }, + { 738, { { 0, -2, 55 }, -3.14 } }, + { 737, { { 250, 122, -346 }, -3.14 } }, + { 744, { { 0, 0, 0 }, 0 } }, }; std::unordered_map< uint32_t, uint32_t > Sapphire::World::Manager::TerritoryMgr::instanceExitEvent = @@ -734,4 +747,12 @@ std::unordered_map< uint32_t, uint32_t > Sapphire::World::Manager::TerritoryMgr: { 131213, 507 }, { 131247, 636 }, { 131274, 680 }, + { 131260, 639 }, + { 131266, 681 }, + //{ 131268, 682 }, scripted + { 131273, 683 }, + { 131276, 727 }, + { 131286, 738 }, + { 131289, 737 }, + { 131294, 744 }, }; \ No newline at end of file diff --git a/src/world/Network/Handlers/PacketHandlers.cpp b/src/world/Network/Handlers/PacketHandlers.cpp index f12ef34d..d04bf2bd 100644 --- a/src/world/Network/Handlers/PacketHandlers.cpp +++ b/src/world/Network/Handlers/PacketHandlers.cpp @@ -173,7 +173,7 @@ void Sapphire::Network::GameConnection::updatePositionHandler( const Packets::FF Entity::Player& player ) { // if the player is marked for zoning we no longer want to update his pos - if( player.isMarkedForZoning() ) + if( player.isMarkedForZoning() || !player.isLoadingComplete() ) return; const auto updatePositionPacket = ZoneChannelPacket< Client::FFXIVIpcUpdatePosition >( inPacket );