1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-25 14:07:46 +00:00

Merge pull request #121 from itsMaru/master

Player title prototype; Fix a few small issues;
This commit is contained in:
Mordred 2017-10-05 08:13:23 +02:00 committed by GitHub
commit 4fed5b76ba
8 changed files with 35 additions and 8 deletions

View file

@ -368,8 +368,8 @@ struct FFXIVIpcPlayerSpawn : FFXIVIpcBasePacket<PlayerSpawn>
uint32_t u20;
uint32_t ownerId;
uint32_t u22;
uint32_t hPCurr;
uint32_t hPMax;
uint32_t hPCurr;
uint32_t displayFlags;
uint16_t fateID;
uint16_t mPCurr;

View file

@ -92,7 +92,11 @@ void Core::Action::ActionCast::onInterrupt()
m_pSource->getAsPlayer()->sendStateFlags();
auto control = ActorControlPacket142( m_pSource->getId(), ActorControlType::CastInterrupt,
0x219, 1, m_id, 1 );
0x219, 1, m_id, 0 );
// Note: When cast interrupt from taking too much damage, set the last value to 1. This enables the cast interrupt effect. Example:
// auto control = ActorControlPacket142( m_pSource->getId(), ActorControlType::CastInterrupt, 0x219, 1, m_id, 0 );
m_pSource->sendToInRangeSet( control, true );
}

View file

@ -696,9 +696,13 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint32_t actionId, u
if ( isPlayer() && !ActionCollision::isActorApplicable( pTarget.shared_from_this(), TargetFilter::Enemies ) )
break;
pTarget.takeDamage( static_cast< uint32_t >( param1 ) );
pTarget.onActionHostile( shared_from_this() );
sendToInRangeSet( effectPacket, true );
pTarget.takeDamage( static_cast< uint32_t >( param1 ) );
if ( pTarget.isAlive() )
pTarget.onActionHostile( shared_from_this() );
}
else
{
@ -711,8 +715,11 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint32_t actionId, u
effectPacket.data().effectTarget = pHitActor->getId();
sendToInRangeSet( effectPacket, true ); // todo: send to range of what? ourselves? when mob script hits this is going to be lacking
pHitActor->takeDamage( static_cast< uint32_t >( param1 ) );
pHitActor->onActionHostile( shared_from_this() );
if( pHitActor->isAlive() )
pHitActor->onActionHostile( shared_from_this() );
// Debug
if ( isPlayer() )

View file

@ -1415,6 +1415,12 @@ void Core::Entity::Player::setIsLogin( bool bIsLogin )
m_bIsLogin = bIsLogin;
}
void Core::Entity::Player::setTitle( uint16_t titleId )
{
m_title = titleId;
sendToInRangeSet( ActorControlPacket142( getId(), SetTitle, titleId ), true );
}
void Core::Entity::Player::autoAttack( ActorPtr pTarget )
{

View file

@ -328,6 +328,8 @@ public:
void teleport( uint16_t aetheryteId, uint8_t type = 1 );
/*! prepares zoning / fades out the screen */
void prepareZoning( uint16_t targetZone, bool fadeOut, uint8_t fadoutTime = 0, uint16_t animation = 0 );
/*! change player's title */
void setTitle( uint16_t titleId );
void calculateStats() override;
void sendStats();
@ -565,7 +567,8 @@ private:
uint8_t status;
} m_retainerInfo[8];
uint8_t m_titleList[32];
uint16_t m_title;
uint16_t m_titleList[32];
uint8_t m_achievement[16];
uint8_t m_howTo[33];
uint8_t m_homePoint;

View file

@ -257,6 +257,13 @@ void Core::DebugCommandHandler::set( char * data, Core::Entity::PlayerPtr pPlaye
pPlayer->sendModel();
pPlayer->sendDebug( "Model updated" );
}
else if ( subCommand == "title" )
{
uint32_t titleId;
sscanf( params.c_str(), "%d", &titleId );
pPlayer->setTitle( titleId );
}
else
{
pPlayer->sendUrgent( subCommand + " is not a valid SET command." );

View file

@ -114,7 +114,7 @@ void Core::Network::GameConnection::actionHandler( const Packets::GamePacket& in
}
case 0x69: // Cancel cast
{
if( pPlayer->checkAction() )
if( pPlayer->getCurrentAction() != nullptr )
pPlayer->getCurrentAction()->setInterrupted();
break;
}

View file

@ -70,7 +70,7 @@ namespace Server {
//m_data.u23 = 0x04;
//m_data.u24 = 256;
m_data.state = 1;
m_data.state = static_cast< uint8_t >( pPlayer->getStatus() );
m_data.type = 1;
if( pTarget == pPlayer )
{