mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 09:03:47 +00:00
Merge branch 'azerothcore:master' into Playerbot
This commit is contained in:
@@ -1863,7 +1863,9 @@ bool WorldObject::CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
|
||||
return false;
|
||||
|
||||
if (!CanDetect(obj, ignoreStealth, !distanceCheck, checkAlert))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1890,7 +1892,9 @@ bool WorldObject::CanDetect(WorldObject const* obj, bool ignoreStealth, bool che
|
||||
if (!ignoreStealth)
|
||||
{
|
||||
if (!seer->CanDetectInvisibilityOf(obj)) // xinef: added ignoreStealth, allow AoE spells to hit invisible targets!
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!seer->CanDetectStealthOf(obj, checkAlert))
|
||||
{
|
||||
@@ -1923,11 +1927,32 @@ bool WorldObject::CanDetectInvisibilityOf(WorldObject const* obj) const
|
||||
// It seems like that only Units are affected by this check (couldn't see arena doors with preparation invisibility)
|
||||
if (obj->ToUnit())
|
||||
{
|
||||
uint32 objMask = m_invisibility.GetFlags() & obj->m_invisibilityDetect.GetFlags();
|
||||
// xinef: include invisible flags of caster in the mask, 2 invisible objects should be able to detect eachother
|
||||
objMask |= m_invisibility.GetFlags() & obj->m_invisibility.GetFlags();
|
||||
if (objMask != m_invisibility.GetFlags())
|
||||
return false;
|
||||
// Permanently invisible creatures should be able to engage non-invisible targets.
|
||||
// ex. Skulking Witch (20882) / Greater Invisibility (16380)
|
||||
bool isPermInvisibleCreature = false;
|
||||
if (Creature const* baseObj = ToCreature())
|
||||
{
|
||||
auto auraEffects = baseObj->GetAuraEffectsByType(SPELL_AURA_MOD_INVISIBILITY);
|
||||
for (auto const effect : auraEffects)
|
||||
{
|
||||
if (SpellInfo const* spell = effect->GetSpellInfo())
|
||||
{
|
||||
if (spell->GetMaxDuration() == -1)
|
||||
{
|
||||
isPermInvisibleCreature = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isPermInvisibleCreature)
|
||||
{
|
||||
uint32 objMask = m_invisibility.GetFlags() & obj->m_invisibilityDetect.GetFlags();
|
||||
// xinef: include invisible flags of caster in the mask, 2 invisible objects should be able to detect eachother
|
||||
objMask |= m_invisibility.GetFlags() & obj->m_invisibility.GetFlags();
|
||||
if (objMask != m_invisibility.GetFlags())
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (uint32 i = 0; i < TOTAL_INVISIBILITY_TYPES; ++i)
|
||||
|
||||
@@ -15144,7 +15144,7 @@ void Player::ActivateSpec(uint8 spec)
|
||||
for (AuraList::iterator iter = scAuras.begin(); iter != scAuras.end();)
|
||||
{
|
||||
Aura* aura = *iter;
|
||||
if (!HasActiveSpell(aura->GetId()) && !HasTalent(aura->GetId(), GetActiveSpec()))
|
||||
if (!HasActiveSpell(aura->GetId()) && !HasTalent(aura->GetId(), GetActiveSpec()) && !aura->GetCastItemGUID())
|
||||
{
|
||||
aura->Remove();
|
||||
iter = scAuras.begin();
|
||||
|
||||
@@ -13490,7 +13490,7 @@ void Unit::Dismount()
|
||||
if (Player* player = ToPlayer())
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(player);
|
||||
|
||||
ToPlayer()->SetCanTeleport(true);
|
||||
if (Pet* pPet = player->GetPet())
|
||||
{
|
||||
if (pPet->HasUnitFlag(UNIT_FLAG_STUNNED) && !pPet->HasUnitState(UNIT_STATE_STUNNED))
|
||||
|
||||
Reference in New Issue
Block a user