mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-30 08:07:46 +00:00
Fix issue with aggro when mob dies instantly from skill; Align cast interrupt packet with retail;
This commit is contained in:
parent
a4c19198d5
commit
961390ab62
2 changed files with 15 additions and 4 deletions
|
@ -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 );
|
||||
|
||||
}
|
||||
|
|
|
@ -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() )
|
||||
|
|
Loading…
Add table
Reference in a new issue