mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-25 14:07:46 +00:00
Fixed an issue with scripts no longer having a function to warp to a different territory type.
This commit is contained in:
parent
3a71d90e71
commit
d34d93a7dd
33 changed files with 70 additions and 48 deletions
|
@ -31,7 +31,7 @@ public:
|
||||||
|
|
||||||
auto& terriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref();
|
auto& terriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref();
|
||||||
|
|
||||||
auto pHZone = terriMgr.getZoneByTerritoryTypeId( player.getTerritoryTypeId() );
|
auto pHZone = terriMgr.getTerritoryByTypeId( player.getTerritoryTypeId() );
|
||||||
auto zone = std::dynamic_pointer_cast< HousingZone >( pHZone );
|
auto zone = std::dynamic_pointer_cast< HousingZone >( pHZone );
|
||||||
if( !zone )
|
if( !zone )
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -35,7 +35,7 @@ public:
|
||||||
auto territoryId = player.getTerritoryId();
|
auto territoryId = player.getTerritoryId();
|
||||||
|
|
||||||
auto& terriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref();
|
auto& terriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref();
|
||||||
auto pTerritory = terriMgr.getZoneByTerritoryTypeId( player.getTerritoryTypeId() );
|
auto pTerritory = terriMgr.getTerritoryByTypeId( player.getTerritoryTypeId() );
|
||||||
auto pHousing = std::dynamic_pointer_cast< HousingZone >( pTerritory );
|
auto pHousing = std::dynamic_pointer_cast< HousingZone >( pTerritory );
|
||||||
auto& pHouMgr = Common::Service< HousingMgr >::ref();
|
auto& pHouMgr = Common::Service< HousingMgr >::ref();
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ public:
|
||||||
auto popRangeInfo = instanceObjectCache().getPopRangeInfo( warp->data().PopRange );
|
auto popRangeInfo = instanceObjectCache().getPopRangeInfo( warp->data().PopRange );
|
||||||
if( popRangeInfo )
|
if( popRangeInfo )
|
||||||
{
|
{
|
||||||
auto pTeri = teriMgr().getZoneByTerritoryTypeId( popRangeInfo->m_territoryTypeId );
|
auto pTeri = teriMgr().getTerritoryByTypeId( popRangeInfo->m_territoryTypeId );
|
||||||
warpMgr().requestMoveTerritory( player, Sapphire::Common::WARP_TYPE_TOWN_TRANSLATE,
|
warpMgr().requestMoveTerritory( player, Sapphire::Common::WARP_TYPE_TOWN_TRANSLATE,
|
||||||
pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ public:
|
||||||
auto popRangeInfo = instanceObjectCache().getPopRangeInfo( warp->data().PopRange );
|
auto popRangeInfo = instanceObjectCache().getPopRangeInfo( warp->data().PopRange );
|
||||||
if( popRangeInfo )
|
if( popRangeInfo )
|
||||||
{
|
{
|
||||||
auto pTeri = teriMgr().getZoneByTerritoryTypeId( popRangeInfo->m_territoryTypeId );
|
auto pTeri = teriMgr().getTerritoryByTypeId( popRangeInfo->m_territoryTypeId );
|
||||||
warpMgr().requestMoveTerritory( player, Sapphire::Common::WARP_TYPE_TOWN_TRANSLATE,
|
warpMgr().requestMoveTerritory( player, Sapphire::Common::WARP_TYPE_TOWN_TRANSLATE,
|
||||||
pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,7 +159,7 @@ private:
|
||||||
quest.setUI8CH( 1 ); // receive key item
|
quest.setUI8CH( 1 ); // receive key item
|
||||||
|
|
||||||
// teleport to real gridania
|
// teleport to real gridania
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, TERRITORYTYPE0 );
|
warpMgr().requestMoveTerritoryType( player, Common::WarpType::WARP_TYPE_NORMAL, TERRITORYTYPE0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene00051( World::Quest& quest, Entity::Player& player )
|
void Scene00051( World::Quest& quest, Entity::Player& player )
|
||||||
|
|
|
@ -229,7 +229,7 @@ private:
|
||||||
{
|
{
|
||||||
quest.setSeq( Seq1 );
|
quest.setSeq( Seq1 );
|
||||||
quest.setUI8CH( 1 );
|
quest.setUI8CH( 1 );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, 132 );
|
warpMgr().requestMoveTerritoryType( player, Common::WarpType::WARP_TYPE_NORMAL, 132 );
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -230,7 +230,7 @@ private:
|
||||||
quest.setSeq( Seq1 );
|
quest.setSeq( Seq1 );
|
||||||
quest.setUI8CH( 1 ); // receive key item
|
quest.setUI8CH( 1 ); // receive key item
|
||||||
// event is done, need to teleport to real zone.
|
// event is done, need to teleport to real zone.
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, Territorytype0 );
|
warpMgr().requestMoveTerritoryType( player, Common::WarpType::WARP_TYPE_NORMAL, Territorytype0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -355,7 +355,7 @@ private:
|
||||||
|
|
||||||
void Scene00008Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
void Scene00008Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
||||||
{
|
{
|
||||||
auto dest = teriMgr().getZoneByTerritoryTypeId( Territorytype2 );
|
auto dest = teriMgr().getTerritoryByTypeId( Territorytype2 );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, dest->getGuId(), { -11.86f, 92.f, 17.f }, -1.95f );
|
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, dest->getGuId(), { -11.86f, 92.f, 17.f }, -1.95f );
|
||||||
quest.setSeq( Seq4 );
|
quest.setSeq( Seq4 );
|
||||||
eventMgr().sendEventNotice( player, getId(), 2, 0 );
|
eventMgr().sendEventNotice( player, getId(), 2, 0 );
|
||||||
|
@ -629,7 +629,7 @@ private:
|
||||||
|
|
||||||
void Scene00030Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
void Scene00030Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
||||||
{
|
{
|
||||||
auto dest = teriMgr().getZoneByTerritoryTypeId( Territorytype3 );
|
auto dest = teriMgr().getTerritoryByTypeId( Territorytype3 );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, dest->getGuId(), { -44.14f, 84.f, -0.47f }, 1.3f );
|
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, dest->getGuId(), { -44.14f, 84.f, -0.47f }, 1.3f );
|
||||||
quest.setSeq( Seq8 );
|
quest.setSeq( Seq8 );
|
||||||
eventMgr().sendEventNotice( player, getId(), 2, 0 );
|
eventMgr().sendEventNotice( player, getId(), 2, 0 );
|
||||||
|
|
|
@ -587,7 +587,7 @@ private:
|
||||||
{
|
{
|
||||||
if( result.getResult( 0 ) == 1 )
|
if( result.getResult( 0 ) == 1 )
|
||||||
{
|
{
|
||||||
auto dest = teriMgr().getZoneByTerritoryTypeId( Territorytype1 );
|
auto dest = teriMgr().getTerritoryByTypeId( Territorytype1 );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, dest->getGuId(), { -53.4502f, -24.0946f, -567.494f }, -0.550531f );//Manual Pos
|
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, dest->getGuId(), { -53.4502f, -24.0946f, -567.494f }, -0.550531f );//Manual Pos
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -735,7 +735,7 @@ private:
|
||||||
{
|
{
|
||||||
if( result.getResult( 0 ) == 1 )
|
if( result.getResult( 0 ) == 1 )
|
||||||
{
|
{
|
||||||
auto dest = teriMgr().getZoneByTerritoryTypeId( Territorytype1 );
|
auto dest = teriMgr().getTerritoryByTypeId( Territorytype1 );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, dest->getGuId(), { -53.4502f, -24.0946f, -567.494f }, -0.550531f );//Manual Pos
|
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, dest->getGuId(), { -53.4502f, -24.0946f, -567.494f }, -0.550531f );//Manual Pos
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,7 +133,7 @@ private:
|
||||||
|
|
||||||
if( popRangeInfo )
|
if( popRangeInfo )
|
||||||
{
|
{
|
||||||
auto pTeri = teriMgr().getZoneByTerritoryTypeId( popRangeInfo->m_territoryTypeId );
|
auto pTeri = teriMgr().getTerritoryByTypeId( popRangeInfo->m_territoryTypeId );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,7 +304,7 @@ private:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto pTeri = teriMgr().getZoneByTerritoryTypeId( popRangeInfo->m_territoryTypeId );
|
auto pTeri = teriMgr().getTerritoryByTypeId( popRangeInfo->m_territoryTypeId );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ private:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto pTeri = teriMgr().getZoneByTerritoryTypeId( popRangeInfo->m_territoryTypeId );
|
auto pTeri = teriMgr().getTerritoryByTypeId( popRangeInfo->m_territoryTypeId );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -198,7 +198,7 @@ private:
|
||||||
quest.setBitFlag8( 1, true );
|
quest.setBitFlag8( 1, true );
|
||||||
checkProgressSeq1( quest, player );
|
checkProgressSeq1( quest, player );
|
||||||
eventMgr().eventFinish( player, result.eventId, 1 );
|
eventMgr().eventFinish( player, result.eventId, 1 );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, teriMgr().getZoneByTerritoryTypeId( 181 )->getGuId(), { 9.0f, 40.0f, 14.0f }, 0.0f );
|
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, teriMgr().getTerritoryByTypeId( 181 )->getGuId(), { 9.0f, 40.0f, 14.0f }, 0.0f );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
eventMgr().playQuestScene( player, getId(), 5, HIDE_HOTBAR, callback );
|
eventMgr().playQuestScene( player, getId(), 5, HIDE_HOTBAR, callback );
|
||||||
|
@ -246,7 +246,7 @@ private:
|
||||||
if( result.errorCode == 0 || ( result.numOfResults > 0 && result.getResult( 0 ) == 1 ) )
|
if( result.errorCode == 0 || ( result.numOfResults > 0 && result.getResult( 0 ) == 1 ) )
|
||||||
{
|
{
|
||||||
eventMgr().eventFinish( player, result.eventId, 1 );
|
eventMgr().eventFinish( player, result.eventId, 1 );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, teriMgr().getZoneByTerritoryTypeId( 181 )->getGuId(), { 9.0f, 40.0f, 14.0f }, 0.0f );
|
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, teriMgr().getTerritoryByTypeId( 181 )->getGuId(), { 9.0f, 40.0f, 14.0f }, 0.0f );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
eventMgr().playQuestScene( player, getId(), 13, HIDE_HOTBAR, callback );
|
eventMgr().playQuestScene( player, getId(), 13, HIDE_HOTBAR, callback );
|
||||||
|
|
|
@ -229,7 +229,7 @@ private:
|
||||||
quest.setUI8CH( 1 ); // Receive key item
|
quest.setUI8CH( 1 ); // Receive key item
|
||||||
|
|
||||||
// Teleport to real ul'dah
|
// Teleport to real ul'dah
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, 130 );
|
warpMgr().requestMoveTerritoryType( player, Common::WarpType::WARP_TYPE_NORMAL, 130 );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -244,7 +244,7 @@ private:
|
||||||
pQuest->setUI8CH( 1 ); // receive key item
|
pQuest->setUI8CH( 1 ); // receive key item
|
||||||
|
|
||||||
// teleport to real ul'dah
|
// teleport to real ul'dah
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, 130 );
|
warpMgr().requestMoveTerritoryType( player, Common::WarpType::WARP_TYPE_NORMAL, 130 );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -233,7 +233,7 @@ private:
|
||||||
quest.setUI8CH( 1 );// receive key item
|
quest.setUI8CH( 1 );// receive key item
|
||||||
|
|
||||||
// teleport to real Uldah
|
// teleport to real Uldah
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, Territorytype0 );
|
warpMgr().requestMoveTerritoryType( player, Common::WarpType::WARP_TYPE_NORMAL, Territorytype0 );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -194,7 +194,7 @@ private:
|
||||||
{
|
{
|
||||||
player.finishQuest( getId(), result.getResult( 1 ) );
|
player.finishQuest( getId(), result.getResult( 1 ) );
|
||||||
eventMgr().eventFinish( player, result.eventId, 1 );
|
eventMgr().eventFinish( player, result.eventId, 1 );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, teriMgr().getZoneByTerritoryTypeId( 144 )->getGuId(), { -34.5, 0.64, 100 }, -1.58 );
|
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, teriMgr().getTerritoryByTypeId( 144 )->getGuId(), { -34.5, 0.64, 100 }, -1.58 );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
eventMgr().playQuestScene( player, getId(), 5, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, callback );
|
eventMgr().playQuestScene( player, getId(), 5, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, callback );
|
||||||
|
|
|
@ -141,7 +141,7 @@ private:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto pTeri = teriMgr().getZoneByTerritoryTypeId( popRangeInfo->m_territoryTypeId );
|
auto pTeri = teriMgr().getTerritoryByTypeId( popRangeInfo->m_territoryTypeId );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,7 +205,7 @@ private:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto pTeri = teriMgr().getZoneByTerritoryTypeId( popRangeInfo->m_territoryTypeId );
|
auto pTeri = teriMgr().getTerritoryByTypeId( popRangeInfo->m_territoryTypeId );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ private:
|
||||||
|
|
||||||
if( popRangeInfo )
|
if( popRangeInfo )
|
||||||
{
|
{
|
||||||
auto pTeri = teriMgr().getZoneByTerritoryTypeId( popRangeInfo->m_territoryTypeId );
|
auto pTeri = teriMgr().getTerritoryByTypeId( popRangeInfo->m_territoryTypeId );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,7 +218,7 @@ private:
|
||||||
{
|
{
|
||||||
quest.setSeq( Seq2 );
|
quest.setSeq( Seq2 );
|
||||||
player.changePosition( 10, 21, 13, -2 );
|
player.changePosition( 10, 21, 13, -2 );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, Territorytype0 );
|
warpMgr().requestMoveTerritoryType( player, Common::WarpType::WARP_TYPE_NORMAL, Territorytype0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -442,7 +442,7 @@ private:
|
||||||
|
|
||||||
if( popRangeInfo )
|
if( popRangeInfo )
|
||||||
{
|
{
|
||||||
auto pTeri = teriMgr().getZoneByTerritoryTypeId( popRangeInfo->m_territoryTypeId );
|
auto pTeri = teriMgr().getTerritoryByTypeId( popRangeInfo->m_territoryTypeId );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -258,7 +258,7 @@ private:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto pTeri = teriMgr().getZoneByTerritoryTypeId( popRangeInfo->m_territoryTypeId );
|
auto pTeri = teriMgr().getTerritoryByTypeId( popRangeInfo->m_territoryTypeId );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ private:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto pTeri = teriMgr().getZoneByTerritoryTypeId( popRangeInfo->m_territoryTypeId );
|
auto pTeri = teriMgr().getTerritoryByTypeId( popRangeInfo->m_territoryTypeId );
|
||||||
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
warpMgr().requestMoveTerritory( player, Common::WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), popRangeInfo->m_pos, popRangeInfo->m_rotation );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,7 @@ void EffectBuilder::buildAndSendPackets( const std::vector< Entity::CharaPtr >&
|
||||||
Logger::debug( "Targets afflicted: {}", targetList.size() );
|
Logger::debug( "Targets afflicted: {}", targetList.size() );
|
||||||
|
|
||||||
auto& teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref();
|
auto& teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref();
|
||||||
auto zone = teriMgr.getZoneByTerritoryTypeId( m_sourceChara->getTerritoryTypeId() );
|
auto zone = teriMgr.getTerritoryByTypeId( m_sourceChara->getTerritoryTypeId() );
|
||||||
|
|
||||||
auto globalSequence = zone ? zone->getNextEffectResultId() : 0;
|
auto globalSequence = zone ? zone->getNextEffectResultId() : 0;
|
||||||
|
|
||||||
|
|
|
@ -1428,23 +1428,23 @@ void DebugCommandMgr::easyWarp( char* data, Sapphire::Entity::Player& player, st
|
||||||
auto& warpMgr = Common::Service< WarpMgr >::ref();
|
auto& warpMgr = Common::Service< WarpMgr >::ref();
|
||||||
|
|
||||||
if( ( subCommand == "waking_sands" ) )
|
if( ( subCommand == "waking_sands" ) )
|
||||||
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getZoneByTerritoryTypeId( 140 )->getGuId(), { -483.257f, 17.0748f, -386.731f }, 1.61298f );
|
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getTerritoryByTypeId( 140 )->getGuId(), { -483.257f, 17.0748f, -386.731f }, 1.61298f );
|
||||||
else if( subCommand == "rising_stones" )
|
else if( subCommand == "rising_stones" )
|
||||||
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getZoneByTerritoryTypeId( 156 )->getGuId(), { 22.2674f, 21.2527f, -634.261f }, -0.369245f );
|
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getTerritoryByTypeId( 156 )->getGuId(), { 22.2674f, 21.2527f, -634.261f }, -0.369245f );
|
||||||
else if( subCommand == "little_solace" )
|
else if( subCommand == "little_solace" )
|
||||||
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getZoneByTerritoryTypeId( 152 )->getGuId(), { 24.557f, -3.78776f, 212.615f }, 2.59117f );
|
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getTerritoryByTypeId( 152 )->getGuId(), { 24.557f, -3.78776f, 212.615f }, 2.59117f );
|
||||||
else if( subCommand == "adders_nest" || subCommand == "gridania_gc" )
|
else if( subCommand == "adders_nest" || subCommand == "gridania_gc" )
|
||||||
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getZoneByTerritoryTypeId( 132 )->getGuId(), { -64.7448f, -0.503434f, 2.21786f }, -2.64096f );
|
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getTerritoryByTypeId( 132 )->getGuId(), { -64.7448f, -0.503434f, 2.21786f }, -2.64096f );
|
||||||
else if( subCommand == "hall_of_flames" || subCommand == "uldah_gc" )
|
else if( subCommand == "hall_of_flames" || subCommand == "uldah_gc" )
|
||||||
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getZoneByTerritoryTypeId( 130 )->getGuId(), { -129.24f, 4.1f, -93.5221f }, -2.30172f );
|
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getTerritoryByTypeId( 130 )->getGuId(), { -129.24f, 4.1f, -93.5221f }, -2.30172f );
|
||||||
else if( subCommand == "maelsrom_command" || subCommand == "limsa_gc" )
|
else if( subCommand == "maelsrom_command" || subCommand == "limsa_gc" )
|
||||||
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getZoneByTerritoryTypeId( 128 )->getGuId(), { 76.3952f, 40.0955f, 71.6461f }, 1.62673f );
|
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getTerritoryByTypeId( 128 )->getGuId(), { 76.3952f, 40.0955f, 71.6461f }, 1.62673f );
|
||||||
else if( subCommand == "carline_canopy" || subCommand == "gridania_adventurer" )
|
else if( subCommand == "carline_canopy" || subCommand == "gridania_adventurer" )
|
||||||
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getZoneByTerritoryTypeId( 132 )->getGuId(), { 43.729f, -7.96559f, 103.965f }, -1.59436f );
|
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getTerritoryByTypeId( 132 )->getGuId(), { 43.729f, -7.96559f, 103.965f }, -1.59436f );
|
||||||
else if( subCommand == "observatorium" )
|
else if( subCommand == "observatorium" )
|
||||||
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getZoneByTerritoryTypeId( 155 )->getGuId(), { 224.965f, 221.958f, 301.33f }, -0.0316129f );
|
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getTerritoryByTypeId( 155 )->getGuId(), { 224.965f, 221.958f, 301.33f }, -0.0316129f );
|
||||||
else if( subCommand == "rising_stones" )
|
else if( subCommand == "rising_stones" )
|
||||||
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getZoneByTerritoryTypeId( 156 )->getGuId(), { 22.7204f, 21.2639f, -635.704f }, -0.360031f );
|
warpMgr.requestMoveTerritory( player, Common::WarpType::WARP_TYPE_GM, terriMgr.getTerritoryByTypeId( 156 )->getGuId(), { 22.7204f, 21.2639f, -635.704f }, -0.360031f );
|
||||||
else
|
else
|
||||||
PlayerMgr::sendUrgent( player, "{0} is not a valid easyWarp location.", subCommand );
|
PlayerMgr::sendUrgent( player, "{0} is not a valid easyWarp location.", subCommand );
|
||||||
}
|
}
|
||||||
|
|
|
@ -477,7 +477,7 @@ TerritoryPtr TerritoryMgr::getTerritoryByGuId( uint32_t guId ) const
|
||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
TerritoryPtr TerritoryMgr::getZoneByTerritoryTypeId( uint32_t territoryTypeId ) const
|
TerritoryPtr TerritoryMgr::getTerritoryByTypeId( uint32_t territoryTypeId ) const
|
||||||
{
|
{
|
||||||
auto zoneMap = m_territoryTypeIdToInstanceGuidMap.find( territoryTypeId );
|
auto zoneMap = m_territoryTypeIdToInstanceGuidMap.find( territoryTypeId );
|
||||||
if( zoneMap == m_territoryTypeIdToInstanceGuidMap.end() )
|
if( zoneMap == m_territoryTypeIdToInstanceGuidMap.end() )
|
||||||
|
@ -677,7 +677,7 @@ bool TerritoryMgr::joinWorld( Entity::Player& player )
|
||||||
auto prevPos = player.getPrevPos();
|
auto prevPos = player.getPrevPos();
|
||||||
player.setPos( prevPos, false );
|
player.setPos( prevPos, false );
|
||||||
player.setRot( player.getPrevRot() );
|
player.setRot( player.getPrevRot() );
|
||||||
pCurrZone = getZoneByTerritoryTypeId( territoryTypeId );
|
pCurrZone = getTerritoryByTypeId( territoryTypeId );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( isInternalEstateTerritory( territoryTypeId ) )
|
else if( isInternalEstateTerritory( territoryTypeId ) )
|
||||||
|
@ -696,7 +696,7 @@ bool TerritoryMgr::joinWorld( Entity::Player& player )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pCurrZone = getZoneByTerritoryTypeId( territoryTypeId );
|
pCurrZone = getTerritoryByTypeId( territoryTypeId );
|
||||||
}
|
}
|
||||||
|
|
||||||
player.setTerritoryTypeId( territoryTypeId );
|
player.setTerritoryTypeId( territoryTypeId );
|
||||||
|
|
|
@ -135,7 +135,7 @@ namespace Sapphire::World::Manager
|
||||||
|
|
||||||
/*! returns a default Zone by territoryTypeId
|
/*! returns a default Zone by territoryTypeId
|
||||||
TODO: Mind multiple instances?! */
|
TODO: Mind multiple instances?! */
|
||||||
TerritoryPtr getZoneByTerritoryTypeId( uint32_t territoryTypeId ) const;
|
TerritoryPtr getTerritoryByTypeId( uint32_t territoryTypeId ) const;
|
||||||
|
|
||||||
bool movePlayer( Sapphire::Territory& teri, Entity::Player& player );
|
bool movePlayer( Sapphire::Territory& teri, Entity::Player& player );
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,20 @@ void WarpMgr::requestMoveTerritory( Entity::Player& player, Common::WarpType war
|
||||||
requestMoveTerritory( player, warpType, targetTerritoryId, player.getPos(), player.getRot() );
|
requestMoveTerritory( player, warpType, targetTerritoryId, player.getPos(), player.getRot() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WarpMgr::requestMoveTerritoryType( Entity::Player& player, Common::WarpType warpType, uint32_t targetTerritoryTypeId )
|
||||||
|
{
|
||||||
|
auto& teriMgr = Common::Service< TerritoryMgr >::ref();
|
||||||
|
|
||||||
|
auto pTeri = teriMgr.getTerritoryByTypeId( targetTerritoryTypeId );
|
||||||
|
if( !pTeri )
|
||||||
|
{
|
||||||
|
Logger::error( "Unable to find target territory instance for type {}", targetTerritoryTypeId );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
requestMoveTerritory( player, warpType, pTeri->getGuId() );
|
||||||
|
}
|
||||||
|
|
||||||
void WarpMgr::requestWarp( Entity::Player& player, Common::WarpType warpType, Common::FFXIVARR_POSITION3 targetPos, float targetRot )
|
void WarpMgr::requestWarp( Entity::Player& player, Common::WarpType warpType, Common::FFXIVARR_POSITION3 targetPos, float targetRot )
|
||||||
{
|
{
|
||||||
m_entityIdToWarpInfoMap[ player.getId() ] = { 0, warpType, targetPos, targetRot };
|
m_entityIdToWarpInfoMap[ player.getId() ] = { 0, warpType, targetPos, targetRot };
|
||||||
|
@ -176,7 +190,7 @@ void WarpMgr::requestPlayerTeleport( Entity::Player& player, uint16_t aetheryteI
|
||||||
requestWarp( player, warpType, pos, rot );
|
requestWarp( player, warpType, pos, rot );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto pTeri = teriMgr.getZoneByTerritoryTypeId( data.TerritoryType );
|
auto pTeri = teriMgr.getTerritoryByTypeId( data.TerritoryType );
|
||||||
if( !pTeri )
|
if( !pTeri )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace Sapphire::World::Manager
|
||||||
WarpMgr() = default;
|
WarpMgr() = default;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// request to move a player to specified territorytype and position, with given WarpType
|
/// request to move a player to specified territory guid and position, with given WarpType
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="player"></param>
|
/// <param name="player"></param>
|
||||||
/// <param name="warpType"></param>
|
/// <param name="warpType"></param>
|
||||||
|
@ -34,13 +34,21 @@ namespace Sapphire::World::Manager
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// request to move a player to specified territorytype with given WarpType, position will be the same as before
|
/// request to move a player to specified territory guid with given WarpType, position will be the same as before
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="player"></param>
|
/// <param name="player"></param>
|
||||||
/// <param name="warpType"></param>
|
/// <param name="warpType"></param>
|
||||||
/// <param name="targetTerritoryId"></param>
|
/// <param name="targetTerritoryId"></param>
|
||||||
void requestMoveTerritory( Entity::Player& player, Common::WarpType warpType, uint32_t targetTerritoryId );
|
void requestMoveTerritory( Entity::Player& player, Common::WarpType warpType, uint32_t targetTerritoryId );
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// request to move a player to specified territory type with given WarpType, position will be the same as before
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="player"></param>
|
||||||
|
/// <param name="warpType"></param>
|
||||||
|
/// <param name="targetTerritoryTypeId"></param>
|
||||||
|
void requestMoveTerritoryType( Entity::Player& player, Common::WarpType warpType, uint32_t targetTerritoryTypeId );
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// handle player state pre-warp and tells client to warp player
|
/// handle player state pre-warp and tells client to warp player
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -503,7 +503,7 @@ void Sapphire::Network::GameConnection::gmCommandHandler( const Packets::FFXIVAR
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto pZone = teriMgr.getZoneByTerritoryTypeId( param1 );
|
auto pZone = teriMgr.getTerritoryByTypeId( param1 );
|
||||||
if( !pZone )
|
if( !pZone )
|
||||||
{
|
{
|
||||||
PlayerMgr::sendUrgent( player, "No zone instance found for {0}", param1 );
|
PlayerMgr::sendUrgent( player, "No zone instance found for {0}", param1 );
|
||||||
|
@ -542,7 +542,7 @@ void Sapphire::Network::GameConnection::gmCommandHandler( const Packets::FFXIVAR
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto& warpMgr = Common::Service< WarpMgr >::ref();
|
auto& warpMgr = Common::Service< WarpMgr >::ref();
|
||||||
warpMgr.requestMoveTerritory( *targetPlayer, WarpType::WARP_TYPE_GM, teriMgr.getZoneByTerritoryTypeId( param1 )->getGuId(), targetPlayer->getPos(), 0 );
|
warpMgr.requestMoveTerritory( *targetPlayer, WarpType::WARP_TYPE_GM, teriMgr.getTerritoryByTypeId( param1 )->getGuId(), targetPlayer->getPos(), 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerMgr::sendServerNotice( player, "{0} was warped to zone {1}", targetPlayer->getName(), param1, pZone->getName() );
|
PlayerMgr::sendServerNotice( player, "{0} was warped to zone {1}", targetPlayer->getName(), param1, pZone->getName() );
|
||||||
|
|
|
@ -308,7 +308,7 @@ void Sapphire::Network::GameConnection::zoneJumpHandler( const Packets::FFXIVARR
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerMgr::sendDebug( player, "Walking ZoneLine#{0}", exitBoxId );
|
PlayerMgr::sendDebug( player, "Walking ZoneLine#{0}", exitBoxId );
|
||||||
auto pTargetTeri = teriMgr.getZoneByTerritoryTypeId( targetZone );
|
auto pTargetTeri = teriMgr.getTerritoryByTypeId( targetZone );
|
||||||
if( !pTargetTeri )
|
if( !pTargetTeri )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ void MoveTerritoryTask::execute()
|
||||||
// todo: this will require proper handling, for now just return the player to their previous area
|
// todo: this will require proper handling, for now just return the player to their previous area
|
||||||
pPlayer->setPos( pPlayer->getPrevPos(), false );
|
pPlayer->setPos( pPlayer->getPrevPos(), false );
|
||||||
|
|
||||||
auto pZone1 = teriMgr.getZoneByTerritoryTypeId( pPlayer->getPrevTerritoryTypeId() );
|
auto pZone1 = teriMgr.getTerritoryByTypeId( pPlayer->getPrevTerritoryTypeId() );
|
||||||
if( !teriMgr.movePlayer( *pZone1, *pPlayer ) )
|
if( !teriMgr.movePlayer( *pZone1, *pPlayer ) )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue