1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-25 11:07:45 +00:00

play proper scene depending on wedding settings and add some popup message

This commit is contained in:
collett 2021-08-15 20:39:37 +09:00
parent 419c7cdfca
commit d0e2de1abf
16 changed files with 228 additions and 85 deletions

View file

@ -1449,8 +1449,8 @@ namespace Sapphire::Network::Packets::Server
uint32_t param3; uint32_t param3;
uint8_t paramSize; uint8_t paramSize;
uint8_t padding1[3]; uint8_t padding1[3];
uint32_t param5;
uint32_t param[16]; uint32_t param[16];
uint32_t padding2;
}; };
template< int ArgCount > template< int ArgCount >
@ -1849,7 +1849,7 @@ namespace Sapphire::Network::Packets::Server
uint32_t bNPCName; uint32_t bNPCName;
uint32_t textId; uint32_t textId;
uint32_t popupTimeMs; uint32_t popupTimeMs;
uint32_t pad3[4]; uint32_t param[6];
}; };
@ -2270,7 +2270,7 @@ namespace Sapphire::Network::Packets::Server
struct FFXIVCeremonySetActorAppearance : FFXIVIpcBasePacket< CeremonySetActorAppearance > struct FFXIVCeremonySetActorAppearance : FFXIVIpcBasePacket< CeremonySetActorAppearance >
{ {
uint8_t u1; uint8_t u1;
uint8_t u2; uint8_t questBL;
uint16_t padding1; uint16_t padding1;
uint32_t u3; uint32_t u3;
struct struct

View file

@ -19,7 +19,7 @@ public:
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {
player.eventFinish( getId(), 1 ); player.eventFinish( getId(), 1 );
player.setPosAndSendActorMove( 24.7, 20.1, -679.2, 0.82 ); player.setPosAndNotifyClient( 24.7, 20.1, -679.2, 0.82 );
} }
}; };

View file

@ -19,7 +19,7 @@ public:
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {
player.eventFinish( getId(), 1 ); player.eventFinish( getId(), 1 );
player.setPosAndSendActorMove( 0, -2, -31, 3.1415 ); player.setPosAndNotifyClient( 0, -2, -31, 3.1415 );
} }
}; };

View file

@ -19,7 +19,7 @@ public:
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {
player.eventFinish( getId(), 1 ); player.eventFinish( getId(), 1 );
player.setPosAndSendActorMove( 0, -2, -23, 0 ); player.setPosAndNotifyClient( 0, -2, -23, 0 );
} }
}; };

View file

@ -19,7 +19,7 @@ public:
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {
player.eventFinish( getId(), 1 ); player.eventFinish( getId(), 1 );
player.setPosAndSendActorMove( 565, -1.7, -253, -0.83 ); player.setPosAndNotifyClient( 565, -1.7, -253, -0.83 );
} }
}; };

View file

@ -19,7 +19,7 @@ public:
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {
player.eventFinish( getId(), 1 ); player.eventFinish( getId(), 1 );
player.setPosAndSendActorMove( 574, -1.9, -264, 2.62 ); player.setPosAndNotifyClient( 574, -1.9, -264, 2.62 );
} }
}; };

View file

@ -19,7 +19,7 @@ public:
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {
player.eventFinish( getId(), 1 ); player.eventFinish( getId(), 1 );
player.setPosAndSendActorMove( 676, 60, 465, 0 ); player.setPosAndNotifyClient( 676, 60, 465, 0 );
} }
}; };

View file

@ -19,7 +19,7 @@ public:
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {
player.eventFinish( getId(), 1 ); player.eventFinish( getId(), 1 );
player.setPosAndSendActorMove( -466, 107.7, 107.7, -2 ); player.setPosAndNotifyClient( -466, 107.7, 107.7, -2 );
} }
}; };

View file

@ -19,6 +19,23 @@ class SanctumOfTheTwelve : public Sapphire::ScriptAPI::PublicContentScript
public: public:
SanctumOfTheTwelve() : Sapphire::ScriptAPI::PublicContentScript( 1 ) { } SanctumOfTheTwelve() : Sapphire::ScriptAPI::PublicContentScript( 1 ) { }
/*
Custom var usage:
0: current time
1: main actor 1 id
2: main actor 2 id
3: seq 3 start time
4: seq 3 internal sequence
5: seq 3 remaining unfinished player count
6: seq 4 internal sequence
101: questBL
102: questBH
103: questCL
104: questCH
105: questDL
106: questDH
*/
void onInit( PublicContent& instance ) override void onInit( PublicContent& instance ) override
{ {
auto exitHandler = [ & ]( Entity::Player& player, Entity::EventObjectPtr eobj, TerritoryPtr terri, uint32_t eventId, uint64_t actorId ) auto exitHandler = [ & ]( Entity::Player& player, Entity::EventObjectPtr eobj, TerritoryPtr terri, uint32_t eventId, uint64_t actorId )
@ -49,57 +66,23 @@ public:
auto p2 = instance.getPlayer( v2 ); auto p2 = instance.getPlayer( v2 );
if( p1 && p2 ) if( p1 && p2 )
{ {
//skip seq 2, 3 for now auto seq1Callback = [ & ]( Entity::Player& player, const Event::SceneResult& result )
instance.setSequence( 4 );
p1->eventFinish( eventId, 1 );
FFXIVCeremonySetActorAppearance packetData = {};
packetData.u1 = 1;
packetData.u2 = 1;
if( !( p1->getEquipDisplayFlags() & Sapphire::Common::EquipDisplayFlags::HideWeapon ) )
{ {
packetData.actors[0].mainWeaponModel = p1->getModelMainWeapon(); if( result.param1 != 512 || result.param2 != 0 )
packetData.actors[0].secWeaponModel = p1->getModelSubWeapon(); return;
} instance.setCustomVar( 3, 0 );
packetData.actors[0].charId = p1->getId(); instance.setCustomVar( 4, 0 );
packetData.actors[0].guardianDeity = p1->getGuardianDeity(); //skip 2 for now
packetData.actors[0].models[ Common::GearModelSlot::ModelHead ] = p1->getModelForSlot( Common::GearModelSlot::ModelHead ); instance.setSequence( 3 );
packetData.actors[0].models[ Common::GearModelSlot::ModelBody ] = p1->getModelForSlot( Common::GearModelSlot::ModelBody ); instance.foreachPlayer( [ &instance ]( auto p )
packetData.actors[0].models[ Common::GearModelSlot::ModelHands ] = p1->getModelForSlot( Common::GearModelSlot::ModelHands ); {
packetData.actors[0].models[ Common::GearModelSlot::ModelLegs ] = p1->getModelForSlot( Common::GearModelSlot::ModelLegs ); p->queuePacket( makeActorControlSelf( p->getId(), DirectorUpdate, instance.getDirectorId(), 0x80000001, 1 ) );
packetData.actors[0].models[ Common::GearModelSlot::ModelFeet ] = p1->getModelForSlot( Common::GearModelSlot::ModelFeet ); });
packetData.actors[0].models[ Common::GearModelSlot::ModelNeck ] = p1->getModelForSlot( Common::GearModelSlot::ModelNeck ); };
packetData.actors[0].models[ Common::GearModelSlot::ModelEar ] = p1->getModelForSlot( Common::GearModelSlot::ModelEar ); // event item workaround
packetData.actors[0].models[ Common::GearModelSlot::ModelRing1 ] = p1->getModelForSlot( Common::GearModelSlot::ModelRing1 ); player.eventFinish( eventId, 1 );
packetData.actors[0].models[ Common::GearModelSlot::ModelRing2 ] = p1->getModelForSlot( Common::GearModelSlot::ModelRing2 ); player.eventStart( player.getId(), instance.getDirectorId(), Event::EventHandler::Item, 0, 2001464 );
packetData.actors[0].models[ Common::GearModelSlot::ModelWrist ] = p1->getModelForSlot( Common::GearModelSlot::ModelWrist ); player.playScene( instance.getDirectorId(), 32, 134225921, 0, 1, 1077, seq1Callback );
memcpy( packetData.actors[0].look, p1->getLookArray(), sizeof( packetData.actors[0].look ) );
if( !( p2->getEquipDisplayFlags() & Sapphire::Common::EquipDisplayFlags::HideWeapon ) )
{
packetData.actors[1].mainWeaponModel = p2->getModelMainWeapon();
packetData.actors[1].secWeaponModel = p2->getModelSubWeapon();
}
packetData.actors[1].charId = p2->getId();
packetData.actors[1].guardianDeity = p2->getGuardianDeity();
packetData.actors[1].models[ Common::GearModelSlot::ModelHead ] = p2->getModelForSlot( Common::GearModelSlot::ModelHead );
packetData.actors[1].models[ Common::GearModelSlot::ModelBody ] = p2->getModelForSlot( Common::GearModelSlot::ModelBody );
packetData.actors[1].models[ Common::GearModelSlot::ModelHands ] = p2->getModelForSlot( Common::GearModelSlot::ModelHands );
packetData.actors[1].models[ Common::GearModelSlot::ModelLegs ] = p2->getModelForSlot( Common::GearModelSlot::ModelLegs );
packetData.actors[1].models[ Common::GearModelSlot::ModelFeet ] = p2->getModelForSlot( Common::GearModelSlot::ModelFeet );
packetData.actors[1].models[ Common::GearModelSlot::ModelNeck ] = p2->getModelForSlot( Common::GearModelSlot::ModelNeck );
packetData.actors[1].models[ Common::GearModelSlot::ModelEar ] = p2->getModelForSlot( Common::GearModelSlot::ModelEar );
packetData.actors[1].models[ Common::GearModelSlot::ModelRing1 ] = p2->getModelForSlot( Common::GearModelSlot::ModelRing1 );
packetData.actors[1].models[ Common::GearModelSlot::ModelRing2 ] = p2->getModelForSlot( Common::GearModelSlot::ModelRing2 );
packetData.actors[1].models[ Common::GearModelSlot::ModelWrist ] = p2->getModelForSlot( Common::GearModelSlot::ModelWrist );
memcpy( packetData.actors[1].look, p2->getLookArray(), sizeof( packetData.actors[1].look ) );
instance.foreachPlayer( [ &instance, &packetData ]( auto p )
{
auto packet = makeZonePacket< FFXIVCeremonySetActorAppearance >( p->getId() );
memcpy( &packet->data(), &packetData, sizeof( packetData ) );
p->queuePacket( packet );
p->eventStart( p->getId(), instance.getDirectorId(), Event::EventHandler::EnterTerritory, 1, p->getZoneId() );
p->directorPlayScene( instance.getDirectorId(), 3, 9219, 0, 1, 50000 );
});
} }
else else
{ {
@ -138,7 +121,145 @@ public:
void onUpdate( PublicContent& instance, uint64_t tickCount ) override void onUpdate( PublicContent& instance, uint64_t tickCount ) override
{ {
switch( instance.getSequence() )
{
case 3:
{
if( instance.getCustomVar( 3 ) == 0 )
instance.setCustomVar( 3, tickCount );
auto dt = std::difftime( tickCount, instance.getCustomVar( 3 ) ) / 1000.f;
auto v4 = instance.getCustomVar( 4 );
switch( v4 )
{
case 0:
case 1:
case 2:
{
if( dt >= 1 + v4 * 6 )
{
instance.setCustomVar( 4, v4 + 1 );
FFXIVIpcDirectorPopUp packetData = {};
packetData.directorId = instance.getDirectorId();
packetData.flags = 3;
packetData.bNPCName = 1010505;
packetData.textId = v4 == 0 ? 1088 : ( v4 == 1 ? 1006 : 1007 );
packetData.popupTimeMs = 6000;
packetData.param[ 0 ] = 1024;
packetData.param[ 1 ] = instance.getCustomVar( 1 );
packetData.param[ 2 ] = instance.getCustomVar( 2 );
instance.foreachPlayer( [ &instance, &packetData ]( auto p )
{
auto packet = makeZonePacket< FFXIVIpcDirectorPopUp >( p->getId() );
memcpy( &packet->data(), &packetData, sizeof( packetData ) );
p->queuePacket( packet );
});
}
break;
}
case 3:
{
if( dt < 20 )
return;
instance.setCustomVar( 4, 255 );
auto p1 = instance.getPlayer( instance.getCustomVar( 1 ) );
auto p2 = instance.getPlayer( instance.getCustomVar( 2 ) );
if( !p1 || !p2 )
{
instance.setSequence( 1 );
instance.foreachPlayer( [ &instance ]( auto p )
{
p->sendUrgent( "Failed to start the scene, missing main actors." );
});
return;
}
FFXIVCeremonySetActorAppearance packetData = {};
auto qBL = instance.getCustomVar( 101 );
packetData.questBL = qBL;
packetData.u1 = 1;
if( !( p1->getEquipDisplayFlags() & Sapphire::Common::EquipDisplayFlags::HideWeapon ) )
{
packetData.actors[0].mainWeaponModel = p1->getModelMainWeapon();
packetData.actors[0].secWeaponModel = p1->getModelSubWeapon();
}
packetData.actors[0].charId = p1->getId();
packetData.actors[0].guardianDeity = p1->getGuardianDeity();
packetData.actors[0].models[ Common::GearModelSlot::ModelHead ] = p1->getModelForSlot( Common::GearModelSlot::ModelHead );
packetData.actors[0].models[ Common::GearModelSlot::ModelBody ] = p1->getModelForSlot( Common::GearModelSlot::ModelBody );
packetData.actors[0].models[ Common::GearModelSlot::ModelHands ] = p1->getModelForSlot( Common::GearModelSlot::ModelHands );
packetData.actors[0].models[ Common::GearModelSlot::ModelLegs ] = p1->getModelForSlot( Common::GearModelSlot::ModelLegs );
packetData.actors[0].models[ Common::GearModelSlot::ModelFeet ] = p1->getModelForSlot( Common::GearModelSlot::ModelFeet );
packetData.actors[0].models[ Common::GearModelSlot::ModelNeck ] = p1->getModelForSlot( Common::GearModelSlot::ModelNeck );
packetData.actors[0].models[ Common::GearModelSlot::ModelEar ] = p1->getModelForSlot( Common::GearModelSlot::ModelEar );
packetData.actors[0].models[ Common::GearModelSlot::ModelRing1 ] = p1->getModelForSlot( Common::GearModelSlot::ModelRing1 );
packetData.actors[0].models[ Common::GearModelSlot::ModelRing2 ] = p1->getModelForSlot( Common::GearModelSlot::ModelRing2 );
packetData.actors[0].models[ Common::GearModelSlot::ModelWrist ] = p1->getModelForSlot( Common::GearModelSlot::ModelWrist );
memcpy( packetData.actors[0].look, p1->getLookArray(), sizeof( packetData.actors[0].look ) );
if( !( p2->getEquipDisplayFlags() & Sapphire::Common::EquipDisplayFlags::HideWeapon ) )
{
packetData.actors[1].mainWeaponModel = p2->getModelMainWeapon();
packetData.actors[1].secWeaponModel = p2->getModelSubWeapon();
}
packetData.actors[1].charId = p2->getId();
packetData.actors[1].guardianDeity = p2->getGuardianDeity();
packetData.actors[1].models[ Common::GearModelSlot::ModelHead ] = p2->getModelForSlot( Common::GearModelSlot::ModelHead );
packetData.actors[1].models[ Common::GearModelSlot::ModelBody ] = p2->getModelForSlot( Common::GearModelSlot::ModelBody );
packetData.actors[1].models[ Common::GearModelSlot::ModelHands ] = p2->getModelForSlot( Common::GearModelSlot::ModelHands );
packetData.actors[1].models[ Common::GearModelSlot::ModelLegs ] = p2->getModelForSlot( Common::GearModelSlot::ModelLegs );
packetData.actors[1].models[ Common::GearModelSlot::ModelFeet ] = p2->getModelForSlot( Common::GearModelSlot::ModelFeet );
packetData.actors[1].models[ Common::GearModelSlot::ModelNeck ] = p2->getModelForSlot( Common::GearModelSlot::ModelNeck );
packetData.actors[1].models[ Common::GearModelSlot::ModelEar ] = p2->getModelForSlot( Common::GearModelSlot::ModelEar );
packetData.actors[1].models[ Common::GearModelSlot::ModelRing1 ] = p2->getModelForSlot( Common::GearModelSlot::ModelRing1 );
packetData.actors[1].models[ Common::GearModelSlot::ModelRing2 ] = p2->getModelForSlot( Common::GearModelSlot::ModelRing2 );
packetData.actors[1].models[ Common::GearModelSlot::ModelWrist ] = p2->getModelForSlot( Common::GearModelSlot::ModelWrist );
memcpy( packetData.actors[1].look, p2->getLookArray(), sizeof( packetData.actors[1].look ) );
instance.foreachPlayer( [ &instance, &packetData, qBL ]( auto p )
{
auto packet = makeZonePacket< FFXIVCeremonySetActorAppearance >( p->getId() );
memcpy( &packet->data(), &packetData, sizeof( packetData ) );
p->queuePacket( packet );
p->eventStart( p->getId(), instance.getDirectorId(), Event::EventHandler::GameProgress, 1, 1 );
std::vector< uint32_t > paramList;
paramList.push_back( qBL < 2 ? 664 : 665 );
auto seq3Callback = [ & ]( Entity::Player& player, const Event::SceneResult& result )
{
//keep everyone in their room for now
/*
if( player.getId() == instance.getCustomVar( 1 ) )
{
player.setPosAndNotifyClient( 1.454, 3.12581, -132.7992, -3.14 );
}
else if( player.getId() == instance.getCustomVar( 2 ) )
{
player.setPosAndNotifyClient( -1.454, 3.12581, -132.7992, -3.14 );
}
else
{
player.setPosAndNotifyClient( 0, 2.64, -119, -3.14 );
}
*/
auto v5 = instance.getCustomVar( 5 );
v5--;
instance.setCustomVar( 5, v5 );
if( v5 == 0 )
{
player.sendDebug( "all players finished scene" );
}
};
p->playScene16( instance.getDirectorId(), 3, 9219, 0, paramList, seq3Callback );
});
instance.setCustomVar( 5, instance.getPopCount() );
instance.setCustomVar( 6, 0 );
instance.setSequence( 4 );
break;
}
}
}
break;
}
instance.setCustomVar( 0, tickCount );
} }
void onPlayerZoneIn( PublicContent& instance, Entity::Player& player ) override void onPlayerZoneIn( PublicContent& instance, Entity::Player& player ) override
@ -154,10 +275,12 @@ public:
instance.setDirectorUI8DL( player.getGuardianDeity() ); instance.setDirectorUI8DL( player.getGuardianDeity() );
instance.setDirectorUI8EL( player.getQuestUI8FH( 67114 ) ); instance.setDirectorUI8EL( player.getQuestUI8FH( 67114 ) );
instance.setDirectorUI8FL( player.getQuestUI8FL( 67114 ) ); instance.setDirectorUI8FL( player.getQuestUI8FL( 67114 ) );
instance.setDirectorUI8GL( 1 ); instance.setCustomVar( 101, player.getQuestUI8BL( 67114 ) );
instance.setDirectorUI8HL( 1 ); instance.setCustomVar( 102, player.getQuestUI8BH( 67114 ) );
instance.setDirectorUI8IL( 1 ); instance.setCustomVar( 103, player.getQuestUI8CL( 67114 ) );
instance.setDirectorUI8JL( 1 ); instance.setCustomVar( 104, player.getQuestUI8CH( 67114 ) );
instance.setCustomVar( 105, player.getQuestUI8DL( 67114 ) );
instance.setCustomVar( 106, player.getQuestUI8DH( 67114 ) );
} }
} }
else if( instance.getCustomVar( 2 ) == 0 || instance.getCustomVar( 2 ) == player.getId() ) else if( instance.getCustomVar( 2 ) == 0 || instance.getCustomVar( 2 ) == player.getId() )
@ -188,17 +311,17 @@ public:
auto callback = [ & ]( Entity::Player& player, const Event::SceneResult& result ) auto callback = [ & ]( Entity::Player& player, const Event::SceneResult& result )
{ {
}; };
if( instance.getCustomVar( 1 ) == player.getId() ) if( instance.getCustomVar( 1 ) == player.getId() && instance.getSequence() == 1 )
{ {
player.setPosAndSendActorMove( 0, 500, -50, -3.14f ); player.setPosAndNotifyClient( 0, 500, -50, -3.14f );
} }
else if( instance.getCustomVar( 2 ) == player.getId() ) else if( instance.getCustomVar( 2 ) == player.getId() && instance.getSequence() == 1 )
{ {
player.setPosAndSendActorMove( 0, 250, -50, -3.14f ); player.setPosAndNotifyClient( 0, 250, -50, -3.14f );
} }
else else
{ {
player.setPosAndSendActorMove( 0, 750, -50, -3.14f ); player.setPosAndNotifyClient( 0, 750, -50, -3.14f );
} }
//player.queuePacket( makeActorControlSelf( getId(), DirectorUpdate, instance.getDirectorId(), 0x80000003, 1200 ) ); // timer //player.queuePacket( makeActorControlSelf( getId(), DirectorUpdate, instance.getDirectorId(), 0x80000003, 1200 ) ); // timer
player.playScene( instance.getDirectorId(), 1, HIDE_HOTBAR, 0, 2, 4, callback ); player.playScene( instance.getDirectorId(), 1, HIDE_HOTBAR, 0, 2, 4, callback );

View file

@ -1407,8 +1407,9 @@ private:
} }
}; };
std::vector< uint32_t > list; std::vector< uint32_t > list;
list.push_back( 0 );
list.push_back( std::time( 0 ) ); list.push_back( std::time( 0 ) );
player.playScene16( getId(), 70, HIDE_HOTBAR, 0, 0, list, callback ); player.playScene16( getId(), 70, HIDE_HOTBAR, 0, list, callback );
} }
void Scene00071( Entity::Player& player ) void Scene00071( Entity::Player& player )

View file

@ -1925,6 +1925,8 @@ void Sapphire::Entity::Player::sendZonePackets()
// if( getLastPing() == 0 ) // if( getLastPing() == 0 )
// sendQuestInfo(); // sendQuestInfo();
sendPartyList();
m_bMarkedForZoning = false; m_bMarkedForZoning = false;
} }
@ -2536,7 +2538,7 @@ uint8_t Sapphire::Entity::Player::getPartySize()
return 0; return 0;
} }
void Sapphire::Entity::Player::sendPartyListToParty() void Sapphire::Entity::Player::sendPartyListToParty( PlayerPtr filter )
{ {
assert( isPartyLeader() ); assert( isPartyLeader() );
FFXIVIpcPartyList partyList = {}; FFXIVIpcPartyList partyList = {};
@ -2571,9 +2573,25 @@ void Sapphire::Entity::Player::sendPartyListToParty()
for( auto member : m_partyMemberList ) for( auto member : m_partyMemberList )
{ {
auto packet = makeZonePacket< FFXIVIpcPartyList >( member->getId() ); if( !filter || member->getId() == filter->getId() )
memcpy( &packet->data().member[ 0 ], &partyList, sizeof( partyList ) ); {
member->queuePacket( packet ); auto packet = makeZonePacket< FFXIVIpcPartyList >( member->getId() );
memcpy( &packet->data().member[ 0 ], &partyList, sizeof( partyList ) );
member->queuePacket( packet );
}
}
}
void Sapphire::Entity::Player::sendPartyList()
{
if( !isInParty() )
{
auto packet = makeZonePacket< FFXIVIpcPartyList >( getId() );
queuePacket( packet );
}
else
{
getPartyLeader()->sendPartyListToParty( getAsPlayer() );
} }
} }
@ -2821,7 +2839,7 @@ bool Sapphire::Entity::Player::gaugeSamHasAnySen()
return static_cast< uint8_t >( m_gauge.sam.sen ) > 0; return static_cast< uint8_t >( m_gauge.sam.sen ) > 0;
} }
void Sapphire::Entity::Player::setPosAndSendActorMove( float x, float y, float z, float rot ) void Sapphire::Entity::Player::setPosAndNotifyClient( float x, float y, float z, float rot )
{ {
setRot( rot ); setRot( rot );
setPos( x, y, z, true ); setPos( x, y, z, true );

View file

@ -111,7 +111,7 @@ namespace Sapphire::Entity
void playSceneChain( uint32_t eventId, uint32_t scene, uint32_t flags, void playSceneChain( uint32_t eventId, uint32_t scene, uint32_t flags,
Event::EventHandler::SceneChainCallback sceneChainCallback ); Event::EventHandler::SceneChainCallback sceneChainCallback );
void playScene16( uint32_t eventId, uint32_t scene, uint32_t flags, uint32_t param3, uint32_t param5, std::vector< uint32_t > paramList, Event::EventHandler::SceneReturnCallback eventReturnCallback ); void playScene16( uint32_t eventId, uint32_t scene, uint32_t flags, uint32_t param3, std::vector< uint32_t > paramList, Event::EventHandler::SceneReturnCallback eventReturnCallback );
/*! setup the event and return a ptr to it */ /*! setup the event and return a ptr to it */
Event::EventHandlerPtr bootstrapSceneEvent( uint32_t eventId, uint32_t flags ); Event::EventHandlerPtr bootstrapSceneEvent( uint32_t eventId, uint32_t flags );
@ -1033,7 +1033,8 @@ namespace Sapphire::Entity
PlayerPtr m_partyInvitationSender; PlayerPtr m_partyInvitationSender;
std::vector< PlayerPtr > m_partyMemberList; std::vector< PlayerPtr > m_partyMemberList;
void clearPartyList(); void clearPartyList();
void sendPartyListToParty(); void sendPartyListToParty( PlayerPtr filter = nullptr );
void sendPartyList();
public: public:
bool isPartyLeader(); bool isPartyLeader();
bool isInParty(); bool isInParty();
@ -1049,7 +1050,7 @@ namespace Sapphire::Entity
void foreachPartyMember( std::function< void( PlayerPtr member ) > callback); void foreachPartyMember( std::function< void( PlayerPtr member ) > callback);
////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////
void setPosAndSendActorMove( float x, float y, float z, float rot ); void setPosAndNotifyClient( float x, float y, float z, float rot );
std::unordered_map< uint32_t, TerritoryPtr > m_privateInstanceMap; std::unordered_map< uint32_t, TerritoryPtr > m_privateInstanceMap;
TerritoryPtr getOrCreatePrivateInstance( uint32_t zoneId ); TerritoryPtr getOrCreatePrivateInstance( uint32_t zoneId );
bool enterPredefinedPrivateInstance( uint32_t zoneId ); bool enterPredefinedPrivateInstance( uint32_t zoneId );

View file

@ -323,7 +323,7 @@ void Sapphire::Entity::Player::eventFinish( uint32_t eventId, uint32_t freePlaye
unsetStateFlag( PlayerStateFlag::InNpcEvent ); unsetStateFlag( PlayerStateFlag::InNpcEvent );
} }
void Sapphire::Entity::Player::playScene16( uint32_t eventId, uint32_t scene, uint32_t flags, uint32_t param3, uint32_t param5, std::vector< uint32_t > paramList, Event::EventHandler::SceneReturnCallback eventReturnCallback ) void Sapphire::Entity::Player::playScene16( uint32_t eventId, uint32_t scene, uint32_t flags, uint32_t param3, std::vector< uint32_t > paramList, Event::EventHandler::SceneReturnCallback eventReturnCallback )
{ {
auto pEvent = bootstrapSceneEvent( eventId, flags ); auto pEvent = bootstrapSceneEvent( eventId, flags );
if( !pEvent ) if( !pEvent )
@ -338,7 +338,6 @@ void Sapphire::Entity::Player::playScene16( uint32_t eventId, uint32_t scene, ui
eventPlay16->data().scene = scene; eventPlay16->data().scene = scene;
eventPlay16->data().flags = flags; eventPlay16->data().flags = flags;
eventPlay16->data().param3 = param3; eventPlay16->data().param3 = param3;
eventPlay16->data().param5 = param5;
eventPlay16->data().paramSize = paramList.size(); eventPlay16->data().paramSize = paramList.size();
int i = 0; int i = 0;
for( auto p : paramList ) for( auto p : paramList )

View file

@ -198,12 +198,12 @@ void Sapphire::Event::Director::setDirectorSequence( uint8_t value )
m_sequence = value; m_sequence = value;
} }
void Sapphire::Event::Director::setCustomVar( uint32_t varId, uint32_t value ) void Sapphire::Event::Director::setCustomVar( uint32_t varId, uint64_t value )
{ {
m_customVarMap[ varId ] = value; m_customVarMap[ varId ] = value;
} }
uint32_t Sapphire::Event::Director::getCustomVar( uint32_t varId ) uint64_t Sapphire::Event::Director::getCustomVar( uint32_t varId )
{ {
auto it = m_customVarMap.find( varId ); auto it = m_customVarMap.find( varId );
if( it != m_customVarMap.end() ) if( it != m_customVarMap.end() )

View file

@ -106,8 +106,8 @@ namespace Sapphire::Event
void setDirectorBranch( uint8_t value ); void setDirectorBranch( uint8_t value );
void setCustomVar( uint32_t varId, uint32_t value ); void setCustomVar( uint32_t varId, uint64_t value );
uint32_t getCustomVar( uint32_t varId ); uint64_t getCustomVar( uint32_t varId );
private: private:
/*! Id of the content of the director */ /*! Id of the content of the director */
@ -187,7 +187,7 @@ namespace Sapphire::Event
uint32_t m_elapsedTime; uint32_t m_elapsedTime;
std::unordered_map< uint32_t, uint32_t > m_customVarMap; std::unordered_map< uint32_t, uint64_t > m_customVarMap;
}; };

View file

@ -84,6 +84,7 @@ void Sapphire::PublicContent::onLeaveTerritory( Entity::Player& player )
void Sapphire::PublicContent::onUpdate( uint64_t tickCount ) void Sapphire::PublicContent::onUpdate( uint64_t tickCount )
{ {
updateBNpcs( tickCount );
auto& scriptMgr = Common::Service< Scripting::ScriptMgr >::ref(); auto& scriptMgr = Common::Service< Scripting::ScriptMgr >::ref();
scriptMgr.onPublicContentUpdate( getAsPublicContent(), tickCount ); scriptMgr.onPublicContentUpdate( getAsPublicContent(), tickCount );
} }