diff options
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
4 files changed, 17 insertions, 60 deletions
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index 72ce2e1c0dd..aa5720bef4e 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -485,14 +485,9 @@ public: float x, y, z; me->GetPosition(x, y, z); - CellCoord pair(Trinity::ComputeCellCoord(x, y)); - Cell cell(pair); - cell.SetNoCreate(); - Trinity::AllCreaturesOfEntryInRange check(me, entry, 100); Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check); - TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher); - cell.Visit(pair, cSearcher, *(me->GetMap()), *me, me->GetGridActivationRange()); + Cell::VisitGridObjects(me, searcher, me->GetGridActivationRange()); for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i) { diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index b0e1c203c82..1ab0ea8908c 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -159,22 +159,10 @@ class boss_akilzon : public CreatureScript for (uint8 i = 2; i < StormCount; ++i) bp0 *= 2; - CellCoord p(Trinity::ComputeCellCoord(me->GetPositionX(), me->GetPositionY())); - Cell cell(p); - cell.SetNoCreate(); - std::list<Unit*> tempUnitMap; - - { - Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(me, me, SIZE_OF_GRIDS); - Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(me, tempUnitMap, u_check); - - TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher); - TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher); - - cell.Visit(p, world_unit_searcher, *me->GetMap(), *me, SIZE_OF_GRIDS); - cell.Visit(p, grid_unit_searcher, *me->GetMap(), *me, SIZE_OF_GRIDS); - } + Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(me, me, SIZE_OF_GRIDS); + Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(me, tempUnitMap, u_check); + Cell::VisitAllObjects(me, searcher, SIZE_OF_GRIDS); // deal damage for (std::list<Unit*>::const_iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index 56ce4193c5f..91978d052ad 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -234,18 +234,9 @@ class boss_janalai : public CreatureScript float x, y, z; me->GetPosition(x, y, z); - { - CellCoord pair(Trinity::ComputeCellCoord(x, y)); - Cell cell(pair); - cell.SetNoCreate(); - - Trinity::AllCreaturesOfEntryInRange check(me, NPC_EGG, 100); - Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check); - - TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher); - - cell.Visit(pair, cSearcher, *me->GetMap(), *me, me->GetGridActivationRange()); - } + Trinity::AllCreaturesOfEntryInRange check(me, NPC_EGG, 100); + Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check); + Cell::VisitGridObjects(me, searcher, me->GetGridActivationRange()); //TC_LOG_ERROR("scripts", "Eggs %d at middle", templist.size()); if (templist.empty()) @@ -267,22 +258,14 @@ class boss_janalai : public CreatureScript float x, y, z; me->GetPosition(x, y, z); - { - CellCoord pair(Trinity::ComputeCellCoord(x, y)); - Cell cell(pair); - cell.SetNoCreate(); - - Trinity::AllCreaturesOfEntryInRange check(me, NPC_FIRE_BOMB, 100); - Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check); - - TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher); + Trinity::AllCreaturesOfEntryInRange check(me, NPC_FIRE_BOMB, 100); + Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check); + Cell::VisitGridObjects(me, searcher, me->GetGridActivationRange()); - cell.Visit(pair, cSearcher, *me->GetMap(), *me, me->GetGridActivationRange()); - } for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i) { - (*i)->CastSpell(*i, SPELL_FIRE_BOMB_DAMAGE, true); - (*i)->RemoveAllAuras(); + (*i)->CastSpell(*i, SPELL_FIRE_BOMB_DAMAGE, true); + (*i)->RemoveAllAuras(); } } @@ -525,25 +508,16 @@ class npc_janalai_hatcher : public CreatureScript float x, y, z; me->GetPosition(x, y, z); - { - CellCoord pair(Trinity::ComputeCellCoord(x, y)); - Cell cell(pair); - cell.SetNoCreate(); - - Trinity::AllCreaturesOfEntryInRange check(me, 23817, 50); - Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check); - - TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher); - - cell.Visit(pair, cSearcher, *(me->GetMap()), *me, me->GetGridActivationRange()); - } + Trinity::AllCreaturesOfEntryInRange check(me, 23817, 50); + Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check); + Cell::VisitGridObjects(me, searcher, me->GetGridActivationRange()); //TC_LOG_ERROR("scripts", "Eggs %d at %d", templist.size(), side); for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end() && num > 0; ++i) if ((*i)->GetDisplayId() != 11686) { - (*i)->CastSpell(*i, SPELL_HATCH_EGG, false); + (*i)->CastSpell(*i, SPELL_HATCH_EGG, false); num--; } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp index 9711126dfcd..e2acc47d651 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp @@ -153,7 +153,7 @@ class boss_nalorakk : public CreatureScript Trinity::AllFriendlyCreaturesInGrid check(me); Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> searcher(me, tempList, check); - me->VisitNearbyGridObject(25.0f, searcher); + Cell::VisitGridObjects(me, searcher, 25.0f); if (tempList.empty()) return; |