refactor(Core/Spells): Add helpers for HasAuraType (#20802)
This commit is contained in:
parent
55f6bd0972
commit
ed008a8780
41 changed files with 183 additions and 140 deletions
|
|
@ -484,7 +484,7 @@ Unit* PetAI::SelectNextTarget(bool allowAutoSelect) const
|
|||
return myAttacker;
|
||||
|
||||
// Check pet's attackers first to prevent dragging mobs back to owner
|
||||
if (me->HasAuraType(SPELL_AURA_MOD_TAUNT))
|
||||
if (me->HasTauntAura())
|
||||
{
|
||||
const Unit::AuraEffectList& tauntAuras = me->GetAuraEffectsByType(SPELL_AURA_MOD_TAUNT);
|
||||
if (!tauntAuras.empty())
|
||||
|
|
|
|||
|
|
@ -844,7 +844,7 @@ void Battleground::EndBattleground(PvPTeamId winnerTeamId)
|
|||
TeamId bgTeamId = player->GetBgTeamId();
|
||||
|
||||
// should remove spirit of redemption
|
||||
if (player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
if (player->HasSpiritOfRedemptionAura())
|
||||
player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
|
||||
|
||||
if (!player->IsAlive())
|
||||
|
|
@ -1008,7 +1008,7 @@ void Battleground::RemovePlayerAtLeave(Player* player)
|
|||
RemovePlayer(player);
|
||||
|
||||
// should remove spirit of redemption
|
||||
if (player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
if (player->HasSpiritOfRedemptionAura())
|
||||
player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
|
||||
|
||||
// if the player was a match participant
|
||||
|
|
|
|||
|
|
@ -534,7 +534,7 @@ void BattlegroundSA::TeleportPlayers()
|
|||
if (Player* player = itr->second)
|
||||
{
|
||||
// should remove spirit of redemption
|
||||
if (player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
if (player->HasSpiritOfRedemptionAura())
|
||||
player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
|
||||
|
||||
if (!player->IsAlive())
|
||||
|
|
|
|||
|
|
@ -1058,7 +1058,7 @@ void Creature::DoFleeToGetAssistance()
|
|||
if (!GetVictim())
|
||||
return;
|
||||
|
||||
if (HasAuraType(SPELL_AURA_PREVENTS_FLEEING))
|
||||
if (HasPreventsFleeingAura())
|
||||
return;
|
||||
|
||||
float radius = sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS);
|
||||
|
|
@ -2669,7 +2669,7 @@ bool Creature::CanCreatureAttack(Unit const* victim, bool skipDistCheck) const
|
|||
|
||||
// pussywizard: don't check distance to home position if recently damaged (allow kiting away from spawnpoint!)
|
||||
// xinef: this should include taunt auras
|
||||
if (!isWorldBoss() && (GetLastLeashExtensionTime() + 12 > GameTime::GetGameTime().count() || HasAuraType(SPELL_AURA_MOD_TAUNT)))
|
||||
if (!isWorldBoss() && (GetLastLeashExtensionTime() + 12 > GameTime::GetGameTime().count() || HasTauntAura()))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -3459,14 +3459,14 @@ void Creature::UpdateMovementFlags()
|
|||
else
|
||||
SetDisableGravity(true);
|
||||
|
||||
if (!HasAuraType(SPELL_AURA_HOVER))
|
||||
if (!HasHoverAura())
|
||||
SetHover(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetCanFly(false);
|
||||
SetDisableGravity(false);
|
||||
if (IsAlive() && (CanHover() || HasAuraType(SPELL_AURA_HOVER)))
|
||||
if (IsAlive() && (CanHover() || HasHoverAura()))
|
||||
SetHover(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3128,7 +3128,7 @@ float WorldObject::GetMapHeight(float x, float y, float z, bool vmap/* = true*/,
|
|||
float WorldObject::GetMapWaterOrGroundLevel(float x, float y, float z, float* ground/* = nullptr*/) const
|
||||
{
|
||||
return GetMap()->GetWaterOrGroundLevel(GetPhaseMask(), x, y, z, ground,
|
||||
IsUnit() ? !static_cast<Unit const*>(this)->HasAuraType(SPELL_AURA_WATER_WALK) : false,
|
||||
IsUnit() ? !static_cast<Unit const*>(this)->HasWaterWalkAura() : false,
|
||||
std::max(GetCollisionHeight(), Z_OFFSET_FIND_HEIGHT));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -813,7 +813,7 @@ int32 Player::getMaxTimer(MirrorTimerType timer)
|
|||
return MINUTE * IN_MILLISECONDS;
|
||||
case BREATH_TIMER:
|
||||
{
|
||||
if (!IsAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSession()->GetSecurity() >= AccountTypes(sWorld->getIntConfig(CONFIG_DISABLE_BREATHING)))
|
||||
if (!IsAlive() || HasWaterBreathingAura() || GetSession()->GetSecurity() >= AccountTypes(sWorld->getIntConfig(CONFIG_DISABLE_BREATHING)))
|
||||
return DISABLED_MIRROR_TIMER;
|
||||
int32 UnderWaterTime = sWorld->getIntConfig(CONFIG_WATER_BREATH_TIMER);
|
||||
AuraEffectList const& mModWaterBreathing = GetAuraEffectsByType(SPELL_AURA_MOD_WATER_BREATHING);
|
||||
|
|
@ -1787,8 +1787,8 @@ void Player::RegenerateAll()
|
|||
{
|
||||
// Not in combat or they have regeneration
|
||||
if (!IsInCombat() || IsPolymorphed() || m_baseHealthRegen ||
|
||||
HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT) ||
|
||||
HasAuraType(SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT))
|
||||
HasRegenDuringCombatAura() ||
|
||||
HasHealthRegenInCombatAura())
|
||||
{
|
||||
RegenerateHealth();
|
||||
}
|
||||
|
|
@ -1882,7 +1882,7 @@ void Player::Regenerate(Powers power)
|
|||
break;
|
||||
case POWER_RAGE: // Regenerate rage
|
||||
{
|
||||
if (!IsInCombat() && !HasAuraType(SPELL_AURA_INTERRUPT_REGEN))
|
||||
if (!IsInCombat() && !HasInterruptRegenAura())
|
||||
{
|
||||
float RageDecreaseRate = sWorld->getRate(RATE_POWER_RAGE_LOSS);
|
||||
addvalue += -20 * RageDecreaseRate; // 2 rage by tick (= 2 seconds => 1 rage/sec)
|
||||
|
|
@ -1894,7 +1894,7 @@ void Player::Regenerate(Powers power)
|
|||
break;
|
||||
case POWER_RUNIC_POWER:
|
||||
{
|
||||
if (!IsInCombat() && !HasAuraType(SPELL_AURA_INTERRUPT_REGEN))
|
||||
if (!IsInCombat() && !HasInterruptRegenAura())
|
||||
{
|
||||
float RunicPowerDecreaseRate = sWorld->getRate(RATE_POWER_RUNICPOWER_LOSS);
|
||||
addvalue += -30 * RunicPowerDecreaseRate; // 3 RunicPower by tick
|
||||
|
|
@ -2000,7 +2000,7 @@ void Player::RegenerateHealth()
|
|||
if (IsPolymorphed())
|
||||
addvalue = (float)GetMaxHealth() / 3;
|
||||
// normal regen case (maybe partly in combat case)
|
||||
else if (!IsInCombat() || HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT))
|
||||
else if (!IsInCombat() || HasRegenDuringCombatAura())
|
||||
{
|
||||
addvalue = OCTRegenHPPerSpirit() * HealthIncreaseRate;
|
||||
|
||||
|
|
@ -2019,7 +2019,7 @@ void Player::RegenerateHealth()
|
|||
{
|
||||
addvalue += GetTotalAuraModifier(SPELL_AURA_MOD_REGEN) * 2 * IN_MILLISECONDS / (5 * IN_MILLISECONDS);
|
||||
}
|
||||
else if (HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT))
|
||||
else if (HasRegenDuringCombatAura())
|
||||
{
|
||||
ApplyPct(addvalue, GetTotalAuraModifier(SPELL_AURA_MOD_REGEN_DURING_COMBAT));
|
||||
}
|
||||
|
|
@ -4554,7 +4554,7 @@ void Player::KillPlayer()
|
|||
//SetUnitFlag(UNIT_FLAG_NOT_IN_PVP);
|
||||
|
||||
ReplaceAllDynamicFlags(UNIT_DYNFLAG_NONE);
|
||||
ApplyModFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStore.LookupEntry(GetMapId())->Instanceable() && !HasAuraType(SPELL_AURA_PREVENT_RESURRECTION));
|
||||
ApplyModFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStore.LookupEntry(GetMapId())->Instanceable() && !HasPreventResurectionAura());
|
||||
|
||||
// 6 minutes until repop at graveyard
|
||||
m_deathTimer = 6 * MINUTE * IN_MILLISECONDS;
|
||||
|
|
@ -4779,10 +4779,8 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory)
|
|||
|
||||
void Player::DurabilityPointsLoss(Item* item, int32 points)
|
||||
{
|
||||
if (HasAuraType(SPELL_AURA_PREVENT_DURABILITY_LOSS))
|
||||
{
|
||||
if (HasPreventDurabilityLossAura())
|
||||
return;
|
||||
}
|
||||
|
||||
int32 pMaxDurability = item->GetUInt32Value(ITEM_FIELD_MAXDURABILITY);
|
||||
int32 pOldDurability = item->GetUInt32Value(ITEM_FIELD_DURABILITY);
|
||||
|
|
@ -6110,7 +6108,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
|||
|
||||
if (honor_f <= 0)
|
||||
{
|
||||
if (!uVictim || uVictim == this || uVictim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT))
|
||||
if (!uVictim || uVictim == this || uVictim->HasNoPVPCreditAura())
|
||||
return false;
|
||||
|
||||
victim_guid = uVictim->GetGUID();
|
||||
|
|
@ -6223,7 +6221,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
|||
|
||||
if (sWorld->getBoolConfig(CONFIG_PVP_TOKEN_ENABLE))
|
||||
{
|
||||
if (!uVictim || uVictim == this || uVictim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT))
|
||||
if (!uVictim || uVictim == this || uVictim->HasNoPVPCreditAura())
|
||||
return true;
|
||||
|
||||
if (uVictim->IsPlayer())
|
||||
|
|
@ -11666,7 +11664,7 @@ void Player::SendInitialPacketsAfterAddToMap()
|
|||
|
||||
// Fix mount, update block gets messed somewhere
|
||||
{
|
||||
if (!isBeingLoaded() && GetMountBlockId() && !HasAuraType(SPELL_AURA_MOUNTED))
|
||||
if (!isBeingLoaded() && GetMountBlockId() && !HasMountedAura())
|
||||
{
|
||||
AddAura(GetMountBlockId(), this);
|
||||
SetMountBlockId(0);
|
||||
|
|
@ -11678,11 +11676,11 @@ void Player::SendInitialPacketsAfterAddToMap()
|
|||
GetZoneAndAreaId(newzone, newarea);
|
||||
UpdateZone(newzone, newarea); // also call SendInitWorldStates();
|
||||
|
||||
if (HasAuraType(SPELL_AURA_MOD_STUN))
|
||||
if (HasStunAura())
|
||||
SetMovement(MOVE_ROOT);
|
||||
|
||||
// manual send package (have code in HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true); that must not be re-applied.
|
||||
if (HasAuraType(SPELL_AURA_MOD_ROOT))
|
||||
if (HasRootAura())
|
||||
{
|
||||
WorldPacket data2(SMSG_FORCE_MOVE_ROOT, 10);
|
||||
data2 << GetPackGUID();
|
||||
|
|
@ -12072,13 +12070,13 @@ void Player::GetAurasForTarget(Unit* target, bool force /*= false*/)
|
|||
/*! Blizz sends certain movement packets sometimes even before CreateObject
|
||||
These movement packets are usually found in SMSG_COMPRESSED_MOVES
|
||||
*/
|
||||
if (target->HasAuraType(SPELL_AURA_FEATHER_FALL))
|
||||
if (target->HasFeatherFallAura())
|
||||
target->SendMovementFeatherFall(this);
|
||||
|
||||
if (target->HasAuraType(SPELL_AURA_WATER_WALK))
|
||||
if (target->HasWaterWalkAura())
|
||||
target->SendMovementWaterWalking(this);
|
||||
|
||||
if (target->HasAuraType(SPELL_AURA_HOVER))
|
||||
if (target->HasHoverAura())
|
||||
target->SendMovementHover(this);
|
||||
|
||||
WorldPacket data(SMSG_AURA_UPDATE_ALL);
|
||||
|
|
@ -13863,8 +13861,8 @@ void Player::HandleFall(MovementInfo const& movementInfo)
|
|||
//Players with low fall distance, Feather Fall or physical immunity (charges used) are ignored
|
||||
// 14.57 can be calculated by resolving damageperc formula below to 0
|
||||
if (z_diff >= 14.57f && !isDead() && !IsGameMaster() && !GetCommandStatus(CHEAT_GOD) &&
|
||||
!HasAuraType(SPELL_AURA_HOVER) && !HasAuraType(SPELL_AURA_FEATHER_FALL) &&
|
||||
!HasAuraType(SPELL_AURA_FLY))
|
||||
!HasHoverAura() && !HasFeatherFallAura() &&
|
||||
!HasFlyAura())
|
||||
{
|
||||
//Safe fall, fall height reduction
|
||||
int32 safe_fall = GetTotalAuraModifier(SPELL_AURA_SAFE_FALL);
|
||||
|
|
|
|||
|
|
@ -5132,7 +5132,7 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons
|
|||
{
|
||||
// xinef: resurrect player, cant log in dead without corpse
|
||||
{
|
||||
if (HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
if (HasSpiritOfRedemptionAura())
|
||||
RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
|
||||
if (!IsAlive())
|
||||
ResurrectPlayer(1.0f);
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ void Player::Update(uint32 p_time)
|
|||
|
||||
// not auto-free ghost from body in instances
|
||||
if (m_deathTimer > 0 && !GetMap()->Instanceable() &&
|
||||
!HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
|
||||
!HasPreventResurectionAura())
|
||||
{
|
||||
if (p_time >= m_deathTimer)
|
||||
{
|
||||
|
|
@ -1715,7 +1715,7 @@ void Player::UpdateTriggerVisibility()
|
|||
// Update fields of triggers, transformed units or unselectable
|
||||
// units (values dependent on GM state)
|
||||
if (!creature || (!creature->IsTrigger() &&
|
||||
!creature->HasAuraType(SPELL_AURA_TRANSFORM) &&
|
||||
!creature->HasTransformAura() &&
|
||||
!creature->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE)))
|
||||
continue;
|
||||
|
||||
|
|
|
|||
|
|
@ -2836,7 +2836,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(Unit const* victim, WeaponAttackTy
|
|||
// Dodge chance
|
||||
|
||||
// only players can't dodge if attacker is behind
|
||||
if (victim->IsPlayer() && !victim->HasInArc(M_PI, this) && !victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
|
||||
if (victim->IsPlayer() && !victim->HasInArc(M_PI, this) && !victim->HasIgnoreHitDirectionAura())
|
||||
{
|
||||
//LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: attack came from behind and victim was a player.");
|
||||
}
|
||||
|
|
@ -2871,7 +2871,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(Unit const* victim, WeaponAttackTy
|
|||
// parry & block chances
|
||||
|
||||
// check if attack comes from behind, nobody can parry or block if attacker is behind
|
||||
if (!victim->HasInArc(M_PI, this) && !victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
|
||||
if (!victim->HasInArc(M_PI, this) && !victim->HasIgnoreHitDirectionAura())
|
||||
{
|
||||
LOG_DEBUG("entities.unit", "RollMeleeOutcomeAgainst: attack came from behind.");
|
||||
}
|
||||
|
|
@ -3103,7 +3103,7 @@ bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttac
|
|||
if (spellProto && spellProto->HasAttribute(SPELL_ATTR0_NO_ACTIVE_DEFENSE))
|
||||
return false;
|
||||
|
||||
if (victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION) || victim->HasInArc(M_PI, this))
|
||||
if (victim->HasIgnoreHitDirectionAura() || victim->HasInArc(M_PI, this))
|
||||
{
|
||||
// Check creatures flags_extra for disable block
|
||||
if (victim->IsCreature() &&
|
||||
|
|
@ -3201,7 +3201,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo
|
|||
if (attType == RANGED_ATTACK)
|
||||
{
|
||||
// only if in front
|
||||
if (!victim->HasUnitState(UNIT_STATE_STUNNED) && (victim->HasInArc(M_PI, this) || victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)))
|
||||
if (!victim->HasUnitState(UNIT_STATE_STUNNED) && (victim->HasInArc(M_PI, this) || victim->HasIgnoreHitDirectionAura()))
|
||||
{
|
||||
int32 deflect_chance = victim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS) * 100;
|
||||
tmp += deflect_chance;
|
||||
|
|
@ -3217,7 +3217,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo
|
|||
// xinef: if from behind or spell requires cast from behind
|
||||
if (!victim->HasInArc(M_PI, this))
|
||||
{
|
||||
if (!victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION) || spellInfo->HasAttribute(SPELL_ATTR0_CU_REQ_CASTER_BEHIND_TARGET))
|
||||
if (!victim->HasIgnoreHitDirectionAura() || spellInfo->HasAttribute(SPELL_ATTR0_CU_REQ_CASTER_BEHIND_TARGET))
|
||||
{
|
||||
// Can`t dodge from behind in PvP (but its possible in PvE)
|
||||
if (victim->IsPlayer())
|
||||
|
|
@ -3448,7 +3448,7 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo
|
|||
return SPELL_MISS_RESIST;
|
||||
|
||||
// cast by caster in front of victim
|
||||
if (!victim->HasUnitState(UNIT_STATE_STUNNED) && (victim->HasInArc(M_PI, this) || victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)))
|
||||
if (!victim->HasUnitState(UNIT_STATE_STUNNED) && (victim->HasInArc(M_PI, this) || victim->HasIgnoreHitDirectionAura()))
|
||||
{
|
||||
int32 deflect_chance = victim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS) * 100;
|
||||
tmp += deflect_chance;
|
||||
|
|
@ -10315,11 +10315,11 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
|
|||
}
|
||||
|
||||
// Unit with SPELL_AURA_SPIRIT_OF_REDEMPTION can not attack
|
||||
if (HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
if (HasSpiritOfRedemptionAura())
|
||||
return false;
|
||||
|
||||
// remove SPELL_AURA_MOD_UNATTACKABLE at attack (in case non-interruptible spells stun aura applied also that not let attack)
|
||||
if (HasAuraType(SPELL_AURA_MOD_UNATTACKABLE))
|
||||
if (HasUnattackableAura())
|
||||
RemoveAurasByType(SPELL_AURA_MOD_UNATTACKABLE);
|
||||
|
||||
if (m_attacking)
|
||||
|
|
@ -10996,7 +10996,7 @@ bool RedirectSpellEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
|||
if (Unit* auraOwner = ObjectAccessor::GetUnit(_self, _auraOwnerGUID))
|
||||
{
|
||||
// Xinef: already removed
|
||||
if (!auraOwner->HasAuraType(SPELL_AURA_SPELL_MAGNET))
|
||||
if (!auraOwner->HasSpellMagnetAura())
|
||||
return true;
|
||||
|
||||
Unit::AuraEffectList const& magnetAuras = auraOwner->GetAuraEffectsByType(SPELL_AURA_SPELL_MAGNET);
|
||||
|
|
@ -11873,7 +11873,7 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui
|
|||
}
|
||||
|
||||
// xinef: sanctified wrath talent
|
||||
if (caster && TakenTotalMod < 1.0f && caster->HasAuraType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST))
|
||||
if (caster && TakenTotalMod < 1.0f && caster->HasIgnoreTargetResistAura())
|
||||
{
|
||||
float ignoreModifier = 1.0f - TakenTotalMod;
|
||||
bool addModifier = false;
|
||||
|
|
@ -12080,7 +12080,7 @@ float Unit::SpellTakenCritChance(Unit const* caster, SpellInfo const* spellProto
|
|||
{
|
||||
// Modify critical chance by victim SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE
|
||||
// xinef: apply max and min only
|
||||
if (HasAuraType(SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE))
|
||||
if (HasAttackerSpellCritChanceAura())
|
||||
{
|
||||
crit_chance += GetMaxNegativeAuraModifierByMiscMask(SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE, schoolMask);
|
||||
crit_chance += GetMaxPositiveAuraModifierByMiscMask(SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE, schoolMask);
|
||||
|
|
@ -12762,7 +12762,7 @@ bool Unit::IsImmunedToDamage(SpellInfo const* spellInfo) const
|
|||
return false;
|
||||
}
|
||||
|
||||
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) && !HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) && !HasSpiritOfRedemptionAura())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -12795,7 +12795,7 @@ bool Unit::IsImmunedToDamage(Spell const* spell) const
|
|||
return false;
|
||||
}
|
||||
|
||||
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) && !HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) && !HasSpiritOfRedemptionAura())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -12842,7 +12842,7 @@ bool Unit::IsImmunedToSchool(SpellSchoolMask meleeSchoolMask) const
|
|||
|
||||
bool Unit::IsImmunedToSchool(SpellInfo const* spellInfo) const
|
||||
{
|
||||
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) && !HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) && !HasSpiritOfRedemptionAura())
|
||||
return false;
|
||||
|
||||
uint32 schoolMask = spellInfo->GetSchoolMask();
|
||||
|
|
@ -12866,7 +12866,7 @@ bool Unit::IsImmunedToSchool(SpellInfo const* spellInfo) const
|
|||
bool Unit::IsImmunedToSchool(Spell const* spell) const
|
||||
{
|
||||
SpellInfo const* spellInfo = spell->GetSpellInfo();
|
||||
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) && !HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) && !HasSpiritOfRedemptionAura())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -12929,7 +12929,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, Spell const* spell)
|
|||
return true;
|
||||
}
|
||||
|
||||
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) && !HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) && !HasSpiritOfRedemptionAura())
|
||||
return false;
|
||||
|
||||
if (spellInfo->Dispel)
|
||||
|
|
@ -13007,7 +13007,7 @@ bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) cons
|
|||
if (spellInfo->HasAttribute(SPELL_ATTR4_OWNER_POWER_SCALING))
|
||||
return false;
|
||||
|
||||
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) && !HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) && !HasSpiritOfRedemptionAura())
|
||||
return false;
|
||||
|
||||
//If m_immuneToEffect type contain this effect type, IMMUNE effect.
|
||||
|
|
@ -13349,7 +13349,7 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT
|
|||
}
|
||||
|
||||
// xinef: sanctified wrath talent
|
||||
if (TakenTotalMod < 1.0f && attacker->HasAuraType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST))
|
||||
if (TakenTotalMod < 1.0f && attacker->HasIgnoreTargetResistAura())
|
||||
{
|
||||
float ignoreModifier = 1.0f - TakenTotalMod;
|
||||
bool addModifier = false;
|
||||
|
|
@ -14635,7 +14635,7 @@ bool Unit::CanHaveThreatList(bool skipAliveCheck) const
|
|||
|
||||
float Unit::ApplyTotalThreatModifier(float fThreat, SpellSchoolMask schoolMask)
|
||||
{
|
||||
if (!HasAuraType(SPELL_AURA_MOD_THREAT) || fThreat < 0)
|
||||
if (!HasThreatAura() || fThreat < 0)
|
||||
return fThreat;
|
||||
|
||||
SpellSchools school = GetFirstSchoolInMask(schoolMask);
|
||||
|
|
@ -17838,7 +17838,7 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
|||
if (AuraEffect* aurEff = victim->GetAuraEffectDummy(20711))
|
||||
{
|
||||
// Xinef: aura_spirit_of_redemption is triggered by 27827 shapeshift
|
||||
if (victim->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION) || victim->HasAura(27827))
|
||||
if (victim->HasSpiritOfRedemptionAura() || victim->HasAura(27827))
|
||||
{
|
||||
/*LOG_INFO("misc", "Player ({}) died with spirit of redemption. Killer (Entry: {}, Name: {}), Map: {}, x: {}, y: {}, z: {}",
|
||||
victim->GetGUID().ToString(), killer ? killer->GetEntry() : 1, killer ? killer->GetName() : "", victim->GetMapId(), victim->GetPositionX(),
|
||||
|
|
@ -18082,7 +18082,7 @@ void Unit::SetControlled(bool apply, UnitState state, Unit* source /*= nullptr*/
|
|||
switch (state)
|
||||
{
|
||||
case UNIT_STATE_STUNNED:
|
||||
if (HasAuraType(SPELL_AURA_MOD_STUN))
|
||||
if (HasStunAura())
|
||||
return;
|
||||
ClearUnitState(state);
|
||||
SetStunned(false);
|
||||
|
|
@ -18097,19 +18097,19 @@ void Unit::SetControlled(bool apply, UnitState state, Unit* source /*= nullptr*/
|
|||
}
|
||||
}
|
||||
|
||||
if (HasAuraType(SPELL_AURA_MOD_ROOT) || GetVehicle())
|
||||
if (HasRootAura() || GetVehicle())
|
||||
return;
|
||||
ClearUnitState(state);
|
||||
SetRooted(false);
|
||||
break;
|
||||
case UNIT_STATE_CONFUSED:
|
||||
if (HasAuraType(SPELL_AURA_MOD_CONFUSE))
|
||||
if (HasConfuseAura())
|
||||
return;
|
||||
ClearUnitState(state);
|
||||
SetConfused(false);
|
||||
break;
|
||||
case UNIT_STATE_FLEEING:
|
||||
if (HasAuraType(SPELL_AURA_MOD_FEAR))
|
||||
if (HasFearAura())
|
||||
return;
|
||||
ClearUnitState(state);
|
||||
SetFeared(false);
|
||||
|
|
@ -18120,19 +18120,19 @@ void Unit::SetControlled(bool apply, UnitState state, Unit* source /*= nullptr*/
|
|||
|
||||
//ClearUnitState(state);
|
||||
|
||||
if (HasUnitState(UNIT_STATE_STUNNED) || HasAuraType(SPELL_AURA_MOD_STUN))
|
||||
if (HasUnitState(UNIT_STATE_STUNNED) || HasStunAura())
|
||||
SetStunned(true);
|
||||
else
|
||||
{
|
||||
if (HasUnitState(UNIT_STATE_ROOT) || HasAuraType(SPELL_AURA_MOD_ROOT))
|
||||
if (HasUnitState(UNIT_STATE_ROOT) || HasRootAura())
|
||||
SetRooted(true);
|
||||
|
||||
if (HasUnitState(UNIT_STATE_CONFUSED) || HasAuraType(SPELL_AURA_MOD_CONFUSE))
|
||||
if (HasUnitState(UNIT_STATE_CONFUSED) || HasConfuseAura())
|
||||
SetConfused(true);
|
||||
else if (HasUnitState(UNIT_STATE_FLEEING) || HasAuraType(SPELL_AURA_MOD_FEAR))
|
||||
else if (HasUnitState(UNIT_STATE_FLEEING) || HasFearAura())
|
||||
{
|
||||
bool isFear = false;
|
||||
if (HasAuraType(SPELL_AURA_MOD_FEAR))
|
||||
if (HasFearAura())
|
||||
{
|
||||
isFear = true;
|
||||
source = ObjectAccessor::GetUnit(*this, GetAuraEffectsByType(SPELL_AURA_MOD_FEAR).front()->GetCasterGUID());
|
||||
|
|
@ -19168,7 +19168,7 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ)
|
|||
|
||||
player->GetSession()->SendPacket(&data);
|
||||
|
||||
if (player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || player->HasAuraType(SPELL_AURA_FLY))
|
||||
if (player->HasIncreaseMountedFlightSpeedAura() || player->HasFlyAura())
|
||||
player->SetCanFly(true, true);
|
||||
|
||||
player->SetCanKnockback(true);
|
||||
|
|
|
|||
|
|
@ -1567,8 +1567,6 @@ public:
|
|||
/*********************************************************/
|
||||
/*** METHODS RELATED TO MOVEMENTS ***/
|
||||
/*********************************************************/
|
||||
[[nodiscard]] bool isFeared() const { return HasAuraType(SPELL_AURA_MOD_FEAR); }
|
||||
[[nodiscard]] bool isInRoots() const { return HasAuraType(SPELL_AURA_MOD_ROOT); }
|
||||
[[nodiscard]] bool IsPolymorphed() const;
|
||||
[[nodiscard]] bool isFrozen() const;
|
||||
[[nodiscard]] bool IsInFlight() const { return HasUnitState(UNIT_STATE_IN_FLIGHT); }
|
||||
|
|
@ -1639,8 +1637,6 @@ public:
|
|||
// SheathState
|
||||
[[nodiscard]] SheathState GetSheath() const { return SheathState(GetByteValue(UNIT_FIELD_BYTES_2, 0)); }
|
||||
virtual void SetSheath(SheathState sheathed) { SetByteValue(UNIT_FIELD_BYTES_2, 0, sheathed); }
|
||||
[[nodiscard]] bool HasStealthAura() const { return HasAuraType(SPELL_AURA_MOD_STEALTH); }
|
||||
[[nodiscard]] bool HasInvisibilityAura() const { return HasAuraType(SPELL_AURA_MOD_INVISIBILITY); }
|
||||
|
||||
// StandState
|
||||
[[nodiscard]] uint8 getStandState() const { return GetByteValue(UNIT_FIELD_BYTES_1, 0); }
|
||||
|
|
@ -1659,6 +1655,55 @@ public:
|
|||
[[nodiscard]] bool isDying() const { return (m_deathState == DeathState::JustDied); };
|
||||
[[nodiscard]] bool isDead() const { return (m_deathState == DeathState::Dead || m_deathState == DeathState::Corpse); };
|
||||
|
||||
// Spell Aura helpers
|
||||
[[nodiscard]] bool HasGhostAura() const { return HasAuraType(SPELL_AURA_GHOST); };
|
||||
[[nodiscard]] bool HasMountedAura() const { return HasAuraType(SPELL_AURA_MOUNTED); };
|
||||
[[nodiscard]] bool HasWaterWalkAura() const { return HasAuraType(SPELL_AURA_WATER_WALK); };
|
||||
[[nodiscard]] bool HasFeatherFallAura() const { return HasAuraType(SPELL_AURA_FEATHER_FALL); };
|
||||
[[nodiscard]] bool HasHoverAura() const { return HasAuraType(SPELL_AURA_HOVER); };
|
||||
[[nodiscard]] bool HasFlyAura() const { return HasAuraType(SPELL_AURA_FLY); };
|
||||
[[nodiscard]] bool HasSpiritOfRedemptionAura() const { return HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION); };
|
||||
[[nodiscard]] bool HasPreventsFleeingAura() const { return HasAuraType(SPELL_AURA_PREVENTS_FLEEING); };
|
||||
[[nodiscard]] bool HasPreventDurabilityLossAura() const { return HasAuraType(SPELL_AURA_PREVENT_DURABILITY_LOSS); };
|
||||
[[nodiscard]] bool HasPreventResurectionAura() const { return HasAuraType(SPELL_AURA_PREVENT_RESURRECTION); };
|
||||
[[nodiscard]] bool HasTransformAura() const { return HasAuraType(SPELL_AURA_TRANSFORM); };
|
||||
[[nodiscard]] bool HasInterruptRegenAura() const { return HasAuraType(SPELL_AURA_INTERRUPT_REGEN); };
|
||||
[[nodiscard]] bool HasNoPVPCreditAura() const { return HasAuraType(SPELL_AURA_NO_PVP_CREDIT); };
|
||||
[[nodiscard]] bool HasWaterBreathingAura() const { return HasAuraType(SPELL_AURA_WATER_BREATHING); };
|
||||
[[nodiscard]] bool HasIgnoreHitDirectionAura() const { return HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION); };
|
||||
[[nodiscard]] bool HasSpellMagnetAura() const { return HasAuraType(SPELL_AURA_SPELL_MAGNET); };
|
||||
[[nodiscard]] bool HasOpenStableAura() const { return HasAuraType(SPELL_AURA_OPEN_STABLE); };
|
||||
[[nodiscard]] bool HasCloneCasterAura() const { return HasAuraType(SPELL_AURA_CLONE_CASTER); };
|
||||
[[nodiscard]] bool HasReflectSpellsAura() const { return HasAuraType(SPELL_AURA_REFLECT_SPELLS); };
|
||||
[[nodiscard]] bool HasDetectAmoreAura() const { return HasAuraType(SPELL_AURA_DETECT_AMORE); };
|
||||
[[nodiscard]] bool HasAllowOnlyAbilityAura() const { return HasAuraType(SPELL_AURA_ALLOW_ONLY_ABILITY); };
|
||||
[[nodiscard]] bool HasPeriodicDummyAura() const { return HasAuraType(SPELL_AURA_PERIODIC_DUMMY); };
|
||||
[[nodiscard]] bool HasControlVehicleAura() const { return HasAuraType(SPELL_AURA_CONTROL_VEHICLE); };
|
||||
[[nodiscard]] bool HasAOECharmAura() const { return HasAuraType(SPELL_AURA_AOE_CHARM); };
|
||||
[[nodiscard]] bool HasDetectSpellsAura() const { return HasAuraType(SPELL_AURA_DEFLECT_SPELLS); };
|
||||
[[nodiscard]] bool HasPacifySilenceAura() const { return HasAuraType(SPELL_AURA_MOD_PACIFY_SILENCE); }
|
||||
[[nodiscard]] bool HasSilenceAura() const { return HasAuraType(SPELL_AURA_MOD_SILENCE); }
|
||||
[[nodiscard]] bool HasShapeshiftAura() const { return HasAuraType(SPELL_AURA_MOD_SHAPESHIFT); }
|
||||
[[nodiscard]] bool HasDecreaseSpeedAura() const { return HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED); }
|
||||
[[nodiscard]] bool HasPacifyAura() const { return HasAuraType(SPELL_AURA_MOD_PACIFY); }
|
||||
[[nodiscard]] bool HasIgnoreTargetResistAura() const { return HasAuraType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST); }
|
||||
[[nodiscard]] bool HasIncreaseMountedSpeedAura() const { return HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED); }
|
||||
[[nodiscard]] bool HasIncreaseMountedFlightSpeedAura() const { return HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED); }
|
||||
[[nodiscard]] bool HasThreatAura() const { return HasAuraType(SPELL_AURA_MOD_THREAT); }
|
||||
[[nodiscard]] bool HasAttackerSpellCritChanceAura() const { return HasAuraType(SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE); }
|
||||
[[nodiscard]] bool HasUnattackableAura() const { return HasAuraType(SPELL_AURA_MOD_UNATTACKABLE); }
|
||||
[[nodiscard]] bool HasHealthRegenInCombatAura() const { return HasAuraType(SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT); }
|
||||
[[nodiscard]] bool HasRegenDuringCombatAura() const { return HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT); }
|
||||
[[nodiscard]] bool HasFearAura() const { return HasAuraType(SPELL_AURA_MOD_FEAR); }
|
||||
[[nodiscard]] bool HasConfuseAura() const { return HasAuraType(SPELL_AURA_MOD_CONFUSE); }
|
||||
[[nodiscard]] bool HasRootAura() const { return HasAuraType(SPELL_AURA_MOD_ROOT); }
|
||||
[[nodiscard]] bool HasStunAura() const { return HasAuraType(SPELL_AURA_MOD_STUN); }
|
||||
[[nodiscard]] bool HasTauntAura() const { return HasAuraType(SPELL_AURA_MOD_TAUNT); }
|
||||
[[nodiscard]] bool HasStealthAura() const { return HasAuraType(SPELL_AURA_MOD_STEALTH); }
|
||||
[[nodiscard]] bool HasStealthDetectAura() const { return HasAuraType(SPELL_AURA_MOD_STEALTH_DETECT); }
|
||||
[[nodiscard]] bool HasInvisibilityAura() const { return HasAuraType(SPELL_AURA_MOD_INVISIBILITY); }
|
||||
[[nodiscard]] bool HasInvisibilityDetectAura() const { return HasAuraType(SPELL_AURA_MOD_INVISIBILITY_DETECT); }
|
||||
|
||||
// React methods
|
||||
bool IsHostileTo(Unit const* unit) const;
|
||||
[[nodiscard]] bool IsHostileToPlayers() const;
|
||||
|
|
|
|||
|
|
@ -369,7 +369,7 @@ void ObjectUpdater::Visit(GridRefMgr<T>& m)
|
|||
|
||||
bool AnyDeadUnitObjectInRangeCheck::operator()(Player* u)
|
||||
{
|
||||
return !u->IsAlive() && !u->HasAuraType(SPELL_AURA_GHOST) && i_searchObj->IsWithinDistInMap(u, i_range);
|
||||
return !u->IsAlive() && !u->HasGhostAura() && i_searchObj->IsWithinDistInMap(u, i_range);
|
||||
}
|
||||
|
||||
bool AnyDeadUnitObjectInRangeCheck::operator()(Corpse* u)
|
||||
|
|
|
|||
|
|
@ -821,7 +821,7 @@ namespace Acore
|
|||
bool operator()(Unit* u)
|
||||
{
|
||||
if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
|
||||
(u->isFeared() || u->IsCharmed() || u->isFrozen() || u->HasUnitState(UNIT_STATE_STUNNED) || u->HasUnitState(UNIT_STATE_CONFUSED)))
|
||||
(u->HasFearAura() || u->IsCharmed() || u->isFrozen() || u->HasUnitState(UNIT_STATE_STUNNED) || u->HasUnitState(UNIT_STATE_CONFUSED)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1068,7 +1068,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
|
|||
// Xinef: fix vendors falling of player vehicle, due to isBeingLoaded checks
|
||||
if (pCurrChar->IsInWorld())
|
||||
{
|
||||
if (pCurrChar->GetMountBlockId() && !pCurrChar->HasAuraType(SPELL_AURA_MOUNTED))
|
||||
if (pCurrChar->GetMountBlockId() && !pCurrChar->HasMountedAura())
|
||||
{
|
||||
pCurrChar->CastSpell(pCurrChar, pCurrChar->GetMountBlockId(), true);
|
||||
pCurrChar->SetMountBlockId(0);
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket& recv_data)
|
|||
if (GetPlayer()->IsAlive() || GetPlayer()->HasPlayerFlag(PLAYER_FLAGS_GHOST))
|
||||
return;
|
||||
|
||||
if (GetPlayer()->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
|
||||
if (GetPlayer()->HasPreventResurectionAura())
|
||||
return; // silently return, client should display the error by itself
|
||||
|
||||
// the world update order is sessions, players, creatures
|
||||
|
|
@ -674,7 +674,7 @@ void WorldSession::HandleResurrectResponseOpcode(WorldPacket& recv_data)
|
|||
recv_data >> status;
|
||||
|
||||
// Xinef: Prevent resurrect with prevent resurrection aura
|
||||
if (GetPlayer()->IsAlive() || GetPlayer()->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
|
||||
if (GetPlayer()->IsAlive() || GetPlayer()->HasPreventResurectionAura())
|
||||
return;
|
||||
|
||||
if (status == 0)
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
|
|||
case COMMAND_ATTACK: //spellId=1792 //ATTACK
|
||||
{
|
||||
// Can't attack if owner is pacified
|
||||
if (_player->HasAuraType(SPELL_AURA_MOD_PACIFY))
|
||||
if (_player->HasPacifyAura())
|
||||
{
|
||||
//pet->SendPetCastFail(spellId, SPELL_FAILED_PACIFIED);
|
||||
//TODO: Send proper error message to client
|
||||
|
|
@ -467,7 +467,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
|
|||
spell->finish(false);
|
||||
delete spell;
|
||||
|
||||
if (_player->HasAuraType(SPELL_AURA_MOD_PACIFY))
|
||||
if (_player->HasPacifyAura())
|
||||
return;
|
||||
|
||||
bool tempspellIsPositive = false;
|
||||
|
|
@ -653,7 +653,7 @@ bool WorldSession::CheckStableMaster(ObjectGuid guid)
|
|||
// spell case or GM
|
||||
if (guid == GetPlayer()->GetGUID())
|
||||
{
|
||||
if (!GetPlayer()->IsGameMaster() && !GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE))
|
||||
if (!GetPlayer()->IsGameMaster() && !GetPlayer()->HasOpenStableAura())
|
||||
{
|
||||
LOG_DEBUG("network.opcode", "Player ({}) attempt open stable in cheating way.", guid.ToString());
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -633,7 +633,7 @@ void WorldSession::HandleSelfResOpcode(WorldPacket& /*recvData*/)
|
|||
|
||||
if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(_player->GetUInt32Value(PLAYER_SELF_RES_SPELL)))
|
||||
{
|
||||
if (_player->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION) && !spell->HasAttribute(SPELL_ATTR7_BYPASS_NO_RESURRECTION_AURA))
|
||||
if (_player->HasPreventResurectionAura() && !spell->HasAttribute(SPELL_ATTR7_BYPASS_NO_RESURRECTION_AURA))
|
||||
{
|
||||
return; // silent return, client should display error by itself and not send this opcode
|
||||
}
|
||||
|
|
@ -672,7 +672,7 @@ void WorldSession::HandleMirrorImageDataRequest(WorldPacket& recvData)
|
|||
if (!unit)
|
||||
return;
|
||||
|
||||
if (!unit->HasAuraType(SPELL_AURA_CLONE_CASTER))
|
||||
if (!unit->HasCloneCasterAura())
|
||||
return;
|
||||
|
||||
// Get creator of the unit (SPELL_AURA_CLONE_CASTER does not stack)
|
||||
|
|
|
|||
|
|
@ -595,7 +595,7 @@ void WorldSession::LogoutPlayer(bool save)
|
|||
_player->BuildPlayerRepop();
|
||||
_player->RepopAtGraveyard();
|
||||
}
|
||||
else if (_player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
else if (_player->HasSpiritOfRedemptionAura())
|
||||
{
|
||||
// this will kill character by SPELL_AURA_SPIRIT_OF_REDEMPTION
|
||||
_player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
|
||||
|
|
@ -1019,7 +1019,7 @@ void WorldSession::ReadMovementInfo(WorldPacket& data, MovementInfo* mi)
|
|||
MOVEMENTFLAG_ROOT);
|
||||
|
||||
//! Cannot hover without SPELL_AURA_HOVER
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && !GetPlayer()->HasAuraType(SPELL_AURA_HOVER),
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && !GetPlayer()->HasHoverAura(),
|
||||
MOVEMENTFLAG_HOVER);
|
||||
|
||||
//! Cannot ascend and descend at the same time
|
||||
|
|
@ -1044,12 +1044,12 @@ void WorldSession::ReadMovementInfo(WorldPacket& data, MovementInfo* mi)
|
|||
|
||||
//! Cannot walk on water without SPELL_AURA_WATER_WALK
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_WATERWALKING) &&
|
||||
!GetPlayer()->HasAuraType(SPELL_AURA_WATER_WALK) &&
|
||||
!GetPlayer()->HasAuraType(SPELL_AURA_GHOST),
|
||||
!GetPlayer()->HasWaterWalkAura() &&
|
||||
!GetPlayer()->HasGhostAura(),
|
||||
MOVEMENTFLAG_WATERWALKING);
|
||||
|
||||
//! Cannot feather fall without SPELL_AURA_FEATHER_FALL
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FALLING_SLOW) && !GetPlayer()->HasAuraType(SPELL_AURA_FEATHER_FALL),
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FALLING_SLOW) && !GetPlayer()->HasFeatherFallAura(),
|
||||
MOVEMENTFLAG_FALLING_SLOW);
|
||||
|
||||
/*! Cannot fly if no fly auras present. Exception is being a GM.
|
||||
|
|
@ -1058,7 +1058,7 @@ void WorldSession::ReadMovementInfo(WorldPacket& data, MovementInfo* mi)
|
|||
e.g. aerial combat.
|
||||
*/
|
||||
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && GetSecurity() == SEC_PLAYER && !GetPlayer()->m_mover->HasAuraType(SPELL_AURA_FLY) && !GetPlayer()->m_mover->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED),
|
||||
REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && GetSecurity() == SEC_PLAYER && !GetPlayer()->m_mover->HasFlyAura() && !GetPlayer()->m_mover->HasIncreaseMountedFlightSpeedAura(),
|
||||
MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY);
|
||||
|
||||
//! Cannot fly and fall at the same time
|
||||
|
|
|
|||
|
|
@ -1536,7 +1536,7 @@ void AuraEffect::HandleModInvisibilityDetect(AuraApplication const* aurApp, uint
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!target->HasAuraType(SPELL_AURA_MOD_INVISIBILITY_DETECT))
|
||||
if (!target->HasInvisibilityDetectAura())
|
||||
target->m_invisibilityDetect.DelFlag(type);
|
||||
|
||||
target->m_invisibilityDetect.AddValue(type, -GetAmount());
|
||||
|
|
@ -1565,7 +1565,7 @@ void AuraEffect::HandleModInvisibility(AuraApplication const* aurApp, uint8 mode
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!target->HasAuraType(SPELL_AURA_MOD_INVISIBILITY))
|
||||
if (!target->HasInvisibilityAura())
|
||||
{
|
||||
// if not have different invisibility auras.
|
||||
// always remove glow vision
|
||||
|
|
@ -1628,7 +1628,7 @@ void AuraEffect::HandleModStealthDetect(AuraApplication const* aurApp, uint8 mod
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!target->HasAuraType(SPELL_AURA_MOD_STEALTH_DETECT))
|
||||
if (!target->HasStealthDetectAura())
|
||||
target->m_stealthDetect.DelFlag(type);
|
||||
|
||||
target->m_stealthDetect.AddValue(type, -GetAmount());
|
||||
|
|
@ -1666,7 +1666,7 @@ void AuraEffect::HandleModStealth(AuraApplication const* aurApp, uint8 mode, boo
|
|||
{
|
||||
target->m_stealth.AddValue(type, -GetAmount());
|
||||
|
||||
if (!target->HasAuraType(SPELL_AURA_MOD_STEALTH)) // if last SPELL_AURA_MOD_STEALTH
|
||||
if (!target->HasStealthAura()) // if last SPELL_AURA_MOD_STEALTH
|
||||
{
|
||||
target->m_stealth.DelFlag(type);
|
||||
|
||||
|
|
@ -1723,7 +1723,7 @@ void AuraEffect::HandleDetectAmore(AuraApplication const* aurApp, uint8 mode, bo
|
|||
}
|
||||
else
|
||||
{
|
||||
if (target->HasAuraType(SPELL_AURA_DETECT_AMORE))
|
||||
if (target->HasDetectAmoreAura())
|
||||
{
|
||||
Unit::AuraEffectList const& amoreAuras = target->GetAuraEffectsByType(SPELL_AURA_DETECT_AMORE);
|
||||
for (AuraEffect const* aurEff : amoreAuras)
|
||||
|
|
@ -1790,7 +1790,7 @@ void AuraEffect::HandleAuraGhost(AuraApplication const* aurApp, uint8 mode, bool
|
|||
}
|
||||
else
|
||||
{
|
||||
if (target->HasAuraType(SPELL_AURA_GHOST))
|
||||
if (target->HasGhostAura())
|
||||
return;
|
||||
|
||||
target->ToPlayer()->RemovePlayerFlag(PLAYER_FLAGS_GHOST);
|
||||
|
|
@ -2025,7 +2025,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
|
|||
{
|
||||
// reset model id if no other auras present
|
||||
// may happen when aura is applied on linked event on aura removal
|
||||
if (!target->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT))
|
||||
if (!target->HasShapeshiftAura())
|
||||
{
|
||||
target->SetShapeshiftForm(FORM_NONE);
|
||||
if (target->IsClass(CLASS_DRUID, CLASS_CONTEXT_ABILITY))
|
||||
|
|
@ -2933,7 +2933,7 @@ void AuraEffect::HandleModUnattackable(AuraApplication const* aurApp, uint8 mode
|
|||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
|
||||
if (!apply && target->HasAuraType(SPELL_AURA_MOD_UNATTACKABLE))
|
||||
if (!apply && target->HasUnattackableAura())
|
||||
return;
|
||||
|
||||
target->ApplyModFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE, apply);
|
||||
|
|
@ -3035,7 +3035,7 @@ void AuraEffect::HandleAuraModSilence(AuraApplication const* aurApp, uint8 mode,
|
|||
else
|
||||
{
|
||||
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
|
||||
if (target->HasAuraType(SPELL_AURA_MOD_SILENCE) || target->HasAuraType(SPELL_AURA_MOD_PACIFY_SILENCE))
|
||||
if (target->HasSilenceAura() || target->HasPacifySilenceAura())
|
||||
return;
|
||||
|
||||
target->RemoveUnitFlag(UNIT_FLAG_SILENCED);
|
||||
|
|
@ -3057,7 +3057,7 @@ void AuraEffect::HandleAuraModPacify(AuraApplication const* aurApp, uint8 mode,
|
|||
else
|
||||
{
|
||||
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
|
||||
if (target->HasAuraType(SPELL_AURA_MOD_PACIFY) || target->HasAuraType(SPELL_AURA_MOD_PACIFY_SILENCE))
|
||||
if (target->HasPacifyAura() || target->HasPacifySilenceAura())
|
||||
return;
|
||||
target->RemoveUnitFlag(UNIT_FLAG_PACIFIED);
|
||||
}
|
||||
|
|
@ -3073,7 +3073,7 @@ void AuraEffect::HandleAuraModPacifyAndSilence(AuraApplication const* aurApp, ui
|
|||
if (!(apply))
|
||||
{
|
||||
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
|
||||
if (target->HasAuraType(SPELL_AURA_MOD_PACIFY_SILENCE))
|
||||
if (target->HasPacifySilenceAura())
|
||||
return;
|
||||
}
|
||||
HandleAuraModPacify(aurApp, mode, apply);
|
||||
|
|
@ -3094,7 +3094,7 @@ void AuraEffect::HandleAuraAllowOnlyAbility(AuraApplication const* aurApp, uint8
|
|||
else
|
||||
{
|
||||
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
|
||||
if (target->HasAuraType(SPELL_AURA_ALLOW_ONLY_ABILITY))
|
||||
if (target->HasAllowOnlyAbilityAura())
|
||||
return;
|
||||
target->ToPlayer()->RemovePlayerFlag(PLAYER_ALLOW_ONLY_ABILITY);
|
||||
}
|
||||
|
|
@ -3312,7 +3312,7 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode
|
|||
if (!apply)
|
||||
{
|
||||
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
|
||||
if (target->HasAuraType(GetAuraType()) || target->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
|
||||
if (target->HasAuraType(GetAuraType()) || target->HasIncreaseMountedFlightSpeedAura())
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3526,7 +3526,7 @@ void AuraEffect::HandlePreventFleeing(AuraApplication const* aurApp, uint8 mode,
|
|||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
// Since patch 3.0.2 this mechanic no longer affects fear effects. It will ONLY prevent humanoids from fleeing due to low health.
|
||||
if (target->IsPlayer() || !apply || target->HasAuraType(SPELL_AURA_MOD_FEAR))
|
||||
if (target->IsPlayer() || !apply || target->HasFearAura())
|
||||
return;
|
||||
/// @todo: find a way to cancel fleeing for assistance.
|
||||
/// Currently this will only stop creatures fleeing due to low health that could not find nearby allies to flee towards.
|
||||
|
|
@ -3721,7 +3721,7 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp,
|
|||
if (GetAuraType() == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)
|
||||
{
|
||||
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
|
||||
if (mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK && (apply || (!target->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !target->HasAuraType(SPELL_AURA_FLY))))
|
||||
if (mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK && (apply || (!target->HasIncreaseMountedFlightSpeedAura() && !target->HasFlyAura())))
|
||||
{
|
||||
target->SetCanFly(apply);
|
||||
|
||||
|
|
@ -5767,12 +5767,12 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
|||
}
|
||||
break;
|
||||
case 62061: // Festive Holiday Mount
|
||||
if (target->HasAuraType(SPELL_AURA_MOUNTED))
|
||||
if (target->HasMountedAura())
|
||||
{
|
||||
uint32 creatureEntry = 0;
|
||||
if (apply)
|
||||
{
|
||||
if (target->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
|
||||
if (target->HasIncreaseMountedFlightSpeedAura())
|
||||
creatureEntry = 24906;
|
||||
else
|
||||
creatureEntry = 15665;
|
||||
|
|
@ -5790,7 +5790,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
|||
}
|
||||
break;
|
||||
case FRESH_BREWFEST_HOPS: // Festive Brewfest Mount
|
||||
if (target->HasAuraType(SPELL_AURA_MOUNTED) && !target->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
|
||||
if (target->HasMountedAura() && !target->HasIncreaseMountedFlightSpeedAura())
|
||||
{
|
||||
uint32 creatureEntry = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -3105,7 +3105,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
|
|||
// Xinef: Do not increase diminishing level for self cast
|
||||
m_diminishGroup = GetDiminishingReturnsGroupForSpell(m_spellInfo, m_triggeredByAuraSpell.spellInfo);
|
||||
// xinef: do not increase diminish level for bosses (eg. Void Reaver silence is never diminished)
|
||||
if (((m_spellFlags & SPELL_FLAG_REFLECTED) && !(unit->HasAuraType(SPELL_AURA_REFLECT_SPELLS))) || (aura_effmask && m_diminishGroup && unit != m_caster && (!m_caster->IsCreature() || !m_caster->ToCreature()->isWorldBoss())))
|
||||
if (((m_spellFlags & SPELL_FLAG_REFLECTED) && !(unit->HasReflectSpellsAura())) || (aura_effmask && m_diminishGroup && unit != m_caster && (!m_caster->IsCreature() || !m_caster->ToCreature()->isWorldBoss())))
|
||||
{
|
||||
m_diminishLevel = unit->GetDiminishing(m_diminishGroup);
|
||||
DiminishingReturnsType type = GetDiminishingReturnsGroupType(m_diminishGroup);
|
||||
|
|
|
|||
|
|
@ -3498,7 +3498,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
|
|||
|
||||
// Glyph of Blood Strike
|
||||
if (m_caster->GetAuraEffect(59332, EFFECT_0))
|
||||
if (unitTarget->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED))
|
||||
if (unitTarget->HasDecreaseSpeedAura())
|
||||
AddPct(totalDamagePercentMod, 20.0f);
|
||||
break;
|
||||
}
|
||||
|
|
@ -4199,7 +4199,7 @@ void Spell::EffectStuck(SpellEffIndex /*effIndex*/)
|
|||
// xinef: if player is dead - teleport to graveyard
|
||||
if (!target->IsAlive())
|
||||
{
|
||||
if (target->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
|
||||
if (target->HasPreventResurectionAura())
|
||||
return;
|
||||
|
||||
// xinef: player is in corpse
|
||||
|
|
|
|||
|
|
@ -1777,7 +1777,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta
|
|||
// only spells with SPELL_ATTR3_ONLY_ON_GHOSTS can target ghosts
|
||||
if (IsRequiringDeadTarget())
|
||||
{
|
||||
if (!unitTarget->HasAuraType(SPELL_AURA_GHOST))
|
||||
if (!unitTarget->HasGhostAura())
|
||||
return SPELL_FAILED_TARGET_NOT_GHOST;
|
||||
if (!IsDeathPersistent() && !IsAllowingDeadTarget())
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
|
@ -1923,7 +1923,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta
|
|||
if (ExcludeTargetAuraSpell && unitTarget->HasAura(sSpellMgr->GetSpellIdForDifficulty(ExcludeTargetAuraSpell, caster)))
|
||||
return SPELL_FAILED_TARGET_AURASTATE;
|
||||
|
||||
if (unitTarget->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION) && !HasAttribute(SPELL_ATTR7_BYPASS_NO_RESURRECTION_AURA))
|
||||
if (unitTarget->HasPreventResurectionAura() && !HasAttribute(SPELL_ATTR7_BYPASS_NO_RESURRECTION_AURA))
|
||||
if (HasEffect(SPELL_EFFECT_SELF_RESURRECT) || HasEffect(SPELL_EFFECT_RESURRECT) || HasEffect(SPELL_EFFECT_RESURRECT_NEW))
|
||||
return SPELL_FAILED_TARGET_CANNOT_BE_RESURRECTED;
|
||||
|
||||
|
|
|
|||
|
|
@ -1111,10 +1111,10 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
|
|||
AreaTableEntry const* pArea = sAreaTableStore.LookupEntry(player->GetAreaId());
|
||||
if (!(pArea && pArea->flags & AREA_FLAG_NO_FLY_ZONE))
|
||||
return false;
|
||||
if (!player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !player->HasAuraType(SPELL_AURA_FLY))
|
||||
if (!player->HasIncreaseMountedFlightSpeedAura() && !player->HasFlyAura())
|
||||
return false;
|
||||
// Xinef: Underbelly elixir
|
||||
if (player->GetPositionZ() < 637.0f && player->HasAuraType(SPELL_AURA_TRANSFORM))
|
||||
if (player->GetPositionZ() < 637.0f && player->HasTransformAura())
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
|
@ -1124,7 +1124,7 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
|
|||
return false;
|
||||
|
||||
Battlefield* Bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetZoneId());
|
||||
if (!Bf || Bf->CanFlyIn() || (!player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !player->HasAuraType(SPELL_AURA_FLY)))
|
||||
if (!Bf || Bf->CanFlyIn() || (!player->HasIncreaseMountedFlightSpeedAura() && !player->HasFlyAura()))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ public:
|
|||
uint8 powerType = classEntry->powerType;
|
||||
|
||||
// reset m_form if no aura
|
||||
if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT))
|
||||
if (!player->HasShapeshiftAura())
|
||||
player->SetShapeshiftForm(FORM_NONE);
|
||||
|
||||
player->SetFactionForRace(player->getRace());
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ class spell_suppression_aura : public SpellScript
|
|||
targets.remove_if([&](WorldObject* target) -> bool
|
||||
{
|
||||
Unit* unit = target->ToUnit();
|
||||
return !unit || unit->HasAuraType(SPELL_AURA_MOD_STEALTH);
|
||||
return !unit || unit->HasStealthAura();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -725,7 +725,7 @@ struct npc_hallows_end_soh : public ScriptedAI
|
|||
bool checkBurningTriggers = false;
|
||||
for (ObjectGuid const& guid : unitList)
|
||||
if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
|
||||
if (c->HasAuraType(SPELL_AURA_PERIODIC_DUMMY))
|
||||
if (c->HasPeriodicDummyAura())
|
||||
{
|
||||
checkBurningTriggers = true;
|
||||
break;
|
||||
|
|
@ -743,7 +743,7 @@ struct npc_hallows_end_soh : public ScriptedAI
|
|||
bool failed = false;
|
||||
for (ObjectGuid const& guid : unitList)
|
||||
if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
|
||||
if (c->HasAuraType(SPELL_AURA_PERIODIC_DUMMY))
|
||||
if (c->HasPeriodicDummyAura())
|
||||
{
|
||||
failed = true;
|
||||
break;
|
||||
|
|
@ -791,7 +791,7 @@ struct npc_hallows_end_soh : public ScriptedAI
|
|||
{
|
||||
if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
|
||||
{
|
||||
if (!c->HasAuraType(SPELL_AURA_PERIODIC_DUMMY))
|
||||
if (!c->HasPeriodicDummyAura())
|
||||
{
|
||||
tmpList.push_back(c);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class spell_winter_wondervolt_trap : public SpellScript
|
|||
if (Player* target = GetHitPlayer())
|
||||
{
|
||||
// check presence
|
||||
if (target->HasAuraType(SPELL_AURA_TRANSFORM))
|
||||
if (target->HasTransformAura())
|
||||
return;
|
||||
|
||||
uint32 spellId = 0;
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ public:
|
|||
Map::PlayerList const& playerList = me->GetMap()->GetPlayers();
|
||||
for(Map::PlayerList::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
if (!player->IsGameMaster() && player->IsAlive() && me->GetHomePosition().GetExactDist2d(player) < 52.0f && me->IsWithinLOSInMap(player) && !player->HasAuraType(SPELL_AURA_MOD_INVISIBILITY) && !player->HasAuraType(SPELL_AURA_MOD_STEALTH) && !player->HasAuraType(SPELL_AURA_MOD_UNATTACKABLE))
|
||||
if (!player->IsGameMaster() && player->IsAlive() && me->GetHomePosition().GetExactDist2d(player) < 52.0f && me->IsWithinLOSInMap(player) && !player->HasInvisibilityAura() && !player->HasStealthAura() && !player->HasUnattackableAura())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ struct boss_faction_championsAI : public ScriptedAI
|
|||
{
|
||||
// check for stun, fear, etc.
|
||||
// for casting, silence, disarm check individually in the ai
|
||||
if (me->isFeared() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
if (me->HasFearAura() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
{
|
||||
if (!IsHeroic())
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -831,7 +831,7 @@ class spell_valkyr_touch_aura : public AuraScript
|
|||
Map::PlayerList const& pl = caster->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if (Player* plr = itr->GetSource())
|
||||
if (plr->IsAlive() && !plr->HasAura(excludedID) && !plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
if (plr->IsAlive() && !plr->HasAura(excludedID) && !plr->HasSpiritOfRedemptionAura())
|
||||
{
|
||||
uint32 absorb = 0;
|
||||
uint32 resist = 0;
|
||||
|
|
|
|||
|
|
@ -957,7 +957,7 @@ public:
|
|||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->isFeared() || me->IsCharmed() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->HasFearAura() || me->IsCharmed() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
|
|
@ -1065,7 +1065,7 @@ public:
|
|||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->isFeared() || me->IsCharmed() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->HasFearAura() || me->IsCharmed() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
|
|
@ -1219,7 +1219,7 @@ public:
|
|||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->isFeared() || me->IsCharmed() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->HasFearAura() || me->IsCharmed() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
|
|
@ -1324,7 +1324,7 @@ public:
|
|||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->isFeared() || me->IsCharmed() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->HasFearAura() || me->IsCharmed() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
|
|
@ -1418,7 +1418,7 @@ public:
|
|||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->isFeared() || me->IsCharmed() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->HasFearAura() || me->IsCharmed() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
|
|
@ -2152,7 +2152,7 @@ public:
|
|||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->isFeared() || me->IsCharmed() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->HasFearAura() || me->IsCharmed() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
return;
|
||||
|
||||
if (!leaped)
|
||||
|
|
@ -2211,7 +2211,7 @@ public:
|
|||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->isFeared() || me->IsCharmed() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->HasFearAura() || me->IsCharmed() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
|
|
@ -2280,7 +2280,7 @@ public:
|
|||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->isFeared() || me->IsCharmed() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->HasFearAura() || me->IsCharmed() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
|
|
|
|||
|
|
@ -443,7 +443,7 @@ public:
|
|||
{
|
||||
if (Unit* trapped = summ->GetSummonerUnit())
|
||||
{
|
||||
if (!trapped->IsOnVehicle(me) || !trapped->IsAlive() || !me->GetInstanceScript() || me->GetInstanceScript()->GetBossState(DATA_LORD_MARROWGAR) != IN_PROGRESS || trapped->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
if (!trapped->IsOnVehicle(me) || !trapped->IsAlive() || !me->GetInstanceScript() || me->GetInstanceScript()->GetBossState(DATA_LORD_MARROWGAR) != IN_PROGRESS || trapped->HasSpiritOfRedemptionAura())
|
||||
{
|
||||
DoAction(-1337);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ public:
|
|||
if (target->HasAura(SPELL_FROST_IMBUED_BLADE))
|
||||
return false;
|
||||
|
||||
if (target->IsImmunedToDamageOrSchool(SPELL_SCHOOL_MASK_ALL) || target->HasAura(SPELL_ICE_TOMB_UNTARGETABLE) || target->HasAura(SPELL_ICE_TOMB_DAMAGE) || target->HasAura(SPELL_TANK_MARKER_AURA) || target->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
if (target->IsImmunedToDamageOrSchool(SPELL_SCHOOL_MASK_ALL) || target->HasAura(SPELL_ICE_TOMB_UNTARGETABLE) || target->HasAura(SPELL_ICE_TOMB_DAMAGE) || target->HasAura(SPELL_TANK_MARKER_AURA) || target->HasSpiritOfRedemptionAura())
|
||||
return false;
|
||||
|
||||
return target != _source->GetVictim();
|
||||
|
|
|
|||
|
|
@ -1684,7 +1684,7 @@ public:
|
|||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->isFeared() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED) || ((me->GetEntry() == NPC_YMIRJAR_DEATHBRINGER || me->GetEntry() == NPC_YMIRJAR_FROSTBINDER) && me->HasUnitFlag(UNIT_FLAG_SILENCED)))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || me->HasFearAura() || me->isFrozen() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasUnitState(UNIT_STATE_CONFUSED) || ((me->GetEntry() == NPC_YMIRJAR_DEATHBRINGER || me->GetEntry() == NPC_YMIRJAR_FROSTBINDER) && me->HasUnitFlag(UNIT_FLAG_SILENCED)))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
|
|
|
|||
|
|
@ -1129,7 +1129,7 @@ public:
|
|||
DoMeleeAttackIfReady();
|
||||
|
||||
Unit* cannon = GetS3();
|
||||
if (!cannon || cannon->HasUnitState(UNIT_STATE_CASTING) || me->HasUnitState(UNIT_STATE_CASTING) || me->HasAuraType(SPELL_AURA_MOD_SILENCE))
|
||||
if (!cannon || cannon->HasUnitState(UNIT_STATE_CASTING) || me->HasUnitState(UNIT_STATE_CASTING) || me->HasSilenceAura())
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
|
|
|
|||
|
|
@ -2603,7 +2603,7 @@ class spell_yogg_saron_insane_periodic_trigger : public SpellScript
|
|||
{
|
||||
std::list<WorldObject*> tmplist;
|
||||
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
|
||||
if ((*itr)->IsPlayer() && !(*itr)->ToPlayer()->HasAuraType(SPELL_AURA_AOE_CHARM) && !(*itr)->ToPlayer()->HasAura(SPELL_SANITY))
|
||||
if ((*itr)->IsPlayer() && !(*itr)->ToPlayer()->HasAOECharmAura() && !(*itr)->ToPlayer()->HasAura(SPELL_SANITY))
|
||||
tmplist.push_back(*itr);
|
||||
|
||||
targets.clear();
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@ public:
|
|||
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
if (switching || me->HasAuraType(SPELL_AURA_CONTROL_VEHICLE))
|
||||
if (switching || me->HasControlVehicleAura())
|
||||
return;
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -597,7 +597,7 @@ struct npc_pet_gen_wind_rider_cub : public NullCreatureAI
|
|||
checkTimer2 = 0;
|
||||
if (Unit* owner = me->GetOwner())
|
||||
{
|
||||
if (owner->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || owner->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED))
|
||||
if (owner->HasIncreaseMountedFlightSpeedAura() || owner->HasIncreaseMountedSpeedAura())
|
||||
{
|
||||
isFlying = true;
|
||||
me->SetCanFly(true);
|
||||
|
|
|
|||
|
|
@ -1373,7 +1373,7 @@ class spell_dk_death_grip : public SpellScript
|
|||
float casterZ = GetCaster()->GetPositionZ(); // for Ring of Valor
|
||||
WorldLocation gripPos = *GetExplTargetDest();
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (!target->HasAuraType(SPELL_AURA_DEFLECT_SPELLS) || target->HasUnitState(UNIT_STATE_STUNNED)) // Deterrence
|
||||
if (!target->HasDetectSpellsAura() || target->HasUnitState(UNIT_STATE_STUNNED)) // Deterrence
|
||||
{
|
||||
if (target != GetCaster())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -517,7 +517,7 @@ class spell_gen_grow_flower_patch : public SpellScript
|
|||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
if (GetCaster()->HasAuraType(SPELL_AURA_MOD_STEALTH) || GetCaster()->HasAuraType(SPELL_AURA_MOD_INVISIBILITY))
|
||||
if (GetCaster()->HasStealthAura() || GetCaster()->HasInvisibilityAura())
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
|
|
|
|||
|
|
@ -2881,7 +2881,7 @@ class spell_item_reindeer_transformation : public SpellScript
|
|||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (caster->HasAuraType(SPELL_AURA_MOUNTED))
|
||||
if (caster->HasMountedAura())
|
||||
{
|
||||
float flyspeed = caster->GetSpeedRate(MOVE_FLIGHT);
|
||||
float speed = caster->GetSpeedRate(MOVE_RUN);
|
||||
|
|
@ -3172,7 +3172,7 @@ class spell_item_brewfest_mount_transformation : public SpellScript
|
|||
return;
|
||||
}
|
||||
|
||||
if (caster->HasAuraType(SPELL_AURA_MOUNTED))
|
||||
if (caster->HasMountedAura())
|
||||
{
|
||||
caster->RemoveAurasByType(SPELL_AURA_MOUNTED);
|
||||
uint32 spell_id;
|
||||
|
|
|
|||
|
|
@ -1830,7 +1830,7 @@ class spell_q11010_q11102_q11023_aggro_check : public SpellScript
|
|||
{
|
||||
if (Player* playerTarget = GetHitPlayer())
|
||||
// Check if found player target is on fly mount or using flying form
|
||||
if (playerTarget->HasAuraType(SPELL_AURA_FLY) || playerTarget->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
|
||||
if (playerTarget->HasFlyAura() || playerTarget->HasIncreaseMountedFlightSpeedAura())
|
||||
playerTarget->CastSpell(playerTarget, SPELL_FLAK_CANNON_TRIGGER, TRIGGERED_FULL_MASK);
|
||||
}
|
||||
|
||||
|
|
@ -1873,7 +1873,7 @@ class spell_q11010_q11102_q11023_choose_loc : public SpellScript
|
|||
Cell::VisitWorldObjects(caster, searcher, 65.0f);
|
||||
for (std::list<Player*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
|
||||
// Check if found player target is on fly mount or using flying form
|
||||
if ((*itr)->HasAuraType(SPELL_AURA_FLY) || (*itr)->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
|
||||
if ((*itr)->HasFlyAura() || (*itr)->HasIncreaseMountedFlightSpeedAura())
|
||||
// Summom Fel Cannon (bunny version) at found player
|
||||
caster->SummonCreature(NPC_FEL_CANNON2, (*itr)->GetPositionX(), (*itr)->GetPositionY(), (*itr)->GetPositionZ());
|
||||
}
|
||||
|
|
@ -1894,7 +1894,7 @@ class spell_q11010_q11102_q11023_q11008_check_fly_mount : public SpellScript
|
|||
{
|
||||
Unit* caster = GetCaster();
|
||||
// This spell will be cast only if caster has one of these auras
|
||||
if (!(caster->HasAuraType(SPELL_AURA_FLY) || caster->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)))
|
||||
if (!(caster->HasFlyAura() || caster->HasIncreaseMountedFlightSpeedAura()))
|
||||
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue