diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 9f47254e4..648552d36 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1737,6 +1737,33 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap) TagUnitMap.push_back(pet); } } + if (m_spellInfo->Id==52759) //Ancestral Awakening (special target selection) + { + float lowestPerc = (float)m_caster->GetHealth() / (float)m_caster->GetMaxHealth(); + Unit* lowestTarget = m_caster; + + if (pGroup) + { + Group::MemberSlotList const& members = pGroup->GetMemberSlots(); + Group::MemberSlotList::const_iterator itr = members.begin(); + for(; itr != members.end(); ++itr) + { + if (Unit* member = ObjectAccessor::GetPlayer(*m_caster, (*itr).guid)) + { + if (member == m_caster || member->isDead() || m_caster->IsHostileTo(member) || !m_caster->IsWithinDistInMap(member, radius)) + continue; + + float perc = (float)member->GetHealth() / (float)member->GetMaxHealth(); + if (perc <= lowestPerc) + { + lowestPerc = perc; + lowestTarget = member; + } + } + } + } + TagUnitMap.push_back(lowestTarget); + } else { if(pGroup) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 06ebd13e9..2b5846e00 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1138,6 +1138,11 @@ void Spell::EffectDummy(uint32 i) } return; } + case 52759: // Ancestral Awakening + if (!unitTarget) + return; + m_caster->CastCustomSpell(unitTarget, 52752, &damage, NULL, NULL, true); + return; case 53341: case 53343: { diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 70a76429e..1e4adbab1 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -5812,7 +5812,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu // Ancestral Awakening if (dummySpell->SpellIconID == 3065) { - // TODO: frite dummy fot triggered spell triggered_spell_id = 52759; basepoints0 = triggerAmount * damage / 100; target = this; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index d762c9584..52a8002a7 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7875" + #define REVISION_NR "7876" #endif // __REVISION_NR_H__