aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2022-09-23 19:04:35 +0200
committerShauren <shauren.trinity@gmail.com>2022-09-23 19:04:35 +0200
commit63275e7316ad6b3256640841fdd8210c62b2c120 (patch)
treeff23bc6b43d57da056d42bb512ea3925303a9b75 /src
parent46560070ae610e4c85dfbbe37b24d2b4b4071405 (diff)
Dynamic build fix
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp12
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp20
2 files changed, 9 insertions, 23 deletions
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
index a9cfce056d2..ef93b2d9dad 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp
@@ -490,21 +490,21 @@ struct boss_felmyst : public BossAI
void DespawnSummons(uint32 entry)
{
+ std::vector<Position> unyieldingDeadPositions;
summons.DespawnIf([&](ObjectGuid guid)
{
if (guid.GetEntry() != entry)
return false;
if (guid.GetEntry() == NPC_VAPOR_TRAIL && phase == PHASE_FLIGHT)
- {
- Position const* pos = ObjectAccessor::GetCreature(*me, guid);
- if (!pos)
- pos = me;
+ if (Creature const* vapor = ObjectAccessor::GetCreature(*me, guid))
+ unyieldingDeadPositions.push_back(vapor->GetPosition());
- me->SummonCreature(NPC_DEAD, *pos, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5s);
- }
return true;
});
+
+ for (Position const& unyieldingDeadPosition : unyieldingDeadPositions)
+ me->SummonCreature(NPC_DEAD, unyieldingDeadPosition, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5s);
}
};
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
index ec661a69469..b7148b81caf 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
@@ -23,8 +23,6 @@ SDCategory: Zul'Aman
EndScriptData */
#include "ScriptMgr.h"
-#include "CellImpl.h"
-#include "GridNotifiers.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
@@ -234,12 +232,8 @@ class boss_janalai : public CreatureScript
bool HatchAllEggs(uint32 action) //1: reset, 2: isHatching all
{
std::list<Creature*> templist;
- float x, y, z;
- me->GetPosition(x, y, z);
- Trinity::AllCreaturesOfEntryInRange check(me, NPC_EGG, 100);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check);
- Cell::VisitGridObjects(me, searcher, me->GetGridActivationRange());
+ GetCreatureListWithEntryInGrid(templist, me, NPC_EGG, 100.0f);
//TC_LOG_ERROR("scripts", "Eggs %d at middle", templist.size());
if (templist.empty())
@@ -258,12 +252,8 @@ class boss_janalai : public CreatureScript
void Boom()
{
std::list<Creature*> templist;
- float x, y, z;
- me->GetPosition(x, y, z);
- Trinity::AllCreaturesOfEntryInRange check(me, NPC_FIRE_BOMB, 100);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check);
- Cell::VisitGridObjects(me, searcher, me->GetGridActivationRange());
+ GetCreatureListWithEntryInGrid(templist, me, NPC_FIRE_BOMB, 100.0f);
for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i)
{
@@ -508,12 +498,8 @@ class npc_janalai_hatcher : public CreatureScript
bool HatchEggs(uint32 num)
{
std::list<Creature*> templist;
- float x, y, z;
- me->GetPosition(x, y, z);
- Trinity::AllCreaturesOfEntryInRange check(me, 23817, 50);
- Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check);
- Cell::VisitGridObjects(me, searcher, me->GetGridActivationRange());
+ GetCreatureListWithEntryInGrid(templist, me, NPC_EGG, 50.0f);
//TC_LOG_ERROR("scripts", "Eggs %d at %d", templist.size(), side);