mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 07:48:02 +00:00
fix(Core/Spells): Polymorphed targets should call assistance. (#8674)
Fixes #8413
This commit is contained in:
@@ -2192,9 +2192,14 @@ void Creature::SendAIReaction(AiReaction reactionType)
|
|||||||
LOG_DEBUG("network", "WORLD: Sent SMSG_AI_REACTION, type %u.", reactionType);
|
LOG_DEBUG("network", "WORLD: Sent SMSG_AI_REACTION, type %u.", reactionType);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature::CallAssistance()
|
void Creature::CallAssistance(Unit* target /*= nullptr*/)
|
||||||
{
|
{
|
||||||
if (!m_AlreadyCallAssistance && GetVictim() && !IsPet() && !IsCharmed())
|
if (!target)
|
||||||
|
{
|
||||||
|
target = GetVictim();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_AlreadyCallAssistance && target && !IsPet() && !IsCharmed())
|
||||||
{
|
{
|
||||||
SetNoCallAssistance(true);
|
SetNoCallAssistance(true);
|
||||||
|
|
||||||
@@ -2204,13 +2209,13 @@ void Creature::CallAssistance()
|
|||||||
{
|
{
|
||||||
std::list<Creature*> assistList;
|
std::list<Creature*> assistList;
|
||||||
|
|
||||||
Acore::AnyAssistCreatureInRangeCheck u_check(this, GetVictim(), radius);
|
Acore::AnyAssistCreatureInRangeCheck u_check(this, target, radius);
|
||||||
Acore::CreatureListSearcher<Acore::AnyAssistCreatureInRangeCheck> searcher(this, assistList, u_check);
|
Acore::CreatureListSearcher<Acore::AnyAssistCreatureInRangeCheck> searcher(this, assistList, u_check);
|
||||||
Cell::VisitGridObjects(this, searcher, radius);
|
Cell::VisitGridObjects(this, searcher, radius);
|
||||||
|
|
||||||
if (!assistList.empty())
|
if (!assistList.empty())
|
||||||
{
|
{
|
||||||
AssistDelayEvent* e = new AssistDelayEvent(GetVictim()->GetGUID(), this);
|
AssistDelayEvent* e = new AssistDelayEvent(target->GetGUID(), this);
|
||||||
while (!assistList.empty())
|
while (!assistList.empty())
|
||||||
{
|
{
|
||||||
// Pushing guids because in delay can happen some creature gets despawned => invalid pointer
|
// Pushing guids because in delay can happen some creature gets despawned => invalid pointer
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ public:
|
|||||||
|
|
||||||
void DoFleeToGetAssistance();
|
void DoFleeToGetAssistance();
|
||||||
void CallForHelp(float fRadius);
|
void CallForHelp(float fRadius);
|
||||||
void CallAssistance();
|
void CallAssistance(Unit* target = nullptr);
|
||||||
void SetNoCallAssistance(bool val) { m_AlreadyCallAssistance = val; }
|
void SetNoCallAssistance(bool val) { m_AlreadyCallAssistance = val; }
|
||||||
void SetNoSearchAssistance(bool val) { m_AlreadySearchedAssistance = val; }
|
void SetNoSearchAssistance(bool val) { m_AlreadySearchedAssistance = val; }
|
||||||
bool HasSearchedAssistance() { return m_AlreadySearchedAssistance; }
|
bool HasSearchedAssistance() { return m_AlreadySearchedAssistance; }
|
||||||
|
|||||||
@@ -1355,6 +1355,11 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
|||||||
else
|
else
|
||||||
caster->CastSpell(target, 61634, true);
|
caster->CastSpell(target, 61634, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Creature* creatureTarget = target->ToCreature())
|
||||||
|
{
|
||||||
|
creatureTarget->CallAssistance(caster);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
switch (GetId())
|
switch (GetId())
|
||||||
{
|
{
|
||||||
@@ -1558,6 +1563,15 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SPELLFAMILY_MAGE:
|
case SPELLFAMILY_MAGE:
|
||||||
|
{
|
||||||
|
// Polymorph
|
||||||
|
if (GetSpellInfo()->SpellFamilyFlags[0] & 0x01000000)
|
||||||
|
{
|
||||||
|
if (Creature* creatureTarget = target->ToCreature())
|
||||||
|
{
|
||||||
|
creatureTarget->SetNoCallAssistance(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
switch (GetId())
|
switch (GetId())
|
||||||
{
|
{
|
||||||
case 66: // Invisibility
|
case 66: // Invisibility
|
||||||
@@ -1570,12 +1584,12 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
|||||||
// Remove the IGNORE_AURASTATE aura
|
// Remove the IGNORE_AURASTATE aura
|
||||||
target->RemoveAurasDueToSpell(44544);
|
target->RemoveAurasDueToSpell(44544);
|
||||||
break;
|
break;
|
||||||
case 44401: //Missile Barrage
|
case 44401: // Missile Barrage
|
||||||
case 48108: //Hot Streak
|
case 48108: // Hot Streak
|
||||||
case 57761: //Fireball!
|
case 57761: // Fireball!
|
||||||
if (removeMode != AURA_REMOVE_BY_EXPIRE || aurApp->GetBase()->IsExpired())
|
if (removeMode != AURA_REMOVE_BY_EXPIRE || aurApp->GetBase()->IsExpired())
|
||||||
break;
|
break;
|
||||||
if (target->HasAura(70752)) //Item - Mage T10 2P Bonus
|
if (target->HasAura(70752)) // Item - Mage T10 2P Bonus
|
||||||
target->CastSpell(target, 70753, true);
|
target->CastSpell(target, 70753, true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -1594,6 +1608,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
|||||||
caster->CastSpell(target, 55080, true, nullptr, GetEffect(0));
|
caster->CastSpell(target, 55080, true, nullptr, GetEffect(0));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case SPELLFAMILY_WARRIOR:
|
case SPELLFAMILY_WARRIOR:
|
||||||
if (!caster)
|
if (!caster)
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user