diff options
author | QAston <none@none> | 2009-05-24 15:36:15 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-05-24 15:36:15 +0200 |
commit | 1b2579a2abd8dea7d728333706b57cd8b23e0936 (patch) | |
tree | fcf8194d4f4d77c8d479626ba49d7f1c0c5b0d69 /src | |
parent | 74770dbcf6b04dbaa2fbf6ea3d47d6daa3f8b4db (diff) |
Ancestral Awakening target selection
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Spell.cpp | 40 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 10 |
2 files changed, 29 insertions, 21 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index b31c31e795c..d33266a2d37 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -82,7 +82,7 @@ struct PrioritizeMana { int operator()( PrioritizeManaWraper const& x, PrioritizeManaWraper const& y ) const { - return x.percentMana < y.percentMana; + return x.percentMana > y.percentMana; } }; @@ -106,7 +106,7 @@ struct PrioritizeHealth { int operator()( PrioritizeHealthWraper const& x, PrioritizeHealthWraper const& y ) const { - return x.percentHealth < y.percentHealth; + return x.percentHealth > y.percentHealth; } }; @@ -2277,11 +2277,15 @@ void Spell::SetTargetMap(uint32 i, uint32 cur) if(m_spellInfo->Id == 5246) //Intimidating Shout unitList.remove(m_targets.getUnitTarget()); - else if (m_spellInfo->Id==57699) //Replenishment (special target selection) 10 targets with lowest mana + Trinity::RandomResizeList(unitList, m_spellValue->MaxAffectedTargets); + } + else + { + if (m_spellInfo->Id==57699) //Replenishment (special target selection) 10 targets with lowest mana { typedef std::priority_queue<PrioritizeManaWraper, std::vector<PrioritizeManaWraper>, PrioritizeMana> TopMana; TopMana manaUsers; - for (std::list<Unit*>::iterator itr = unitList.begin() ; itr != unitList.end() && manaUsers.size() <=m_spellValue->MaxAffectedTargets;++itr) + for (std::list<Unit*>::iterator itr = unitList.begin() ; itr != unitList.end();++itr) { if ((*itr)->getPowerType() == POWER_MANA) { @@ -2291,19 +2295,35 @@ void Spell::SetTargetMap(uint32 i, uint32 cur) } unitList.clear(); - while(!manaUsers.empty()) + while(!manaUsers.empty() && unitList.size()<10) { unitList.push_back(manaUsers.top().getUnit()); manaUsers.pop(); } } + else if (m_spellInfo->Id==52759)// Ancestral Awakening + { + typedef std::priority_queue<PrioritizeHealthWraper, std::vector<PrioritizeHealthWraper>, PrioritizeHealth> TopHealth; + TopHealth healedMembers; + for (std::list<Unit*>::iterator itr = unitList.begin() ; itr != unitList.end();++itr) + { + PrioritizeHealthWraper WTarget(*itr); + healedMembers.push(WTarget); + } + + unitList.clear(); + while(!healedMembers.empty() && unitList.size()<1) + { + unitList.push_back(healedMembers.top().getUnit()); + healedMembers.pop(); + } + } else if (m_spellInfo->EffectImplicitTargetA[i] == TARGET_DEST_TARGET_ANY - && m_spellInfo->EffectImplicitTargetB[i] == TARGET_UNIT_AREA_ALLY_DST)// Wild Growth, Circle of Healing target special selection - // TODO: is Ancestral Awakening implemented? + && m_spellInfo->EffectImplicitTargetB[i] == TARGET_UNIT_AREA_ALLY_DST)// Wild Growth, Circle of Healing, Glyph of holy light target special selection { typedef std::priority_queue<PrioritizeHealthWraper, std::vector<PrioritizeHealthWraper>, PrioritizeHealth> TopHealth; TopHealth healedMembers; - for (std::list<Unit*>::iterator itr = unitList.begin() ; itr != unitList.end() && healedMembers.size() <=m_spellValue->MaxAffectedTargets;++itr) + for (std::list<Unit*>::iterator itr = unitList.begin() ; itr != unitList.end();++itr) { if ((*itr)->IsInRaidWith(m_targets.getUnitTarget())) { @@ -2313,15 +2333,13 @@ void Spell::SetTargetMap(uint32 i, uint32 cur) } unitList.clear(); - while(!healedMembers.empty()) + while(!healedMembers.empty() && unitList.size()<5) { unitList.push_back(healedMembers.top().getUnit()); healedMembers.pop(); } } - Trinity::RandomResizeList(unitList, m_spellValue->MaxAffectedTargets); } - for(std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr) AddUnitTarget(*itr, i); } diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 8a944ea972f..a859a672c9e 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -3247,7 +3247,6 @@ void SpellMgr::LoadSpellCustomAttr() case 37676: // Insidious Whisper case 46009: // Negative Energy case 45641: // Fire Bloom - case 54937: // Glyph of Holy Light case 55665: // Life Drain - Sapphiron (H) case 28796: // Poison Bolt Volly - Faerlina spellInfo->MaxAffectedTargets = 5; @@ -3256,7 +3255,6 @@ void SpellMgr::LoadSpellCustomAttr() case 40859: // Sinister Beam case 40860: // Vile Beam case 40861: // Wicked Beam - case 57669: // Replenishment case 54835: // Curse of the Plaguebringer - Noth (H) case 54098: // Poison Bolt Volly - Faerlina (H) spellInfo->MaxAffectedTargets = 10; @@ -3301,14 +3299,6 @@ void SpellMgr::LoadSpellCustomAttr() // Starfall AOE Damage else if(spellInfo->SpellFamilyFlags[2] & 0x800000) mSpellCustomAttr[i] |= SPELL_ATTR_CU_EXCLUDE_SELF; - // Wild growth - else if(spellInfo->SpellFamilyFlags[1] & 0x4000000) - spellInfo->MaxAffectedTargets = 5; - break; - // circle of healing - case SPELLFAMILY_PRIEST: - if(spellInfo->SpellFamilyFlags[0] & 0x10000000) - spellInfo->MaxAffectedTargets = 5; break; } } |