mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
fix(Core/Spells): Mind Control can be dispelled from friendly target. (#9689)
Fixes #9629
This commit is contained in:
@@ -5113,7 +5113,7 @@ void Unit::GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelCharges
|
||||
if (dispelMask & (1 << DISPEL_DISEASE) && HasAura(50536))
|
||||
dispelMask &= ~(1 << DISPEL_DISEASE);
|
||||
|
||||
ReputationRank rank = GetReactionTo(caster);
|
||||
ReputationRank rank = GetReactionTo(caster, IsCharmed());
|
||||
bool positive = rank >= REP_FRIENDLY;
|
||||
|
||||
// Neutral unit not at war with caster should be treated as a friendly unit
|
||||
@@ -9514,7 +9514,7 @@ void Unit::SetFaction(uint32 faction)
|
||||
}
|
||||
|
||||
// function based on function Unit::UnitReaction from 13850 client
|
||||
ReputationRank Unit::GetReactionTo(Unit const* target) const
|
||||
ReputationRank Unit::GetReactionTo(Unit const* target, bool checkOriginalFaction /*= false*/) const
|
||||
{
|
||||
// always friendly to self
|
||||
if (this == target)
|
||||
@@ -9596,11 +9596,42 @@ ReputationRank Unit::GetReactionTo(Unit const* target) const
|
||||
}
|
||||
|
||||
ReputationRank repRank = REP_HATED;
|
||||
|
||||
if (!sScriptMgr->IfNormalReaction(this, target, repRank))
|
||||
{
|
||||
return ReputationRank(repRank);
|
||||
}
|
||||
|
||||
FactionTemplateEntry const* factionTemplateEntry = nullptr;
|
||||
if (checkOriginalFaction)
|
||||
{
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(getRace()))
|
||||
{
|
||||
factionTemplateEntry = sFactionTemplateStore.LookupEntry(rEntry->FactionID);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Unit* owner = GetOwner();
|
||||
if (HasUnitTypeMask(UNIT_MASK_MINION) && owner)
|
||||
{
|
||||
factionTemplateEntry = sFactionTemplateStore.LookupEntry(owner->GetFaction());
|
||||
}
|
||||
else if (CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate())
|
||||
{
|
||||
factionTemplateEntry = sFactionTemplateStore.LookupEntry(cinfo->faction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!factionTemplateEntry)
|
||||
{
|
||||
factionTemplateEntry = GetFactionTemplateEntry();
|
||||
}
|
||||
|
||||
// do checks dependant only on our faction
|
||||
return GetFactionReactionTo(GetFactionTemplateEntry(), target);
|
||||
return GetFactionReactionTo(factionTemplateEntry, target);
|
||||
}
|
||||
|
||||
ReputationRank Unit::GetFactionReactionTo(FactionTemplateEntry const* factionTemplateEntry, Unit const* target) const
|
||||
|
||||
Reference in New Issue
Block a user