Fix Huhuran's wyvern sting and poison bolt target selection

This commit is contained in:
Cgbd
2017-04-05 00:13:03 +02:00
parent 9de64e998c
commit 74facb367c
2 changed files with 13 additions and 11 deletions
+11 -6
View File
@@ -1727,13 +1727,9 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
case 28542: // Life Drain (Naxx, Sapphiron)
unMaxTargets = 2;
break;
case 26180: // Wyvern Sting (AQ40, Princess Huhuran)
case 28796: // Poison Bolt Volley (Naxx, Faerlina)
unMaxTargets = 10;
break;
case 25991: // Poison Bolt Volley (AQ40, Princess Huhuran)
unMaxTargets = 15;
break;
}
break;
}
@@ -1769,11 +1765,20 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
switch (m_spellInfo->SpellFamilyName)
{
case SPELLFAMILY_GENERIC:
{
switch (m_spellInfo->Id)
{
case 26052: // Poison Bolt Volley (AQ40, Princess Huhuran)
SelectClosestTargets = true;
break;
}
break;
}
case SPELLFAMILY_HUNTER:
{
switch (m_spellInfo->Id)
{
case 26180: // Wyvern Sting (AQ40, Princess Huhuran)
case 25991: // Poison Bolt Volley (AQ40, Princess Huhuran)
SelectClosestTargets = true;
break;
}
@@ -2019,7 +2024,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
targetUnitMap.erase(itr);
}
}
if (SelectClosestTargets && targetUnitMap.size() > unMaxTargets)
if (SelectClosestTargets && unMaxTargets && targetUnitMap.size() > unMaxTargets)
{
targetUnitMap.sort(TargetDistanceOrderNear(m_caster));
UnitList::iterator itr = targetUnitMap.begin();
@@ -92,11 +92,8 @@ struct boss_huhuranAI : public ScriptedAI
// Wyvern Timer
if (Wyvern_Timer < diff)
{
if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0, SPELL_WYVERNSTING, SELECT_FLAG_IN_MELEE_RANGE))
{
if (DoCastSpellIfCan(target, SPELL_WYVERNSTING) == CAST_OK)
Wyvern_Timer = urand(15000, 32000);
}
if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_WYVERNSTING) == CAST_OK)
Wyvern_Timer = urand(15000, 32000);
}
else Wyvern_Timer -= diff;