mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 07:07:45 +00:00
refactor minion to companion and add companion spawning
This commit is contained in:
parent
b29311a36b
commit
252998c194
6 changed files with 35 additions and 4 deletions
|
@ -122,9 +122,9 @@ enum ActorControlType : uint16_t
|
||||||
ActorFadeOut = 0x10A,
|
ActorFadeOut = 0x10A,
|
||||||
ActorFadeIn = 0x10B,
|
ActorFadeIn = 0x10B,
|
||||||
WithdrawMsg = 0x10C,
|
WithdrawMsg = 0x10C,
|
||||||
OrderMinion = 0x10D,
|
OrderCompanion = 0x10D,
|
||||||
ToggleMinion = 0x10E,
|
ToggleCompanion = 0x10E,
|
||||||
LearnMinion = 0x10F,
|
LearnCompanion = 0x10F,
|
||||||
ActorFateOut1 = 0x110,
|
ActorFateOut1 = 0x110,
|
||||||
|
|
||||||
Emote = 0x122,
|
Emote = 0x122,
|
||||||
|
@ -278,7 +278,7 @@ enum ActorControlType : uint16_t
|
||||||
ChangeTarget = 0x03,
|
ChangeTarget = 0x03,
|
||||||
|
|
||||||
DismountReq = 0x65,
|
DismountReq = 0x65,
|
||||||
|
SpawnCompanionReq = 0x66,
|
||||||
RemoveStatusEffect = 0x68,
|
RemoveStatusEffect = 0x68,
|
||||||
CastCancel = 0x69,
|
CastCancel = 0x69,
|
||||||
|
|
||||||
|
|
|
@ -1504,6 +1504,24 @@ void Sapphire::Entity::Player::dismount()
|
||||||
m_mount = 0;
|
m_mount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Sapphire::Entity::Player::spawnCompanion( uint16_t id )
|
||||||
|
{
|
||||||
|
auto exdData = m_pFw->get< Data::ExdDataGenerated >();
|
||||||
|
assert( exdData );
|
||||||
|
|
||||||
|
auto companion = exdData->get< Data::Companion >( id );
|
||||||
|
if( !id )
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_companionId = id;
|
||||||
|
sendToInRangeSet( makeActorControl142( getId(), ActorControlType::ToggleCompanion, id ), true );
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t Sapphire::Entity::Player::getCurrentCompanion() const
|
||||||
|
{
|
||||||
|
return m_companionId;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t Sapphire::Entity::Player::getCurrentMount() const
|
uint8_t Sapphire::Entity::Player::getCurrentMount() const
|
||||||
{
|
{
|
||||||
return m_mount;
|
return m_mount;
|
||||||
|
|
|
@ -565,6 +565,11 @@ namespace Sapphire::Entity
|
||||||
/*! dismount the current mount and send the packets */
|
/*! dismount the current mount and send the packets */
|
||||||
void dismount();
|
void dismount();
|
||||||
|
|
||||||
|
void spawnCompanion( uint16_t id );
|
||||||
|
void despawnCompanion();
|
||||||
|
|
||||||
|
uint16_t getCurrentCompanion() const;
|
||||||
|
|
||||||
/*! get the current mount */
|
/*! get the current mount */
|
||||||
uint8_t getCurrentMount() const;
|
uint8_t getCurrentMount() const;
|
||||||
|
|
||||||
|
@ -1076,6 +1081,7 @@ namespace Sapphire::Entity
|
||||||
// content finder info
|
// content finder info
|
||||||
uint32_t m_cfPenaltyUntil; // unix time
|
uint32_t m_cfPenaltyUntil; // unix time
|
||||||
|
|
||||||
|
uint16_t m_companionId;
|
||||||
uint32_t m_mount;
|
uint32_t m_mount;
|
||||||
uint32_t m_emoteMode;
|
uint32_t m_emoteMode;
|
||||||
|
|
||||||
|
|
|
@ -126,6 +126,11 @@ void Sapphire::Network::GameConnection::clientTriggerHandler( FrameworkPtr pFw,
|
||||||
player.dismount();
|
player.dismount();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ClientTriggerType::SpawnCompanionReq:
|
||||||
|
{
|
||||||
|
player.spawnCompanion( param1 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
case ClientTriggerType::RemoveStatusEffect: // Remove status (clicking it off)
|
case ClientTriggerType::RemoveStatusEffect: // Remove status (clicking it off)
|
||||||
{
|
{
|
||||||
// todo: check if status can be removed by client from exd
|
// todo: check if status can be removed by client from exd
|
||||||
|
|
|
@ -84,6 +84,7 @@ namespace Sapphire::Network::Packets::Server
|
||||||
memset( m_data.unlockedPvp, 0xFF, sizeof( m_data.unlockedPvp ) );
|
memset( m_data.unlockedPvp, 0xFF, sizeof( m_data.unlockedPvp ) );
|
||||||
memset( m_data.unlockedRaids, 0xFF, sizeof( m_data.unlockedRaids ) );
|
memset( m_data.unlockedRaids, 0xFF, sizeof( m_data.unlockedRaids ) );
|
||||||
memset( m_data.unlockedTrials, 0xFF, sizeof( m_data.unlockedTrials ) );
|
memset( m_data.unlockedTrials, 0xFF, sizeof( m_data.unlockedTrials ) );
|
||||||
|
memset( m_data.minions, 0xFF, sizeof( m_data.minions ) );
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -71,6 +71,7 @@ namespace Sapphire::Network::Packets::Server
|
||||||
m_data.title = player.getTitle();
|
m_data.title = player.getTitle();
|
||||||
m_data.voice = player.getVoiceId();
|
m_data.voice = player.getVoiceId();
|
||||||
m_data.currentMount = player.getCurrentMount();
|
m_data.currentMount = player.getCurrentMount();
|
||||||
|
m_data.activeMinion = player.getCurrentCompanion();
|
||||||
|
|
||||||
m_data.onlineStatus = static_cast< uint8_t >( player.getOnlineStatus() );
|
m_data.onlineStatus = static_cast< uint8_t >( player.getOnlineStatus() );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue