aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2011-05-25 15:55:14 +0200
committerShauren <shauren.trinity@gmail.com>2011-05-25 15:55:14 +0200
commit64adce7b8b62d648a89e7319036d1474780f3533 (patch)
treeda2c732d0afe7b0d168a5f09d0b11671ef199c4d /src
parent0ea721e25af10e19044e7feefad02d6be124d1b7 (diff)
Scripts: Removed CAST_SUM define
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.cpp4
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.h26
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp7
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/stormwind_city.cpp18
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp8
-rw-r--r--src/server/scripts/Kalimdor/durotar.cpp29
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp10
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp6
-rw-r--r--src/server/scripts/Northrend/borean_tundra.cpp24
-rw-r--r--src/server/scripts/Northrend/howling_fjord.cpp33
-rw-r--r--src/server/scripts/Northrend/sholazar_basin.cpp14
-rw-r--r--src/server/scripts/World/npcs_special.cpp6
13 files changed, 96 insertions, 91 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
index dec6296f823..269f760ab58 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
@@ -70,10 +70,10 @@ void SummonList::DespawnAll()
else
{
erase(begin());
- if (summon->isSummon())
+ if (TempSummon* summ = summon->ToTempSummon())
{
summon->DestroyForNearbyPlayers();
- CAST_SUM(summon)->UnSummon();
+ summ->UnSummon();
}
else
summon->DisappearAndDie();
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
index 55d340164ca..c0472d6ddee 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
@@ -1,12 +1,23 @@
-/* Copyright (C) 2008-2010 Trinity <http://www.trinitycore.org/>
+/*
+ * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
- * Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is free software licensed under GPL version 2
- * Please see the included DOCS/LICENSE.TXT for more information */
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
-#ifndef SC_CREATURE_H
-#define SC_CREATURE_H
+#ifndef SCRIPTEDCREATURE_H_
+#define SCRIPTEDCREATURE_H_
#include "Creature.h"
#include "CreatureAI.h"
@@ -17,7 +28,6 @@
#define CAST_PLR(a) (SCRIPT_CAST_TYPE<Player*>(a))
#define CAST_CRE(a) (SCRIPT_CAST_TYPE<Creature*>(a))
-#define CAST_SUM(a) (SCRIPT_CAST_TYPE<TempSummon*>(a))
#define CAST_PET(a) (SCRIPT_CAST_TYPE<Pet*>(a))
#define CAST_AI(a, b) (SCRIPT_CAST_TYPE<a*>(b))
#define CAST_INST(a, b) (SCRIPT_CAST_TYPE<a*>(b))
@@ -299,4 +309,4 @@ GameObject* GetClosestGameObjectWithEntry(WorldObject* source, uint32 entry, flo
void GetCreatureListWithEntryInGrid(std::list<Creature*>& list, WorldObject* source, uint32 entry, float maxSearchRange);
void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& list, WorldObject* source, uint32 entry, float maxSearchRange);
-#endif
+#endif // SCRIPTEDCREATURE_H_
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
index 2fc6c76caf8..1ad7e927309 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
@@ -565,7 +565,7 @@ public:
if (!me->isSummon())
return;
- if (Unit* pSummon = CAST_SUM(me)->GetSummoner())
+ if (Unit* pSummon = me->ToTempSummon()->GetSummoner())
CAST_CRE(pSummon)->AI()->SetData(2, 1);
}
@@ -582,8 +582,9 @@ public:
if (!me->isSummon())
return;
- if (Unit* pSummon = CAST_SUM(me)->GetSummoner())
- CAST_CRE(pSummon)->AI()->SetData(2, 2);
+ if (Unit* summoner = me->ToTempSummon()->GetSummoner())
+ if (Creature* summonerCre = summoner->ToCreature())
+ summonerCre->AI()->SetData(2, 2);
}
};
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp
index d9c22780be4..1d6f8014ec7 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp
@@ -62,7 +62,7 @@ public:
{
Player *plr = NULL;
if (me->isSummon())
- if (Unit *summoner = CAST_SUM(me)->GetSummoner())
+ if (Unit *summoner = me->ToTempSummon()->GetSummoner())
if (summoner->GetTypeId() == TYPEID_PLAYER)
plr = CAST_PLR(summoner);
diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp
index 0cd539c1101..cc395416382 100644
--- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp
+++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp
@@ -478,10 +478,10 @@ public:
if (me->isSummon())
{
- if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
+ if (Unit* pSummoner = me->ToTempSummon()->GetSummoner())
{
- if (pSummoner && pSummoner->isAlive() && !pSummoner->isInCombat())
- CAST_CRE(pSummoner)->AI()->AttackStart(pWho);
+ if (pSummoner && pSummoner->GetTypeId() == TYPEID_UNIT && pSummoner->isAlive() && !pSummoner->isInCombat())
+ pSummoner->ToCreature()->AI()->AttackStart(pWho);
}
}
}
@@ -492,10 +492,10 @@ public:
if (me->isSummon())
{
- if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
+ if (Unit* pSummoner = me->ToTempSummon()->GetSummoner())
{
- if (pSummoner && pSummoner->isAlive())
- CAST_CRE(pSummoner)->DisappearAndDie();
+ if (pSummoner && pSummoner->GetTypeId() == TYPEID_UNIT && pSummoner->isAlive())
+ pSummoner->ToCreature()->DisappearAndDie();
}
}
}
@@ -507,10 +507,10 @@ public:
if (me->isSummon())
{
- if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
+ if (Unit* pSummoner = me->ToTempSummon()->GetSummoner())
{
- CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, CAST_CRE(pSummoner)->AI())->uiTimer = 2000;
- CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, CAST_CRE(pSummoner)->AI())->uiPhase = 5;
+ CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pSummoner->GetAI())->uiTimer = 2000;
+ CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pSummoner->GetAI())->uiPhase = 5;
//me->ChangeOrient(0.0f, pSummoner);
}
}
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
index 801a4b078b5..69db789e87d 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
@@ -1312,10 +1312,10 @@ public:
void JustDied(Unit* /*killer*/)
{
- if (CAST_SUM(me))
- if (Creature* pSummoner = CAST_CRE(CAST_SUM(me)->GetSummoner()))
- if (pSummoner->AI())
- pSummoner->AI()->DoAction(ACTION_FLESH_TENTACLE_KILLED);
+ if (TempSummon* summon = me->ToTempSummon())
+ if (Unit* summoner = summon->GetSummoner())
+ if (summoner->IsAIEnabled)
+ summoner->GetAI()->DoAction(ACTION_FLESH_TENTACLE_KILLED);
}
};
diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/durotar.cpp
index d0186840228..d32eed17fcd 100644
--- a/src/server/scripts/Kalimdor/durotar.cpp
+++ b/src/server/scripts/Kalimdor/durotar.cpp
@@ -190,7 +190,10 @@ class npc_tiger_matriarch_credit : public CreatureScript
{
for (std::list<Creature*>::iterator itr = tigers.begin(); itr != tigers.end(); ++itr)
{
- if (Unit* summoner = CAST_SUM(*itr)->GetSummoner())
+ if (!(*itr)->isSummon())
+ continue;
+
+ if (Unit* summoner = (*itr)->ToTempSummon()->GetSummoner())
if (!summoner->HasAura(SPELL_NO_SUMMON_AURA) && !summoner->HasAura(SPELL_SUMMON_ZENTABRA_TRIGGER)
&& !summoner->isInCombat())
{
@@ -223,7 +226,10 @@ class npc_tiger_matriarch : public CreatureScript
struct npc_tiger_matriarchAI : public ScriptedAI
{
- npc_tiger_matriarchAI(Creature* creature) : ScriptedAI(creature) {}
+ npc_tiger_matriarchAI(Creature* creature) : ScriptedAI(creature),
+ _tiger(NULL)
+ {
+ }
void IsSummonedBy(Unit* summoner)
{
@@ -242,10 +248,10 @@ class npc_tiger_matriarch : public CreatureScript
void KilledUnit(Unit* victim)
{
- if (victim->GetTypeId() != TYPEID_UNIT)
+ if (victim->GetTypeId() != TYPEID_UNIT || !victim->isSummon())
return;
- if (Unit* vehSummoner = CAST_SUM(victim)->GetSummoner())
+ if (Unit* vehSummoner = victim->ToTempSummon()->GetSummoner())
{
vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA);
vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS);
@@ -257,11 +263,14 @@ class npc_tiger_matriarch : public CreatureScript
void DamageTaken(Unit* attacker, uint32& damage)
{
- if (HealthBelowPct(20))
- {
+ if (!attacker->isSummon())
+ return;
+
+ if (HealthBelowPct(20))
+ {
damage = 0;
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- if (Unit* vehSummoner = CAST_SUM(attacker)->GetSummoner())
+ if (Unit* vehSummoner = attacker->ToTempSummon()->GetSummoner())
{
vehSummoner->AddAura(SPELL_SUMMON_ZENTABRA_TRIGGER, vehSummoner);
vehSummoner->CastSpell(vehSummoner, SPELL_SUMMON_ZENTABRA, true);
@@ -271,6 +280,7 @@ class npc_tiger_matriarch : public CreatureScript
vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER);
vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER);
}
+
me->ForcedDespawn();
}
}
@@ -294,8 +304,9 @@ class npc_tiger_matriarch : public CreatureScript
events.ScheduleEvent(EVENT_POUNCE, 30000);
break;
case EVENT_NOSUMMON: // Reapply SPELL_NO_SUMMON_AURA
- if (Unit* vehSummoner = CAST_SUM(_tiger)->GetSummoner())
- me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner);
+ if (_tiger && _tiger->isSummon())
+ if (Unit* vehSummoner = _tiger->ToTempSummon()->GetSummoner())
+ me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner);
events.ScheduleEvent(EVENT_NOSUMMON, 50000);
break;
default:
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp
index a27a121a852..5309cfdd747 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp
@@ -415,13 +415,9 @@ public:
void JustDied(Unit* /*pKiller*/)
{
if (me->isSummon())
- {
- if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
- {
- if (pSummoner && pSummoner->isAlive())
- CAST_CRE(pSummoner)->AI()->SetData(1, 0);
- }
- }
+ if (Unit* summoner = me->ToTempSummon()->GetSummoner())
+ if (summoner->isAlive())
+ summoner->GetAI()->SetData(1, 0);
}
};
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
index 1d5e3192c61..b63b34cc0be 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
@@ -511,7 +511,7 @@ public:
bool liveSide;
bool gateClose;
- bool isOnSameSide(const Unit *pWho)
+ bool isOnSameSide(const Unit *pWho) const
{
return (liveSide == IN_LIVE_SIDE(pWho));
}
@@ -530,10 +530,8 @@ public:
void JustDied(Unit * /*killer*/)
{
if (me->isSummon())
- {
- if (Unit *owner = CAST_SUM(me)->GetSummoner())
+ if (Unit* owner = me->ToTempSummon()->GetSummoner())
CombatAI::JustDied(owner);
- }
}
void EnterEvadeMode()
diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp
index a675bcc6f03..19c746924bb 100644
--- a/src/server/scripts/Northrend/borean_tundra.cpp
+++ b/src/server/scripts/Northrend/borean_tundra.cpp
@@ -1299,7 +1299,7 @@ public:
return;
if (me->isSummon())
- if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
+ if (Unit* pSummoner = me->ToTempSummon()->GetSummoner())
CAST_AI(npc_thassarian::npc_thassarianAI, CAST_CRE(pSummoner)->AI())->bArthasInPosition = true;
}
};
@@ -1331,7 +1331,7 @@ public:
me->AddUnitState(UNIT_STAT_STUNNED);
me->CastSpell(me, SPELL_STUN, true);
if (me->isSummon())
- if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
+ if (Unit* pSummoner = me->ToTempSummon()->GetSummoner())
CAST_AI(npc_thassarian::npc_thassarianAI, CAST_CRE(pSummoner)->AI())->bArlosInPosition = true;
}
};
@@ -1388,7 +1388,7 @@ public:
return;
if (me->isSummon())
- if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
+ if (Unit* pSummoner = me->ToTempSummon()->GetSummoner())
CAST_AI(npc_thassarian::npc_thassarianAI, CAST_CRE(pSummoner)->AI())->bTalbotInPosition = true;
}
@@ -1493,21 +1493,21 @@ public:
if (!bDone)
{
if (Creature* pTalbot = me->FindNearestCreature(NPC_PRINCE_VALANAR, 50.0f, true))
- CAST_AI(npc_counselor_talbot::npc_counselor_talbotAI, pTalbot->AI())->bCheck = true;
+ CAST_AI(npc_counselor_talbot::npc_counselor_talbotAI, pTalbot->GetAI())->bCheck = true;
me->AddUnitState(UNIT_STAT_STUNNED);
me->CastSpell(me, SPELL_STUN, true);
if (me->isSummon())
- if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
- CAST_AI(npc_thassarian::npc_thassarianAI, CAST_CRE(pSummoner)->AI())->bLeryssaInPosition = true;
+ if (Unit* pSummoner = me->ToTempSummon()->GetSummoner())
+ CAST_AI(npc_thassarian::npc_thassarianAI, pSummoner->GetAI())->bLeryssaInPosition = true;
bDone = true;
}
else
{
me->SetStandState(UNIT_STAND_STATE_SIT);
if (me->isSummon())
- if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
+ if (Unit* pSummoner = me->ToTempSummon()->GetSummoner())
pSummoner->SetStandState(UNIT_STAND_STATE_SIT);
uiPhaseTimer = 1500;
Phase = 1;
@@ -1524,7 +1524,7 @@ public:
{
case 1:
if (me->isSummon())
- if (Unit* pThassarian = CAST_SUM(me)->GetSummoner())
+ if (Unit* pThassarian = me->ToTempSummon()(me)->GetSummoner())
DoScriptText(SAY_THASSARIAN_4, pThassarian);
uiPhaseTimer = 5000;
++Phase;
@@ -1536,7 +1536,7 @@ public:
break;
case 3:
if (me->isSummon())
- if (Unit* pThassarian = CAST_SUM(me)->GetSummoner())
+ if (Unit* pThassarian = me->ToTempSummon()->GetSummoner())
DoScriptText(SAY_THASSARIAN_5, pThassarian);
uiPhaseTimer = 5000;
++Phase;
@@ -1548,7 +1548,7 @@ public:
break;
case 5:
if (me->isSummon())
- if (Unit* pThassarian = CAST_SUM(me)->GetSummoner())
+ if (Unit* pThassarian = me->ToTempSummon()->GetSummoner())
DoScriptText(SAY_THASSARIAN_6, pThassarian);
uiPhaseTimer = 5000;
++Phase;
@@ -1561,10 +1561,10 @@ public:
break;
case 7:
if (me->isSummon())
- if (Unit* pThassarian = CAST_SUM(me)->GetSummoner())
+ if (Unit* pThassarian = me->ToTempSummon()->GetSummoner())
{
DoScriptText(SAY_THASSARIAN_7, pThassarian);
- CAST_AI(npc_thassarian::npc_thassarianAI, CAST_CRE(pThassarian)->AI())->uiPhase = 16;
+ CAST_AI(npc_thassarian::npc_thassarianAI, pThassarian->GetAI())->uiPhase = 16;
}
uiPhaseTimer = 5000;
Phase = 0;
diff --git a/src/server/scripts/Northrend/howling_fjord.cpp b/src/server/scripts/Northrend/howling_fjord.cpp
index 3810d445b61..4b9349e0784 100644
--- a/src/server/scripts/Northrend/howling_fjord.cpp
+++ b/src/server/scripts/Northrend/howling_fjord.cpp
@@ -173,41 +173,26 @@ public:
void Reset()
{
- InitScriptData();
- }
-
- void InitScriptData()
- {
- Player* pPlayer = NULL;
+ uint64 summonerGUID = 0;
+ Player* player = NULL;
if (me->isSummon())
- if (Unit* summoner = CAST_SUM(me)->GetSummoner())
+ if (Unit* summoner = me->ToTempSummon()->GetSummoner())
if (summoner->GetTypeId() == TYPEID_PLAYER)
- pPlayer = CAST_PLR(summoner);
+ summonerGUID = summoner->GetGUID();
- if (!pPlayer)
+ if (!summonerGUID)
return;
me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
- Start(false, false, pPlayer->GetGUID());
+ Start(false, false, summonerGUID);
}
- void WaypointReached(uint32 i)
+ void WaypointReached(uint32 waypointId)
{
- Player* pPlayer = NULL;
- if (me->isSummon())
- if (Unit* summoner = CAST_SUM(me)->GetSummoner())
- if (summoner->GetTypeId() == TYPEID_PLAYER)
- pPlayer = CAST_PLR(summoner);
-
- if (!pPlayer)
+ if (waypointId != 26)
return;
- switch(i)
- {
- case 26:
- me->DespawnOrUnsummon();
- break;
- }
+ me->DespawnOrUnsummon();
}
};
diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp
index f03236f86a4..aa4d10ae980 100644
--- a/src/server/scripts/Northrend/sholazar_basin.cpp
+++ b/src/server/scripts/Northrend/sholazar_basin.cpp
@@ -299,15 +299,19 @@ public:
{
npc_bushwhackerAI(Creature* pCreature) : ScriptedAI(pCreature)
{
- MoveToSummoner();
}
- void MoveToSummoner()
+ void InitializeAI()
{
+ if (me->isDead())
+ return;
+
if (me->isSummon())
- if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
- if (pSummoner)
- me->GetMotionMaster()->MovePoint(0, pSummoner->GetPositionX(), pSummoner->GetPositionY(), pSummoner->GetPositionZ());
+ if (Unit* summoner = me->ToTempSummon()->GetSummoner())
+ if (summoner)
+ me->GetMotionMaster()->MovePoint(0, summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ());
+
+ Reset();
}
void UpdateAI(const uint32 /*uiDiff*/)
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index cdc91f010f2..c34d20a29b1 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -1689,7 +1689,7 @@ public:
// Start attacking attacker of owner on first ai update after spawn - move in line of sight may choose better target
if (!me->getVictim() && me->isSummon())
- if (Unit * Owner = CAST_SUM(me)->GetSummoner())
+ if (Unit * Owner = me->ToTempSummon()->GetSummoner())
if (Owner->getAttackerForHelper())
AttackStart(Owner->getAttackerForHelper());
}
@@ -2103,7 +2103,7 @@ public:
void DamageTaken(Unit* /*pKiller*/, uint32 &damage)
{
if (me->isSummon())
- if (Unit* pOwner = CAST_SUM(me)->GetSummoner())
+ if (Unit* pOwner = me->ToTempSummon()->GetSummoner())
{
if (pOwner->HasAura(GLYPH_OF_SHADOWFIEND))
if (damage >= me->GetHealth())
@@ -2152,7 +2152,7 @@ public:
{
if (pCreature->isSummon())
{
- if (pPlayer == CAST_SUM(pCreature)->GetSummoner())
+ if (pPlayer == pCreature->ToTempSummon()->GetSummoner())
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);