[11413] Extend dummy effect for spell 52369 and 52371

Search for gameobject near target and respawn if not already spawned.
Att. DB devs: gameobject should be added to database, with negative spawntimesecs.

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2011-05-01 16:48:44 +02:00
parent f076575a7b
commit d8ea895a20
2 changed files with 21 additions and 1 deletions

View file

@ -1994,6 +1994,26 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
// Cosmetic - Explosion
unitTarget->CastSpell(unitTarget, 46419, true);
// look for gameobjects within max spell range of unitTarget, and respawn if found
std::list<GameObject*> lList;
float fMaxDist = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
MaNGOS::GameObjectEntryInPosRangeCheck go_check(*unitTarget, 182071, unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), fMaxDist);
MaNGOS::GameObjectListSearcher<MaNGOS::GameObjectEntryInPosRangeCheck> checker(lList, go_check);
Cell::VisitGridObjects(unitTarget, checker, fMaxDist);
for(std::list<GameObject*>::iterator iter = lList.begin(); iter != lList.end(); ++iter)
{
if (!(*iter)->isSpawned())
{
(*iter)->SetRespawnTime(MINUTE/2);
(*iter)->Refresh();
}
}
return;
}
case 52759: // Ancestral Awakening

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11412"
#define REVISION_NR "11413"
#endif // __REVISION_NR_H__