diff --git a/bin/config/settings_zone.xml b/bin/config/settings_zone.xml
index f50c18ce..547219a7 100644
--- a/bin/config/settings_zone.xml
+++ b/bin/config/settings_zone.xml
@@ -13,7 +13,7 @@
./cache/
- 1
+ true
../scripts/native/
../cmake-build-debug/
cmake --build %1% --target %2%
diff --git a/scripts/native/CmnDef/CmnDefCutSceneReplay.cpp b/scripts/native/CmnDef/CmnDefCutSceneReplay.cpp
index 618c1610..39bf4300 100644
--- a/scripts/native/CmnDef/CmnDefCutSceneReplay.cpp
+++ b/scripts/native/CmnDef/CmnDefCutSceneReplay.cpp
@@ -3,7 +3,7 @@
class CmnDefCutSceneReplay : public EventScript
{
public:
- CmnDefCutSceneReplay() : EventScript( "CmnDefCutSceneReplay", 721028 )
+ CmnDefCutSceneReplay() : EventScript( 721028 )
{}
void Scene00000( Entity::Player& player )
diff --git a/scripts/native/CmnDef/CmnDefInnBed.cpp b/scripts/native/CmnDef/CmnDefInnBed.cpp
index 5e675b88..ac8a0a68 100644
--- a/scripts/native/CmnDef/CmnDefInnBed.cpp
+++ b/scripts/native/CmnDef/CmnDefInnBed.cpp
@@ -3,7 +3,7 @@
class CmnDefInnBed : public EventScript
{
public:
- CmnDefInnBed() : EventScript( "CmnDefInnBed", 720916 )
+ CmnDefInnBed() : EventScript( 720916 )
{}
// menu
diff --git a/scripts/native/CmnDef/CmnDefLinkShell.cpp b/scripts/native/CmnDef/CmnDefLinkShell.cpp
index eb2a7b29..f0df71f9 100644
--- a/scripts/native/CmnDef/CmnDefLinkShell.cpp
+++ b/scripts/native/CmnDef/CmnDefLinkShell.cpp
@@ -7,7 +7,7 @@
class CmnDefLinkShell : public EventScript
{
public:
- CmnDefLinkShell() : EventScript( "CmnDefLinkShell", 0xB0006 )
+ CmnDefLinkShell() : EventScript( 0xB0006 )
{}
void Scene00001( Entity::Player& player )
diff --git a/scripts/native/CmnDef/HouFurOrchestrion.cpp b/scripts/native/CmnDef/HouFurOrchestrion.cpp
index bb370e24..9e47c554 100644
--- a/scripts/native/CmnDef/HouFurOrchestrion.cpp
+++ b/scripts/native/CmnDef/HouFurOrchestrion.cpp
@@ -3,7 +3,7 @@
class HouFurOrchestrion : public EventScript
{
public:
- HouFurOrchestrion() : EventScript( "HouFurOrchestrion", 721226 )
+ HouFurOrchestrion() : EventScript( 721226 )
{}
void Scene00000( Entity::Player& player )
diff --git a/scripts/native/action/ActionSprint3.cpp b/scripts/native/action/ActionSprint3.cpp
index 6e9af153..076bbf5f 100644
--- a/scripts/native/action/ActionSprint3.cpp
+++ b/scripts/native/action/ActionSprint3.cpp
@@ -3,7 +3,7 @@
class ActionSprint3 : public ActionScript
{
public:
- ActionSprint3() : ActionScript( "ActionSprint3", 3 )
+ ActionSprint3() : ActionScript( 3 )
{}
void onCastFinish( Core::Entity::Player& player, Core::Entity::Actor& targetActor ) override
diff --git a/scripts/native/aetheryte/Aethernet.cpp b/scripts/native/aetheryte/Aethernet.cpp
index b3881120..9a3ccd8f 100644
--- a/scripts/native/aetheryte/Aethernet.cpp
+++ b/scripts/native/aetheryte/Aethernet.cpp
@@ -12,7 +12,7 @@
class Aethernet : public EventScript
{
public:
- Aethernet() : EventScript( "Aethernet", EVENTSCRIPT_AETHERNET_ID )
+ Aethernet() : EventScript( EVENTSCRIPT_AETHERNET_ID )
{}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
diff --git a/scripts/native/aetheryte/Aetheryte.cpp b/scripts/native/aetheryte/Aetheryte.cpp
index 96ba8675..51ba6cb1 100644
--- a/scripts/native/aetheryte/Aetheryte.cpp
+++ b/scripts/native/aetheryte/Aetheryte.cpp
@@ -13,7 +13,7 @@
class Aetheryte : public EventScript
{
public:
- Aetheryte() : EventScript( "Aetheryte", EVENTSCRIPT_AETHERYTE_ID )
+ Aetheryte() : EventScript( EVENTSCRIPT_AETHERYTE_ID )
{}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
diff --git a/scripts/native/opening/OpeningGridania.cpp b/scripts/native/opening/OpeningGridania.cpp
index c6463ef7..9f6d6f0a 100644
--- a/scripts/native/opening/OpeningGridania.cpp
+++ b/scripts/native/opening/OpeningGridania.cpp
@@ -65,7 +65,7 @@ private:
}
public:
- OpeningGridania() : EventScript( "OpeningGridania", 1245186 )
+ OpeningGridania() : EventScript( 1245186 )
{}
void onEnterZone( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2 ) override
diff --git a/scripts/native/opening/OpeningLimsa.cpp b/scripts/native/opening/OpeningLimsa.cpp
index 369e8686..a40ea482 100644
--- a/scripts/native/opening/OpeningLimsa.cpp
+++ b/scripts/native/opening/OpeningLimsa.cpp
@@ -81,7 +81,7 @@ private:
public:
- OpeningLimsa() : EventScript( "OpeningLimsa", 1245185 ) {}
+ OpeningLimsa() : EventScript( 1245185 ) {}
void onEnterZone( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2 ) override
{
diff --git a/scripts/native/opening/OpeningUldah.cpp b/scripts/native/opening/OpeningUldah.cpp
index ba940295..fdd1c5d2 100644
--- a/scripts/native/opening/OpeningUldah.cpp
+++ b/scripts/native/opening/OpeningUldah.cpp
@@ -65,7 +65,7 @@ private:
public:
- OpeningUldah() : EventScript( "OpeningUldah", 1245187 ) {}
+ OpeningUldah() : EventScript( 1245187 ) {}
void onEnterZone( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2 ) override
{
diff --git a/scripts/native/quest/ManFst001.cpp b/scripts/native/quest/ManFst001.cpp
index 726d2dc5..b73581ac 100644
--- a/scripts/native/quest/ManFst001.cpp
+++ b/scripts/native/quest/ManFst001.cpp
@@ -90,7 +90,7 @@ private:
}
public:
- ManFst001() : EventScript( "ManFst001", 65575 ) {}
+ ManFst001() : EventScript( 65575 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{
diff --git a/scripts/native/quest/ManFst002.cpp b/scripts/native/quest/ManFst002.cpp
index 6b084490..707150cb 100644
--- a/scripts/native/quest/ManFst002.cpp
+++ b/scripts/native/quest/ManFst002.cpp
@@ -189,7 +189,7 @@ private:
}
public:
- ManFst002() : EventScript( "ManFst002", 65621 ) {}
+ ManFst002() : EventScript( 65621 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{
diff --git a/scripts/native/quest/ManFst003.cpp b/scripts/native/quest/ManFst003.cpp
index e564a7ca..c8cd4da6 100644
--- a/scripts/native/quest/ManFst003.cpp
+++ b/scripts/native/quest/ManFst003.cpp
@@ -12,7 +12,7 @@ private:
public:
- ManFst003() : EventScript( "ManFst003", 65659 ) {}
+ ManFst003() : EventScript( 65659 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{
diff --git a/scripts/native/quest/ManFst004.cpp b/scripts/native/quest/ManFst004.cpp
index b8896a41..18ac04b8 100644
--- a/scripts/native/quest/ManFst004.cpp
+++ b/scripts/native/quest/ManFst004.cpp
@@ -71,7 +71,7 @@ class ManFst004 : public EventScript
static constexpr auto UnlockDesion = 14;
public:
- ManFst004() : EventScript( "Close to Home", 65660 ){};
+ ManFst004() : EventScript( 65660 ){};
~ManFst004(){};
//////////////////////////////////////////////////////////////////////
diff --git a/scripts/native/quest/ManSea001.cpp b/scripts/native/quest/ManSea001.cpp
index 2a3e4aaa..aee4da80 100644
--- a/scripts/native/quest/ManSea001.cpp
+++ b/scripts/native/quest/ManSea001.cpp
@@ -145,7 +145,7 @@ private:
}
public:
- ManSea001() : EventScript( "ManSea001", 65643 ) {}
+ ManSea001() : EventScript( 65643 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{
diff --git a/scripts/native/quest/ManSea002.cpp b/scripts/native/quest/ManSea002.cpp
index 5db24e06..57d7dda7 100644
--- a/scripts/native/quest/ManSea002.cpp
+++ b/scripts/native/quest/ManSea002.cpp
@@ -136,7 +136,7 @@ private:
player.eventPlay( getId(), 50, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, 0, 0, callback );
}
public:
- ManSea002() : EventScript( "ManSea002", 65644 ) {}
+ ManSea002() : EventScript( 65644 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{
diff --git a/scripts/native/quest/ManWil001.cpp b/scripts/native/quest/ManWil001.cpp
index 93b7f42f..ee04e2aa 100644
--- a/scripts/native/quest/ManWil001.cpp
+++ b/scripts/native/quest/ManWil001.cpp
@@ -129,7 +129,7 @@ private:
public:
- ManWil001() : EventScript( "ManWil001", 66130 ) {}
+ ManWil001() : EventScript( 66130 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{
diff --git a/scripts/native/quest/ManWil002.cpp b/scripts/native/quest/ManWil002.cpp
index 3f1c399c..9f160f72 100644
--- a/scripts/native/quest/ManWil002.cpp
+++ b/scripts/native/quest/ManWil002.cpp
@@ -144,7 +144,7 @@ private:
public:
- ManWil002() : EventScript( "ManWil002", 66104 ) { }
+ ManWil002() : EventScript( 66104 ) { }
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{
diff --git a/scripts/native/quest/subquest/gridania/SubFst001.cpp b/scripts/native/quest/subquest/gridania/SubFst001.cpp
index c6b18dbc..2aedc7f8 100644
--- a/scripts/native/quest/subquest/gridania/SubFst001.cpp
+++ b/scripts/native/quest/subquest/gridania/SubFst001.cpp
@@ -60,7 +60,7 @@ private:
public:
- SubFst001() : EventScript( "SubFst001", 65560 ) {}
+ SubFst001() : EventScript( 65560 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{
diff --git a/scripts/native/quest/subquest/gridania/SubFst002.cpp b/scripts/native/quest/subquest/gridania/SubFst002.cpp
index d128fe0f..2e32fa23 100644
--- a/scripts/native/quest/subquest/gridania/SubFst002.cpp
+++ b/scripts/native/quest/subquest/gridania/SubFst002.cpp
@@ -1,76 +1,76 @@
-#include "../../../ScriptObject.h"
-
-// Quest Script: SubFst002_00025
-// Quest Name: Quarrels with Squirrels
-// Quest ID: 65561
-// Start NPC: 1000263
-// End NPC: 1000263
-
-class SubFst002 : public EventScript
-{
-private:
- static constexpr auto SEQ_0 = 0;
- static constexpr auto SEQ_1 = 1;
- static constexpr auto SEQ_2 = 2;
- static constexpr auto SEQ_FINISH = 255;
- static constexpr auto ACTOR0 = 1000263;
- static constexpr auto ENEMY0 = 37;
- static constexpr auto SEQ_0_ACTOR0 = 0;
- static constexpr auto SEQ_2_ACTOR0 = 1;
-
- void Scene00000( Entity::Player& player )
- {
- auto callback = [&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
- {
- if( param2 == 1 ) // accept quest
- {
- player.updateQuest( getId(), SEQ_1 );
- }
- };
-
- player.eventPlay( getId (), 0, NONE, callback );
- }
-
- void Scene00001(Entity::Player& player)
- {
- auto callback = [&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
- {
- if( param2 == 1 ) // finish quest
- {
- if( player.giveQuestRewards( getId(), 0 ) )
- player.finishQuest( getId() );
- }
- };
-
- player.eventPlay( getId(), 1, NONE, callback );
- }
-
-public:
- SubFst002() : EventScript( "SubFst002", 65561 ) {}
-
- void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
- {
- auto actor = Event::mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
-
- if( actor == ACTOR0 && !player.hasQuest( getId() ) )
- Scene00000( player );
- else if( actor == ACTOR0 && player.getQuestSeq( getId() ) == SEQ_FINISH )
- Scene00001( player );
- }
-
- void onNpcKill( uint32_t npcId, Entity::Player& player ) override
- {
- if( npcId != ENEMY0 )
- return;
-
- auto currentKC = player.getQuestUI8AL( getId() ) + 1;
-
- if( currentKC >= 6 )
- player.updateQuest( getId(), SEQ_FINISH );
- else
- {
- player.setQuestUI8AL( getId(), currentKC );
- player.sendQuestMessage( getId(), 0, 2, currentKC, 6 );
- }
- }
-};
+#include "../../../ScriptObject.h"
+
+// Quest Script: SubFst002_00025
+// Quest Name: Quarrels with Squirrels
+// Quest ID: 65561
+// Start NPC: 1000263
+// End NPC: 1000263
+
+class SubFst002 : public EventScript
+{
+private:
+ static constexpr auto SEQ_0 = 0;
+ static constexpr auto SEQ_1 = 1;
+ static constexpr auto SEQ_2 = 2;
+ static constexpr auto SEQ_FINISH = 255;
+ static constexpr auto ACTOR0 = 1000263;
+ static constexpr auto ENEMY0 = 37;
+ static constexpr auto SEQ_0_ACTOR0 = 0;
+ static constexpr auto SEQ_2_ACTOR0 = 1;
+
+ void Scene00000( Entity::Player& player )
+ {
+ auto callback = [&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
+ {
+ if( param2 == 1 ) // accept quest
+ {
+ player.updateQuest( getId(), SEQ_1 );
+ }
+ };
+
+ player.eventPlay( getId (), 0, NONE, callback );
+ }
+
+ void Scene00001(Entity::Player& player)
+ {
+ auto callback = [&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
+ {
+ if( param2 == 1 ) // finish quest
+ {
+ if( player.giveQuestRewards( getId(), 0 ) )
+ player.finishQuest( getId() );
+ }
+ };
+
+ player.eventPlay( getId(), 1, NONE, callback );
+ }
+
+public:
+ SubFst002() : EventScript( 65561 ) {}
+
+ void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
+ {
+ auto actor = Event::mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
+
+ if( actor == ACTOR0 && !player.hasQuest( getId() ) )
+ Scene00000( player );
+ else if( actor == ACTOR0 && player.getQuestSeq( getId() ) == SEQ_FINISH )
+ Scene00001( player );
+ }
+
+ void onNpcKill( uint32_t npcId, Entity::Player& player ) override
+ {
+ if( npcId != ENEMY0 )
+ return;
+
+ auto currentKC = player.getQuestUI8AL( getId() ) + 1;
+
+ if( currentKC >= 6 )
+ player.updateQuest( getId(), SEQ_FINISH );
+ else
+ {
+ player.setQuestUI8AL( getId(), currentKC );
+ player.sendQuestMessage( getId(), 0, 2, currentKC, 6 );
+ }
+ }
+};
diff --git a/scripts/native/quest/subquest/gridania/SubFst010.cpp b/scripts/native/quest/subquest/gridania/SubFst010.cpp
index bccd887d..e3e03582 100644
--- a/scripts/native/quest/subquest/gridania/SubFst010.cpp
+++ b/scripts/native/quest/subquest/gridania/SubFst010.cpp
@@ -42,7 +42,7 @@ private:
}
public:
- SubFst010() : EventScript( "SubFst010", 65537 ) {}
+ SubFst010() : EventScript( 65537 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{
diff --git a/scripts/native/quest/subquest/gridania/SubFst013.cpp b/scripts/native/quest/subquest/gridania/SubFst013.cpp
index d696642f..7bf4f6da 100644
--- a/scripts/native/quest/subquest/gridania/SubFst013.cpp
+++ b/scripts/native/quest/subquest/gridania/SubFst013.cpp
@@ -148,7 +148,7 @@ private:
public:
- SubFst013() : EventScript( "SubFst013", 65576 ) {}
+ SubFst013() : EventScript( 65576 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 7d9fd527..606f027b 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -5,7 +5,8 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} )
file(GLOB UTILS_PUBLIC_INCLUDE_FILES
"${CMAKE_CURRENT_SOURCE_DIR}"
- "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
+ "${CMAKE_CURRENT_SOURCE_DIR}/*.h"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Exd/*.h" )
file(GLOB UTILS_SOURCE_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Config/*.cpp"
diff --git a/src/common/Common.h b/src/common/Common.h
index 634c1828..94736d9b 100644
--- a/src/common/Common.h
+++ b/src/common/Common.h
@@ -162,29 +162,6 @@ namespace Common {
instance,
};
- enum TerritoryIntendedUseType : uint8_t //ToDo: Add The Rest of The Territory Types and Have Better Names For Them
- {
- Town = 0,
- OpenWorld = 1,
- Inn = 2,
- Dungeon = 3,
- JailArea = 5,
- OpeningArea = 6,
- BeforeTrialDung = 7,
- AllianceRaid = 8,
- OpenWorldInstanceBattle = 9,
- Trial = 10,
- HousingArea = 13,
- HousingPrivateArea = 14,
- MSQPrivateArea = 15,
- Raids = 16,
- RaidFights = 17,
- ChocoboTutorial = 21,
- Wedding = 22,
- BeginnerTutorial = 27,
- PalaceOfTheDead = 31,
- };
-
enum CharaLook : uint8_t
{
Race = 0x00,
@@ -319,25 +296,6 @@ namespace Common {
};
- enum EventType : uint16_t
- {
- Quest = 0x0001,
- ChocoRent = 0x0002,
- Shop = 0x0004,
- Aetheryte = 0x0005,
- GuildLeveAssign = 0x0006,
- DefaultTalk = 0x0009,
- CustomTalk = 0x000B,
- CraftLeve = 0x000E,
- ChocoPort = 0x0012,
- Opening = 0x0013,
- GCShop = 0x0016,
- GuildOrderGuide = 0x0017,
- GuildOrderOfficer = 0x0018,
- Stories = 0x001A,
- FcTalk = 0x001F,
- };
-
enum struct ActionAspect : uint8_t
{
None = 0, // Doesn't imply unaspected
diff --git a/src/common/Database/DbConnection.cpp b/src/common/Database/DbConnection.cpp
index b0633492..b33fbbd2 100644
--- a/src/common/Database/DbConnection.cpp
+++ b/src/common/Database/DbConnection.cpp
@@ -61,7 +61,7 @@ uint32_t Core::Db::DbConnection::open()
try
{
m_pConnection = base->connect( m_connectionInfo.host, m_connectionInfo.user, m_connectionInfo.password,
- options, m_connectionInfo.port );
+ options, m_connectionInfo.port );
m_pConnection->setSchema( m_connectionInfo.database );
}
@@ -79,9 +79,9 @@ uint32_t Core::Db::DbConnection::getLastError()
return m_pConnection->getErrorNo();
}
-void Core::Db::DbConnection::ping()
+bool Core::Db::DbConnection::ping()
{
- m_pConnection->ping();
+ return m_pConnection->ping();
}
bool Core::Db::DbConnection::lockIfReady()
@@ -146,6 +146,17 @@ boost::shared_ptr< Mysql::ResultSet > Core::Db::DbConnection::query( boost::shar
if( !stmt )
return nullptr;
+ if( !ping() )
+ {
+ g_log.error( "MysqlConnection went down" );
+ // naivly reconnect and hope for the best
+ open();
+ lockIfReady();
+ if( !prepareStatements() )
+ g_log.error( "Mysql Statements failed to prepare..." );
+ g_log.info( "MysqlConnection reestablished" );
+ }
+
uint32_t index = stmt->getIndex();
auto pStmt = getPreparedStatement( index );
diff --git a/src/common/Database/DbConnection.h b/src/common/Database/DbConnection.h
index ddb66e17..f304e423 100644
--- a/src/common/Database/DbConnection.h
+++ b/src/common/Database/DbConnection.h
@@ -72,7 +72,7 @@ namespace Db
void rollbackTransaction();
void commitTransaction();
- void ping();
+ bool ping();
uint32_t getLastError();
bool lockIfReady();
diff --git a/src/common/Exd/ExdData.cpp b/src/common/Exd/ExdData.cpp
index 9ac2197a..52b192af 100644
--- a/src/common/Exd/ExdData.cpp
+++ b/src/common/Exd/ExdData.cpp
@@ -85,10 +85,11 @@ bool Core::Data::ExdData::loadZoneInfo()
int16_t map_index = getField< int16_t >( mapDataFields, 12 );
bool is_two_bytes = getField< bool >( mapDataFields, 15 );
- uint16_t weather_rate = getField< uint16_t >( fields, 10 ) > 75 ? 0 : getField< uint16_t >( fields, 10 );
+ uint8_t weather_rate = getField< uint8_t >( fields, 12 ) > 75 ? 0 : getField< uint8_t >( fields, 12 );
auto weatherRateFields = weatherRate.get_row( weather_rate );
int32_t aetheryte_index = getField< int32_t >( fields, 23 );
+ uint8_t zoneType = getField< uint8_t >( fields, 9 );
ZoneInfo info{ 0 };
@@ -101,6 +102,8 @@ bool Core::Data::ExdData::loadZoneInfo()
info.map_id = map_id;
info.weather_rate = weather_rate; // TODO: deal with weather groups
info.aetheryte_index = aetheryte_index;
+ info.zone_type = zoneType;
+
uint8_t sumPc = 0;
for( size_t i = 0; i < 16; )
diff --git a/src/common/Exd/ExdData.h b/src/common/Exd/ExdData.h
index 3a5dedf9..d17bffb8 100644
--- a/src/common/Exd/ExdData.h
+++ b/src/common/Exd/ExdData.h
@@ -37,6 +37,7 @@ namespace Core {
std::map< uint8_t, int32_t> weather_rate_map;
int32_t aetheryte_index;
+ uint8_t zone_type;
};
struct ClassJobInfo
diff --git a/src/tools/exd_struct_test/ExdDataGenerated.cpp b/src/common/Exd/ExdDataGenerated.cpp
similarity index 99%
rename from src/tools/exd_struct_test/ExdDataGenerated.cpp
rename to src/common/Exd/ExdDataGenerated.cpp
index f8d711b8..ff6e1a45 100644
--- a/src/tools/exd_struct_test/ExdDataGenerated.cpp
+++ b/src/common/Exd/ExdDataGenerated.cpp
@@ -3532,6 +3532,7 @@
placeNameZone = exdData->getField< uint16_t >( row, 4 );
placeName = exdData->getField< uint16_t >( row, 5 );
map = exdData->getField< uint16_t >( row, 6 );
+ territoryIntendedUse = exdData->getField< uint8_t >( row, 9 );
weatherRate = exdData->getField< uint8_t >( row, 12 );
aetheryte = exdData->getField< int32_t >( row, 23 );
}
diff --git a/src/tools/exd_struct_test/ExdDataGenerated.h b/src/common/Exd/ExdDataGenerated.h
similarity index 99%
rename from src/tools/exd_struct_test/ExdDataGenerated.h
rename to src/common/Exd/ExdDataGenerated.h
index 24b1149d..530caaf0 100644
--- a/src/tools/exd_struct_test/ExdDataGenerated.h
+++ b/src/common/Exd/ExdDataGenerated.h
@@ -1,5 +1,5 @@
-#ifndef _EXDDATA_H
-#define _EXDDATA_H
+#ifndef _EXDDATAGENERATED_H
+#define _EXDDATAGENERATED_H
/* This file has been automatically generated.
Changes will be lost upon regeneration.
@@ -3020,12 +3020,12 @@ struct TerritoryType
uint16_t placeNameZone;
uint16_t placeName;
uint16_t map;
+ uint8_t territoryIntendedUse;
uint8_t weatherRate;
int32_t aetheryte;
TerritoryType( uint32_t row_id, Core::Data::ExdDataGenerated* exdData );
};
-
struct TextCommand
{
std::string command;
diff --git a/src/common/Network/PacketDef/Zone/ServerZoneDef.h b/src/common/Network/PacketDef/Zone/ServerZoneDef.h
index dcbe9114..4022cdf4 100644
--- a/src/common/Network/PacketDef/Zone/ServerZoneDef.h
+++ b/src/common/Network/PacketDef/Zone/ServerZoneDef.h
@@ -365,7 +365,7 @@ struct FFXIVIpcPlayerSpawn : FFXIVIpcBasePacket
uint32_t bNPCName;
uint32_t u18;
uint32_t u19;
- uint32_t u20;
+ uint32_t directorId;
uint32_t ownerId;
uint32_t u22;
uint32_t hPMax;
diff --git a/src/libraries b/src/libraries
index f4d3c5b3..978d3d2a 160000
--- a/src/libraries
+++ b/src/libraries
@@ -1 +1 @@
-Subproject commit f4d3c5b38d13a15efc42686c9bac768c2be28be1
+Subproject commit 978d3d2a336b97bb6ea0d95dc7000cbc1618a8cc
diff --git a/src/servers/sapphire_api/Forwards.h b/src/servers/sapphire_api/Forwards.h
index 56d3b92d..bdffff9f 100644
--- a/src/servers/sapphire_api/Forwards.h
+++ b/src/servers/sapphire_api/Forwards.h
@@ -45,9 +45,9 @@ namespace Core
namespace Event
{
- class Event;
+ class EventHandler;
- typedef boost::shared_ptr EventPtr;
+ typedef boost::shared_ptr EventPtr;
}
namespace Action
diff --git a/src/servers/sapphire_zone/Action/ActionCast.cpp b/src/servers/sapphire_zone/Action/ActionCast.cpp
index 002504fd..b9289b30 100644
--- a/src/servers/sapphire_zone/Action/ActionCast.cpp
+++ b/src/servers/sapphire_zone/Action/ActionCast.cpp
@@ -58,7 +58,6 @@ void Core::Action::ActionCast::onStart()
m_pSource->sendToInRangeSet( castPacket, true );
m_pSource->getAsPlayer()->setStateFlag( PlayerStateFlag::Casting );
- m_pSource->getAsPlayer()->sendStateFlags();
}
@@ -71,7 +70,6 @@ void Core::Action::ActionCast::onFinish()
pPlayer->sendDebug( "onFinish()" );
pPlayer->unsetStateFlag( PlayerStateFlag::Casting );
- pPlayer->sendStateFlags();
/*auto control = ActorControlPacket143( m_pTarget->getId(), ActorControlType::Unk7,
0x219, m_id, m_id, m_id, m_id );
@@ -87,7 +85,6 @@ void Core::Action::ActionCast::onInterrupt()
m_pSource->getAsPlayer()->unsetStateFlag( PlayerStateFlag::Occupied1 );
m_pSource->getAsPlayer()->unsetStateFlag( PlayerStateFlag::Casting );
- m_pSource->getAsPlayer()->sendStateFlags();
auto control = ActorControlPacket142( m_pSource->getId(), ActorControlType::CastInterrupt,
0x219, 1, m_id, 0 );
diff --git a/src/servers/sapphire_zone/Action/ActionMount.cpp b/src/servers/sapphire_zone/Action/ActionMount.cpp
index 6ff6c8b9..5e5a4846 100644
--- a/src/servers/sapphire_zone/Action/ActionMount.cpp
+++ b/src/servers/sapphire_zone/Action/ActionMount.cpp
@@ -60,7 +60,6 @@ void Core::Action::ActionMount::onStart()
m_pSource->sendToInRangeSet( castPacket, true );
m_pSource->getAsPlayer()->setStateFlag( PlayerStateFlag::Casting );
- m_pSource->getAsPlayer()->sendStateFlags();
}
@@ -73,7 +72,6 @@ void Core::Action::ActionMount::onFinish()
pPlayer->sendDebug( "ActionMount::onFinish()" );
pPlayer->unsetStateFlag( PlayerStateFlag::Casting );
- pPlayer->sendStateFlags();
ZoneChannelPacket< FFXIVIpcEffect > effectPacket( pPlayer->getId() );
effectPacket.data().targetId = pPlayer->getId();
@@ -100,7 +98,6 @@ void Core::Action::ActionMount::onInterrupt()
m_pSource->getAsPlayer()->unsetStateFlag( PlayerStateFlag::Occupied1 );
m_pSource->getAsPlayer()->unsetStateFlag( PlayerStateFlag::Casting );
- m_pSource->getAsPlayer()->sendStateFlags();
auto control = ActorControlPacket142( m_pSource->getId(), ActorControlType::CastInterrupt,
0x219, 1, m_id, 0 );
diff --git a/src/servers/sapphire_zone/Action/ActionTeleport.cpp b/src/servers/sapphire_zone/Action/ActionTeleport.cpp
index 7e8cec18..bb53e522 100644
--- a/src/servers/sapphire_zone/Action/ActionTeleport.cpp
+++ b/src/servers/sapphire_zone/Action/ActionTeleport.cpp
@@ -54,7 +54,6 @@ void Core::Action::ActionTeleport::onStart()
m_pSource->sendToInRangeSet( castPacket, true );
m_pSource->getAsPlayer()->setStateFlag( PlayerStateFlag::Casting );
- m_pSource->getAsPlayer()->sendStateFlags();
}
@@ -75,7 +74,6 @@ void Core::Action::ActionTeleport::onFinish()
pPlayer->removeCurrency( Inventory::CurrencyType::Gil, m_cost );
pPlayer->unsetStateFlag( PlayerStateFlag::Casting );
- pPlayer->sendStateFlags();
// TODO: not sure if this ever gets sent
//auto control = Network::Packets::Server::ActorControlPacket142( m_pSource->getId(), Common::ActorControlType::TeleportDone );
@@ -105,7 +103,6 @@ void Core::Action::ActionTeleport::onInterrupt()
return;
m_pSource->getAsPlayer()->unsetStateFlag( PlayerStateFlag::Casting );
- m_pSource->getAsPlayer()->sendStateFlags();
auto control = ActorControlPacket142( m_pSource->getId(), ActorControlType::CastInterrupt,
0x219, 0x04, m_id, 0 );
diff --git a/src/servers/sapphire_zone/Action/EventAction.cpp b/src/servers/sapphire_zone/Action/EventAction.cpp
index b174bdad..869fa089 100644
--- a/src/servers/sapphire_zone/Action/EventAction.cpp
+++ b/src/servers/sapphire_zone/Action/EventAction.cpp
@@ -6,7 +6,7 @@
#include "Network/PacketWrappers/ActorControlPacket142.h"
#include "Network/PacketWrappers/ActorControlPacket143.h"
#include "Actor/Player.h"
-#include "Event/Event.h"
+#include "Event/EventHandler.h"
extern Core::Logger g_log;
extern Core::Data::ExdData g_exdData;
@@ -54,7 +54,6 @@ void Core::Action::EventAction::onStart()
{
m_pSource->sendToInRangeSet( control, true );
m_pSource->getAsPlayer()->setStateFlag( PlayerStateFlag::SomeFlag );
- m_pSource->getAsPlayer()->sendStateFlags();
}
else
m_pSource->sendToInRangeSet( control );
@@ -84,7 +83,6 @@ void Core::Action::EventAction::onFinish()
if( m_pSource->isPlayer() )
{
m_pSource->getAsPlayer()->unsetStateFlag( PlayerStateFlag::SomeFlag );
- m_pSource->getAsPlayer()->sendStateFlags();
m_pSource->sendToInRangeSet( control, true );
}
else
@@ -114,7 +112,6 @@ void Core::Action::EventAction::onInterrupt()
m_pSource->getAsPlayer()->unsetStateFlag( PlayerStateFlag::NoCombat );
m_pSource->getAsPlayer()->unsetStateFlag( PlayerStateFlag::Occupied1 );
- m_pSource->getAsPlayer()->sendStateFlags();
m_pSource->sendToInRangeSet( control );
m_pSource->sendToInRangeSet( control1 );
diff --git a/src/servers/sapphire_zone/Action/EventItemAction.cpp b/src/servers/sapphire_zone/Action/EventItemAction.cpp
index 3a8c3f78..28ddd8fb 100644
--- a/src/servers/sapphire_zone/Action/EventItemAction.cpp
+++ b/src/servers/sapphire_zone/Action/EventItemAction.cpp
@@ -56,7 +56,6 @@ void Core::Action::EventItemAction::onStart()
m_pSource->sendToInRangeSet( castPacket, true );
m_pSource->getAsPlayer()->setStateFlag( PlayerStateFlag::Casting );
- m_pSource->getAsPlayer()->sendStateFlags();
}
@@ -78,7 +77,6 @@ void Core::Action::EventItemAction::onFinish()
effectPacket.data().effectTarget = static_cast< uint32_t >( m_additional );
m_pSource->getAsPlayer()->unsetStateFlag( Common::PlayerStateFlag::Casting );
- m_pSource->getAsPlayer()->sendStateFlags();
m_pSource->sendToInRangeSet( effectPacket, true );
if( m_onActionFinishClb )
@@ -104,7 +102,6 @@ void Core::Action::EventItemAction::onInterrupt()
if( m_pSource->isPlayer() )
{
m_pSource->getAsPlayer()->unsetStateFlag( PlayerStateFlag::Casting );
- m_pSource->getAsPlayer()->sendStateFlags();
m_pSource->sendToInRangeSet( control, true );
}
else
diff --git a/src/servers/sapphire_zone/Actor/Actor.h b/src/servers/sapphire_zone/Actor/Actor.h
index 9ceffb55..08ff963b 100644
--- a/src/servers/sapphire_zone/Actor/Actor.h
+++ b/src/servers/sapphire_zone/Actor/Actor.h
@@ -16,7 +16,6 @@ namespace Entity {
\class Actor
\brief Base class for all actors
-\author Mordred
*/
class Actor : public boost::enable_shared_from_this< Actor >
{
diff --git a/src/servers/sapphire_zone/Actor/Player.cpp b/src/servers/sapphire_zone/Actor/Player.cpp
index 6365098b..fa8c1d3b 100644
--- a/src/servers/sapphire_zone/Actor/Player.cpp
+++ b/src/servers/sapphire_zone/Actor/Player.cpp
@@ -11,7 +11,7 @@
#include "Player.h"
#include "BattleNpc.h"
-#include "Zone/ZoneMgr.h"
+#include "Zone/TerritoryMgr.h"
#include "Zone/Zone.h"
#include "ServerZone.h"
@@ -32,7 +32,7 @@
#include "Inventory/Item.h"
#include "Inventory/Inventory.h"
-#include "Event/Event.h"
+#include "Event/EventHandler.h"
#include "Action/Action.h"
#include "Action/EventAction.h"
#include "Action/EventItemAction.h"
@@ -43,7 +43,7 @@
extern Core::Logger g_log;
extern Core::ServerZone g_serverZone;
-extern Core::ZoneMgr g_zoneMgr;
+extern Core::TerritoryMgr g_territoryMgr;
extern Core::Data::ExdData g_exdData;
extern Core::Scripting::ScriptManager g_scriptMgr;
@@ -308,9 +308,8 @@ void Core::Entity::Player::teleport( uint16_t aetheryteId, uint8_t type )
}
setStateFlag( PlayerStateFlag::BetweenAreas );
- sendStateFlags();
- auto z_pos = g_zoneMgr.getZonePosition( data->levelId );
+ auto z_pos = g_territoryMgr.getTerritoryPosition( data->levelId );
Common::FFXIVARR_POSITION3 pos;
pos.x = 0;
@@ -366,101 +365,62 @@ void Core::Entity::Player::returnToHomepoint()
void Core::Entity::Player::setZone( uint32_t zoneId )
{
- auto pPlayer = getAsPlayer();
-
- auto pZone = g_zoneMgr.getZone( zoneId );
-
-
- if( !pZone /*|| ( ( pZone == m_pCurrentZone ) && m_lastPing )*/ )
+ if( !g_territoryMgr.movePlayer( zoneId, getAsPlayer() ) )
{
- g_log.error( "Zone " + std::to_string( zoneId ) + " not found on this server." );
- return;
+ // todo: this will require proper handling, for now just return the player to their previous area
+ m_pos = m_prevPos;
+ m_rot = m_prevRot;
+ m_zoneId = m_prevZoneId;
+
+ if( !g_territoryMgr.movePlayer( m_zoneId, getAsPlayer() ) )
+ return;
}
- m_zoneId = zoneId;
+ sendZonePackets();
+}
- // mark character as zoning in progress
- setLoadingComplete( false );
+bool Core::Entity::Player::setInstance( uint32_t instanceContentId )
+{
+ auto instance = g_territoryMgr.getInstanceZonePtr( instanceContentId );
+ if( !instance )
+ return false;
- if( m_lastPing != 0 )
- m_pCurrentZone->removeActor( shared_from_this() );
+ return setInstance( instance );
+}
- m_pCurrentZone = pZone;
- m_pCurrentZone->pushActor( shared_from_this() );
+bool Core::Entity::Player::setInstance( ZonePtr instance )
+{
+ if( !instance )
+ return false;
- ZoneChannelPacket< FFXIVIpcInit > initPacket( getId() );
- initPacket.data().charId = getId();
- queuePacket( initPacket );
-
- sendInventory();
-
- if( isLogin() )
+ // zoning within the same zone won't cause the prev data to be overwritten
+ if( instance->getTerritoryId() != m_zoneId )
{
- queuePacket(ActorControlPacket143( getId(), SetCharaGearParamUI, m_equipDisplayFlags, 1 ) );
+ m_prevPos = m_pos;
+ m_prevRot = m_rot;
+ m_prevZoneId = m_zoneId;
}
- // set flags, will be reset automatically by zoning ( only on client side though )
- pPlayer->setStateFlag( PlayerStateFlag::BetweenAreas );
- pPlayer->setStateFlag( PlayerStateFlag::BetweenAreas1 );
- pPlayer->sendStateFlags();
+ if( !g_territoryMgr.movePlayer( instance, getAsPlayer() ) )
+ return false;
- pPlayer->sendStats();
+ sendZonePackets();
- // only initialize the UI if the player in fact just logged in.
- if( isLogin() )
- {
- ZoneChannelPacket< FFXIVIpcCFAvailableContents > contentFinderList( getId() );
- for( auto i = 0; i < sizeof( contentFinderList.data().contents ); i++ )
- {
- // unlock all contents for now
- contentFinderList.data().contents[i] = 0xFF;
- }
- queuePacket( contentFinderList );
+ return true;
+}
- Server::InitUIPacket initUIPacket( *pPlayer );
- queuePacket( initUIPacket );
+bool Core::Entity::Player::exitInstance()
+{
+ if( !g_territoryMgr.movePlayer( m_prevZoneId, getAsPlayer() ) )
+ return false;
- ZoneChannelPacket< FFXIVIpcPlayerClassInfo > classInfoPacket( getId() );
- classInfoPacket.data().classId = static_cast< uint8_t >( getClass() );
- classInfoPacket.data().unknown = 1;
- classInfoPacket.data().level = getLevel();
- classInfoPacket.data().level1 = getLevel();
- queuePacket( classInfoPacket );
+ m_pos = m_prevPos;
+ m_rot = m_prevRot;
+ m_zoneId = m_prevZoneId;
- ZoneChannelPacket< FFXIVGCAffiliation > gcAffPacket( getId() );
- gcAffPacket.data().gcId = m_gc;
- gcAffPacket.data().gcRank[0] = m_gcRank[0];
- gcAffPacket.data().gcRank[1] = m_gcRank[1];
- gcAffPacket.data().gcRank[2] = m_gcRank[2];
- queuePacket( gcAffPacket );
+ sendZonePackets();
- m_itemLevel = getInventory()->calculateEquippedGearItemLevel();
- sendItemLevel();
- }
-
- ZoneChannelPacket< FFXIVIpcInitZone > initZonePacket( getId() );
- initZonePacket.data().zoneId = getCurrentZone()->getLayoutId();
- initZonePacket.data().weatherId = static_cast< uint8_t >( getCurrentZone()->getCurrentWeather() );
- initZonePacket.data().bitmask = 0x1;
- initZonePacket.data().unknown5 = 0x2A;
- initZonePacket.data().pos.x = getPos().x;
- initZonePacket.data().pos.y = getPos().y;
- initZonePacket.data().pos.z = getPos().z;
- queuePacket( initZonePacket );
-
- if( isLogin() )
- {
- ZoneChannelPacket< FFXIVARR_IPC_UNK322 > unk322( getId() );
- queuePacket( unk322 );
-
- ZoneChannelPacket< FFXIVARR_IPC_UNK320 > unk320( getId() );
- queuePacket( unk320 );
- }
-
- if( getLastPing() == 0 )
- sendQuestInfo();
-
- m_bMarkedForZoning = false;
+ return true;
}
uint32_t Core::Entity::Player::getPlayTime() const
@@ -542,7 +502,7 @@ void Core::Entity::Player::discover( int16_t map_id, int16_t sub_id )
int32_t offset = 4;
- auto info = g_exdData.m_zoneInfoMap[getCurrentZone()->getId()];
+ auto info = g_exdData.m_zoneInfoMap[getCurrentZone()->getTerritoryId()];
if( info.is_two_byte )
offset = 4 + 2 * info.discovery_index;
else
@@ -580,7 +540,6 @@ void Core::Entity::Player::setNewAdventurer( bool state )
//{
// setStateFlag( PlayerStateFlag::NewAdventurer );
//}
- sendStateFlags();
m_bNewAdventurer = state;
}
@@ -972,6 +931,7 @@ bool Core::Entity::Player::hasStateFlag( Common::PlayerStateFlag flag ) const
void Core::Entity::Player::setStateFlag( Common::PlayerStateFlag flag )
{
+ auto prevOnlineStatus = getOnlineStatus();
int32_t iFlag = static_cast< uint32_t >( flag );
uint16_t index;
@@ -979,6 +939,13 @@ void Core::Entity::Player::setStateFlag( Common::PlayerStateFlag flag )
Util::valueToFlagByteIndexValue( iFlag, value, index );
m_stateFlags[index] |= value;
+ sendStateFlags();
+
+ auto newOnlineStatus = getOnlineStatus();
+
+ if( prevOnlineStatus != newOnlineStatus )
+ sendToInRangeSet( ActorControlPacket142( getId(), SetStatusIcon,
+ static_cast< uint8_t >( getOnlineStatus() ) ), true );
}
@@ -986,13 +953,7 @@ void Core::Entity::Player::setStateFlags( std::vector< Common::PlayerStateFlag >
{
for( const auto& flag : flags )
{
- int iFlag = static_cast< uint32_t >( flag );
-
- uint16_t index;
- uint8_t value;
- Util::valueToFlagByteIndexValue( iFlag, value, index );
-
- m_stateFlags[index] |= value;
+ setStateFlag( flag );
}
}
@@ -1006,6 +967,8 @@ void Core::Entity::Player::unsetStateFlag( Common::PlayerStateFlag flag )
if( !hasStateFlag( flag ) )
return;
+ auto prevOnlineStatus = getOnlineStatus();
+
int32_t iFlag = static_cast< uint32_t >( flag );
uint16_t index;
@@ -1013,7 +976,13 @@ void Core::Entity::Player::unsetStateFlag( Common::PlayerStateFlag flag )
Util::valueToFlagByteIndexValue( iFlag, value, index );
m_stateFlags[index] ^= value;
+ sendStateFlags();
+ auto newOnlineStatus = getOnlineStatus();
+
+ if( prevOnlineStatus != newOnlineStatus )
+ sendToInRangeSet( ActorControlPacket142( getId(), SetStatusIcon,
+ static_cast< uint8_t >( getOnlineStatus() ) ), true );
}
void Core::Entity::Player::update( int64_t currTime )
@@ -1023,7 +992,7 @@ void Core::Entity::Player::update( int64_t currTime )
if( m_queuedZoneing && ( currTime - m_queuedZoneing->m_queueTime ) > 800 )
{
Common::FFXIVARR_POSITION3 targetPos = m_queuedZoneing->m_targetPosition;
- if( getCurrentZone()->getId() != m_queuedZoneing->m_targetZone )
+ if( getCurrentZone()->getTerritoryId() != m_queuedZoneing->m_targetZone )
{
performZoning( m_queuedZoneing->m_targetZone, targetPos, m_queuedZoneing->m_targetRotation);
}
@@ -1596,3 +1565,89 @@ void Core::Entity::Player::setEorzeaTimeOffset( uint64_t timestamp )
// Send to single player
queuePacket( packet );
}
+
+void Player::setTerritoryId( uint32_t territoryId )
+{
+ m_zoneId = territoryId;
+}
+
+uint32_t Player::getTerritoryId() const
+{
+ return m_zoneId;
+}
+
+void Player::sendZonePackets()
+{
+ ZoneChannelPacket< FFXIVIpcInit > initPacket( getId() );
+ initPacket.data().charId = getId();
+ queuePacket( initPacket );
+
+ sendInventory();
+
+ if( isLogin() )
+ {
+ queuePacket(ActorControlPacket143( getId(), SetCharaGearParamUI, m_equipDisplayFlags, 1 ) );
+ }
+
+ // set flags, will be reset automatically by zoning ( only on client side though )
+ setStateFlag( PlayerStateFlag::BetweenAreas );
+ setStateFlag( PlayerStateFlag::BetweenAreas1 );
+
+ sendStats();
+
+ // only initialize the UI if the player in fact just logged in.
+ if( isLogin() )
+ {
+ ZoneChannelPacket< FFXIVIpcCFAvailableContents > contentFinderList( getId() );
+ for( auto i = 0; i < sizeof( contentFinderList.data().contents ); i++ )
+ {
+ // unlock all contents for now
+ contentFinderList.data().contents[i] = 0xFF;
+ }
+ queuePacket( contentFinderList );
+
+ Server::InitUIPacket initUIPacket( *this );
+ queuePacket( initUIPacket );
+
+ ZoneChannelPacket< FFXIVIpcPlayerClassInfo > classInfoPacket( getId() );
+ classInfoPacket.data().classId = static_cast< uint8_t >( getClass() );
+ classInfoPacket.data().unknown = 1;
+ classInfoPacket.data().level = getLevel();
+ classInfoPacket.data().level1 = getLevel();
+ queuePacket( classInfoPacket );
+
+ ZoneChannelPacket< FFXIVGCAffiliation > gcAffPacket( getId() );
+ gcAffPacket.data().gcId = m_gc;
+ gcAffPacket.data().gcRank[0] = m_gcRank[0];
+ gcAffPacket.data().gcRank[1] = m_gcRank[1];
+ gcAffPacket.data().gcRank[2] = m_gcRank[2];
+ queuePacket( gcAffPacket );
+
+ m_itemLevel = getInventory()->calculateEquippedGearItemLevel();
+ sendItemLevel();
+ }
+
+ ZoneChannelPacket< FFXIVIpcInitZone > initZonePacket( getId() );
+ initZonePacket.data().zoneId = getCurrentZone()->getTerritoryId();
+ initZonePacket.data().weatherId = static_cast< uint8_t >( getCurrentZone()->getCurrentWeather() );
+ initZonePacket.data().bitmask = 0x1;
+ initZonePacket.data().unknown5 = 0x2A;
+ initZonePacket.data().pos.x = getPos().x;
+ initZonePacket.data().pos.y = getPos().y;
+ initZonePacket.data().pos.z = getPos().z;
+ queuePacket( initZonePacket );
+
+ if( isLogin() )
+ {
+ ZoneChannelPacket< FFXIVARR_IPC_UNK322 > unk322( getId() );
+ queuePacket( unk322 );
+
+ ZoneChannelPacket< FFXIVARR_IPC_UNK320 > unk320( getId() );
+ queuePacket( unk320 );
+ }
+
+ if( getLastPing() == 0 )
+ sendQuestInfo();
+
+ m_bMarkedForZoning = false;
+}
diff --git a/src/servers/sapphire_zone/Actor/Player.h b/src/servers/sapphire_zone/Actor/Player.h
index ea7b7027..3bb6f9e5 100644
--- a/src/servers/sapphire_zone/Actor/Player.h
+++ b/src/servers/sapphire_zone/Actor/Player.h
@@ -7,6 +7,7 @@
#include "Actor.h"
#include "Inventory/Inventory.h"
+#include "Event/EventHandler.h"
#include