mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-30 16:17: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
989939cf51
commit
d28c023456
2 changed files with 15 additions and 4 deletions
|
@ -92,7 +92,11 @@ void Core::Action::ActionCast::onInterrupt()
|
||||||
m_pSource->getAsPlayer()->sendStateFlags();
|
m_pSource->getAsPlayer()->sendStateFlags();
|
||||||
|
|
||||||
auto control = ActorControlPacket142( m_pSource->getId(), ActorControlType::CastInterrupt,
|
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 );
|
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 ) )
|
if ( isPlayer() && !ActionCollision::isActorApplicable( pTarget.shared_from_this(), TargetFilter::Enemies ) )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
pTarget.takeDamage( static_cast< uint32_t >( param1 ) );
|
|
||||||
pTarget.onActionHostile( shared_from_this() );
|
|
||||||
sendToInRangeSet( effectPacket, true );
|
sendToInRangeSet( effectPacket, true );
|
||||||
|
|
||||||
|
pTarget.takeDamage( static_cast< uint32_t >( param1 ) );
|
||||||
|
|
||||||
|
if ( pTarget.isAlive() )
|
||||||
|
pTarget.onActionHostile( shared_from_this() );
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -711,8 +715,11 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint32_t actionId, u
|
||||||
effectPacket.data().effectTarget = pHitActor->getId();
|
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
|
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->takeDamage( static_cast< uint32_t >( param1 ) );
|
||||||
pHitActor->onActionHostile( shared_from_this() );
|
|
||||||
|
if( pHitActor->isAlive() )
|
||||||
|
pHitActor->onActionHostile( shared_from_this() );
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
if ( isPlayer() )
|
if ( isPlayer() )
|
||||||
|
|
Loading…
Add table
Reference in a new issue