Permalink
Browse files

Auras with interrupt flags AURA_INTERRUPT_ON_JUMP, AURA_INTERRUPT_ON_…

…TURNING and AURA_INTERRUPT_ON_CAST_SPELL are being removed now when such actions are done. Fixes Hunter's Feign Death, now you can't jump, turn your "dead" body and cast any spell you want while under effect of Feign Death. Closses #71.
  • Loading branch information...
neo-mat committed Feb 18, 2012
1 parent 1022b6c commit 3be2ca073aaa74ce3493a29e207a9b4c03a7d121
@@ -361,18 +361,18 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data)
case MSG_MOVE_START_STRAFE_RIGHT:
_player->strafing = true;
break;
/*case MSG_MOVE_JUMP:
_player->jumping = true;
break;*/
/*case MSG_MOVE_JUMP:
_player->jumping = true;
break;*/
case MSG_MOVE_STOP:
_player->moving = false;
break;
case MSG_MOVE_STOP_STRAFE:
_player->strafing = false;
break;
/*case MSG_MOVE_FALL_LAND:
_player->jumping = false;
break;*/
/*case MSG_MOVE_FALL_LAND:
_player->jumping = false;
break;*/
default:
moved = false;
@@ -402,6 +402,12 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data)
}
}
// Rotating your character with a hold down right click mouse button
if(_player->GetOrientation() != movement_info.orientation)
_player->isTurning = true;
else
_player->isTurning = false;
/************************************************************************/
/* Anti-Fly Hack Checks - Alice : Disabled for now */
@@ -684,8 +690,10 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data)
flags |= AURA_INTERRUPT_ON_LEAVE_WATER;
if(movement_info.flags & MOVEFLAG_SWIMMING)
flags |= AURA_INTERRUPT_ON_ENTER_WATER;
if(movement_info.flags & (MOVEFLAG_TURN_LEFT | MOVEFLAG_TURN_RIGHT))
if((movement_info.flags & MOVEFLAG_TURNING_MASK) || _player->isTurning)
flags |= AURA_INTERRUPT_ON_TURNING;
if(movement_info.flags & MOVEFLAG_REDIRECTED)
flags |= AURA_INTERRUPT_ON_JUMP;
_player->RemoveAurasByInterruptFlag(flags);
@@ -1477,6 +1477,7 @@ class SERVER_DECL Player : public Unit
bool m_isMoving;
bool moving;
bool strafing;
bool isTurning;
bool jumping;
//Invisibility stuff
bool m_isGmInvisible;
@@ -1486,7 +1486,10 @@ void Spell::cast(bool check)
// we're much better to remove this here, because otherwise spells that change powers etc,
// don't get applied.
if(u_caster && !m_triggeredSpell && !m_triggeredByAura)
{
u_caster->RemoveAurasByInterruptFlagButSkip(AURA_INTERRUPT_ON_CAST_SPELL, GetProto()->Id);
u_caster->RemoveAurasByInterruptFlag(AURA_INTERRUPT_ON_CAST);
}
// if the spell is not reflected
if(!IsReflected())
@@ -1549,7 +1552,10 @@ void Spell::cast(bool check)
// don't get applied.
if(u_caster && !m_triggeredSpell && !m_triggeredByAura)
{
u_caster->RemoveAurasByInterruptFlagButSkip(AURA_INTERRUPT_ON_CAST_SPELL, GetProto()->Id);
u_caster->RemoveAurasByInterruptFlag(AURA_INTERRUPT_ON_CAST);
}
//not sure if it must be there...
/*if( p_caster != NULL )
View
@@ -321,33 +321,33 @@ enum CastInterruptFlags
enum AuraInterruptFlags
{
AURA_INTERRUPT_NULL = 0x0,
AURA_INTERRUPT_ON_HOSTILE_SPELL_INFLICTED = 0x1,
AURA_INTERRUPT_ON_ANY_DAMAGE_TAKEN = 0x2,
AURA_INTERRUPT_ON_UNK1 = 0x4,
AURA_INTERRUPT_ON_MOVEMENT = 0x8,
AURA_INTERRUPT_ON_TURNING = 0x10,
AURA_INTERRUPT_ON_ENTER_COMBAT = 0x20,
AURA_INTERRUPT_ON_DISMOUNT = 0x40,
AURA_INTERRUPT_ON_ENTER_WATER = 0x80,
AURA_INTERRUPT_ON_LEAVE_WATER = 0x100, // could be AURA_INTERRUPT_ON_LEAVE_CURRENT_SURFACE
AURA_INTERRUPT_ON_UNUSED2 = 0x200,
AURA_INTERRUPT_ON_UNK4 = 0x400,
AURA_INTERRUPT_ON_UNK5 = 0x800,
AURA_INTERRUPT_ON_START_ATTACK = 0x1000,
AURA_INTERRUPT_ON_UNK6 = 0x2000,
AURA_INTERRUPT_ON_UNUSED3 = 0x4000,
AURA_INTERRUPT_ON_CAST_SPELL = 0x8000,
AURA_INTERRUPT_ON_UNK7 = 0x10000,
AURA_INTERRUPT_ON_MOUNT = 0x20000,
AURA_INTERRUPT_ON_STAND_UP = 0x40000,
AURA_INTERRUPT_ON_LEAVE_AREA = 0x80000,
AURA_INTERRUPT_ON_INVINCIBLE = 0x100000,
AURA_INTERRUPT_ON_STEALTH = 0x200000,
AURA_INTERRUPT_ON_UNK8 = 0x400000,
AURA_INTERRUPT_ON_PVP_ENTER = 0x800000,
AURA_INTERRUPT_ON_DIRECT_DAMAGE = 0x1000000,
AURA_INTERRUPT_ON_AFTER_CAST_SPELL = 0x80000000,
AURA_INTERRUPT_NULL = 0x00000000,
AURA_INTERRUPT_ON_HOSTILE_SPELL_INFLICTED = 0x00000001, // Remove on being hit by hostile spell
AURA_INTERRUPT_ON_ANY_DAMAGE_TAKEN = 0x00000002, // Remove on any damage taken
AURA_INTERRUPT_ON_CAST = 0x00000004, // Remove on any spell cast
AURA_INTERRUPT_ON_MOVEMENT = 0x00000008, // Remove on moving
AURA_INTERRUPT_ON_TURNING = 0x00000010, // Remove on turning
AURA_INTERRUPT_ON_JUMP = 0x00000020, // Remove on jumping
AURA_INTERRUPT_ON_DISMOUNT = 0x00000040, // Remove on dismounting
AURA_INTERRUPT_ON_ENTER_WATER = 0x00000080, // Remove when entering water
AURA_INTERRUPT_ON_LEAVE_WATER = 0x00000100, // Remove when leaving water, could be AURA_INTERRUPT_ON_LEAVE_CURRENT_SURFACE
AURA_INTERRUPT_ON_UNUSED2 = 0x00000200, // Something to do with sheath state
AURA_INTERRUPT_ON_UNK4 = 0x00000400, // On gossip NPC?
AURA_INTERRUPT_ON_UNK5 = 0x00000800, // ??
AURA_INTERRUPT_ON_START_ATTACK = 0x00001000, // Remove on melee attack
AURA_INTERRUPT_ON_CAST_SPELL = 0x00002000, // Remove on spell cast
AURA_INTERRUPT_ON_UNUSED3 = 0x00004000,
AURA_INTERRUPT_ON_CAST_SPELL_UNK = 0x00008000, // Not sure what this one is, but definitely not on spell cast
AURA_INTERRUPT_ON_UNK7 = 0x00010000,
AURA_INTERRUPT_ON_MOUNT = 0x00020000, // Remove on mounting up
AURA_INTERRUPT_ON_STAND_UP = 0x00040000, // Remove on stand up, for spells like drinking/eating
AURA_INTERRUPT_ON_LEAVE_AREA = 0x00080000, // Remove on leaving zone or being teleported
AURA_INTERRUPT_ON_INVINCIBLE = 0x00100000, // Remove on becoming invincible
AURA_INTERRUPT_ON_STEALTH = 0x00200000, // Remove on entering stealth
AURA_INTERRUPT_ON_UNK8 = 0x00400000,
AURA_INTERRUPT_ON_PVP_ENTER = 0x00800000, // Remove on getting PvP flag
AURA_INTERRUPT_ON_DIRECT_DAMAGE = 0x01000000, // Remove on taking direct damage
AURA_INTERRUPT_ON_AFTER_CAST_SPELL = 0x80000000, // Custom?
};
enum ChannelInterruptFlags
@@ -77,8 +77,8 @@ enum MovementFlags
MOVEFLAG_WALK = 0x100, //verified
MOVEFLAG_TRANSPORT = 0x200,
MOVEFLAG_NO_COLLISION = 0x400,
MOVEFLAG_ROOTED = 0x800, //verified
MOVEFLAG_REDIRECTED = 0x1000, //Unconfirmed
MOVEFLAG_ROOTED = 0x800, //verified
MOVEFLAG_REDIRECTED = 0x1000, //Unconfirmed, should be MOVEFLAG_JUMP
MOVEFLAG_FALLING = 0x2000, //verified
MOVEFLAG_FALLING_FAR = 0x4000, //verified
MOVEFLAG_FREE_FALLING = 0x8000, //half verified
@@ -106,7 +106,7 @@ enum MovementFlags
// Masks
MOVEFLAG_MOVING_MASK = 0x03,
MOVEFLAG_STRAFING_MASK = 0x0C,
MOVEFLAG_TURNING_MASK = 0x30,
MOVEFLAG_TURNING_MASK = 0x30, // MOVEFLAG_TURN_LEFT + MOVEFLAG_TURN_RIGHT
MOVEFLAG_FALLING_MASK = 0x6000,
MOVEFLAG_MOTION_MASK = 0xE00F, // Forwards, Backwards, Strafing, Falling
MOVEFLAG_PENDING_MASK = 0x7F0000,

8 comments on commit 3be2ca0

@Favorite

This comment has been minimized.

Show comment
Hide comment
@Favorite

Favorite Feb 28, 2012

cant use Arcane Exlposion at walking/jumping anymore (have to work at walking/jumping)

Favorite replied Feb 28, 2012

cant use Arcane Exlposion at walking/jumping anymore (have to work at walking/jumping)

@neo-mat

This comment has been minimized.

Show comment
Hide comment
@neo-mat

neo-mat Feb 28, 2012

Member

Not sure how is it related to this, because Arcane Explosion is not applying any aura.

UPD: Tested, it works while moving and spamming arcane explosion, spell is being casted and mobs are being damaged.

UPD: Tested again, it works while strafing ( I am mainly strafing :< ), doesn't work while moving forwards and backwards.
UPD3: By the logic, it hasn't been working even before, because Arcane Explosion has Interrupt Flags: 0x0000000F:

 CAST_INTERRUPT_ON_MOVEMENT     = 0x1,
 CAST_INTERRUPT_PUSHBACK             = 0x2, // seems to be whether or not the spell is pushed back on dmg
 CAST_INTERRUPT_ON_INTERRUPT_CAST    = 0x4, // ? probably interrupt only cast
 CAST_INTERRUPT_ON_INTERRUPT_SCHOOL  = 0x8

and

 if( ( p_caster != NULL ) && p_caster->moving && ( m_spellInfo->InterruptFlags & CAST_INTERRUPT_ON_MOVEMENT ) )
    return SPELL_FAILED_MOVING;

where

switch(opcode)
{
    case MSG_MOVE_START_FORWARD:
    case MSG_MOVE_START_BACKWARD:
        _player->moving = true;
        break;

while strafing is:

    case MSG_MOVE_START_STRAFE_LEFT:
    case MSG_MOVE_START_STRAFE_RIGHT:
        _player->strafing = true;
        break;
Member

neo-mat replied Feb 28, 2012

Not sure how is it related to this, because Arcane Explosion is not applying any aura.

UPD: Tested, it works while moving and spamming arcane explosion, spell is being casted and mobs are being damaged.

UPD: Tested again, it works while strafing ( I am mainly strafing :< ), doesn't work while moving forwards and backwards.
UPD3: By the logic, it hasn't been working even before, because Arcane Explosion has Interrupt Flags: 0x0000000F:

 CAST_INTERRUPT_ON_MOVEMENT     = 0x1,
 CAST_INTERRUPT_PUSHBACK             = 0x2, // seems to be whether or not the spell is pushed back on dmg
 CAST_INTERRUPT_ON_INTERRUPT_CAST    = 0x4, // ? probably interrupt only cast
 CAST_INTERRUPT_ON_INTERRUPT_SCHOOL  = 0x8

and

 if( ( p_caster != NULL ) && p_caster->moving && ( m_spellInfo->InterruptFlags & CAST_INTERRUPT_ON_MOVEMENT ) )
    return SPELL_FAILED_MOVING;

where

switch(opcode)
{
    case MSG_MOVE_START_FORWARD:
    case MSG_MOVE_START_BACKWARD:
        _player->moving = true;
        break;

while strafing is:

    case MSG_MOVE_START_STRAFE_LEFT:
    case MSG_MOVE_START_STRAFE_RIGHT:
        _player->strafing = true;
        break;
@neo-mat

This comment has been minimized.

Show comment
Hide comment
@neo-mat

neo-mat Feb 28, 2012

Member

Rolled back to revision 0e42ad0

Issue is still there, though it's kinda logical as I've described above ↑

Though you can cast it while jumping (but not while moving forwards/backwards at the same time).

Member

neo-mat replied Feb 28, 2012

Rolled back to revision 0e42ad0

Issue is still there, though it's kinda logical as I've described above ↑

Though you can cast it while jumping (but not while moving forwards/backwards at the same time).

@neo-mat

This comment has been minimized.

Show comment
Hide comment
@neo-mat

neo-mat Feb 28, 2012

Member

This check was added in revision f19d801

Member

neo-mat replied Feb 28, 2012

This check was added in revision f19d801

@neo-mat

This comment has been minimized.

Show comment
Hide comment
@neo-mat

neo-mat Feb 28, 2012

Member

Either way Arcane Explosion has wrong DBC data (What a surprise from Blizzard, jk...) or it is supposed to be handled somehow otherwise because of that flag. For example Holy Nova has no Interrupt Flags, nor most instant casts like DoTs/HoTs

Member

neo-mat replied Feb 28, 2012

Either way Arcane Explosion has wrong DBC data (What a surprise from Blizzard, jk...) or it is supposed to be handled somehow otherwise because of that flag. For example Holy Nova has no Interrupt Flags, nor most instant casts like DoTs/HoTs

@neo-mat

This comment has been minimized.

Show comment
Hide comment
@neo-mat

neo-mat Feb 28, 2012

Member

Well you also digged it to another issue - the use of bool moving instead of bool m_isMoving in that check.

Member

neo-mat replied Feb 28, 2012

Well you also digged it to another issue - the use of bool moving instead of bool m_isMoving in that check.

@jackpoz

This comment has been minimized.

Show comment
Hide comment
@jackpoz

jackpoz Feb 28, 2012

Member

is this really an issue? are you supposed to be able to cast that spell on retail while walking/jumping?

Member

jackpoz replied Feb 28, 2012

is this really an issue? are you supposed to be able to cast that spell on retail while walking/jumping?

@neo-mat

This comment has been minimized.

Show comment
Hide comment
@neo-mat

neo-mat Feb 28, 2012

Member

Yeah, you are able to cast it while moving forwards/backwards, like Holy Nova. But in DBC there is an Interrupt Flag, so... ideas?

Member

neo-mat replied Feb 28, 2012

Yeah, you are able to cast it while moving forwards/backwards, like Holy Nova. But in DBC there is an Interrupt Flag, so... ideas?

Please sign in to comment.