[7876] Implemented dummy effect and special target selection for 52759.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-05-22 20:30:48 +02:00
parent dad833fd3e
commit e0e5ed7bd8
4 changed files with 33 additions and 2 deletions

View file

@ -1737,6 +1737,33 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
TagUnitMap.push_back(pet); 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 else
{ {
if(pGroup) if(pGroup)

View file

@ -1138,6 +1138,11 @@ void Spell::EffectDummy(uint32 i)
} }
return; return;
} }
case 52759: // Ancestral Awakening
if (!unitTarget)
return;
m_caster->CastCustomSpell(unitTarget, 52752, &damage, NULL, NULL, true);
return;
case 53341: case 53341:
case 53343: case 53343:
{ {

View file

@ -5812,7 +5812,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Ancestral Awakening // Ancestral Awakening
if (dummySpell->SpellIconID == 3065) if (dummySpell->SpellIconID == 3065)
{ {
// TODO: frite dummy fot triggered spell
triggered_spell_id = 52759; triggered_spell_id = 52759;
basepoints0 = triggerAmount * damage / 100; basepoints0 = triggerAmount * damage / 100;
target = this; target = this;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7875" #define REVISION_NR "7876"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__