Scripts: Removed CAST_SUM define
This commit is contained in:
@@ -70,10 +70,10 @@ void SummonList::DespawnAll()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
erase(begin());
|
erase(begin());
|
||||||
if (summon->isSummon())
|
if (TempSummon* summ = summon->ToTempSummon())
|
||||||
{
|
{
|
||||||
summon->DestroyForNearbyPlayers();
|
summon->DestroyForNearbyPlayers();
|
||||||
CAST_SUM(summon)->UnSummon();
|
summ->UnSummon();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
summon->DisappearAndDie();
|
summon->DisappearAndDie();
|
||||||
|
|||||||
@@ -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
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
* Please see the included DOCS/LICENSE.TXT for more information */
|
* 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
|
#ifndef SCRIPTEDCREATURE_H_
|
||||||
#define SC_CREATURE_H
|
#define SCRIPTEDCREATURE_H_
|
||||||
|
|
||||||
#include "Creature.h"
|
#include "Creature.h"
|
||||||
#include "CreatureAI.h"
|
#include "CreatureAI.h"
|
||||||
@@ -17,7 +28,6 @@
|
|||||||
|
|
||||||
#define CAST_PLR(a) (SCRIPT_CAST_TYPE<Player*>(a))
|
#define CAST_PLR(a) (SCRIPT_CAST_TYPE<Player*>(a))
|
||||||
#define CAST_CRE(a) (SCRIPT_CAST_TYPE<Creature*>(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_PET(a) (SCRIPT_CAST_TYPE<Pet*>(a))
|
||||||
#define CAST_AI(a, b) (SCRIPT_CAST_TYPE<a*>(b))
|
#define CAST_AI(a, b) (SCRIPT_CAST_TYPE<a*>(b))
|
||||||
#define CAST_INST(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 GetCreatureListWithEntryInGrid(std::list<Creature*>& list, WorldObject* source, uint32 entry, float maxSearchRange);
|
||||||
void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& list, WorldObject* source, uint32 entry, float maxSearchRange);
|
void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& list, WorldObject* source, uint32 entry, float maxSearchRange);
|
||||||
|
|
||||||
#endif
|
#endif // SCRIPTEDCREATURE_H_
|
||||||
|
|||||||
@@ -565,7 +565,7 @@ public:
|
|||||||
if (!me->isSummon())
|
if (!me->isSummon())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Unit* pSummon = CAST_SUM(me)->GetSummoner())
|
if (Unit* pSummon = me->ToTempSummon()->GetSummoner())
|
||||||
CAST_CRE(pSummon)->AI()->SetData(2, 1);
|
CAST_CRE(pSummon)->AI()->SetData(2, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -582,8 +582,9 @@ public:
|
|||||||
if (!me->isSummon())
|
if (!me->isSummon())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Unit* pSummon = CAST_SUM(me)->GetSummoner())
|
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||||
CAST_CRE(pSummon)->AI()->SetData(2, 2);
|
if (Creature* summonerCre = summoner->ToCreature())
|
||||||
|
summonerCre->AI()->SetData(2, 2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public:
|
|||||||
{
|
{
|
||||||
Player *plr = NULL;
|
Player *plr = NULL;
|
||||||
if (me->isSummon())
|
if (me->isSummon())
|
||||||
if (Unit *summoner = CAST_SUM(me)->GetSummoner())
|
if (Unit *summoner = me->ToTempSummon()->GetSummoner())
|
||||||
if (summoner->GetTypeId() == TYPEID_PLAYER)
|
if (summoner->GetTypeId() == TYPEID_PLAYER)
|
||||||
plr = CAST_PLR(summoner);
|
plr = CAST_PLR(summoner);
|
||||||
|
|
||||||
|
|||||||
@@ -478,10 +478,10 @@ public:
|
|||||||
|
|
||||||
if (me->isSummon())
|
if (me->isSummon())
|
||||||
{
|
{
|
||||||
if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
|
if (Unit* pSummoner = me->ToTempSummon()->GetSummoner())
|
||||||
{
|
{
|
||||||
if (pSummoner && pSummoner->isAlive() && !pSummoner->isInCombat())
|
if (pSummoner && pSummoner->GetTypeId() == TYPEID_UNIT && pSummoner->isAlive() && !pSummoner->isInCombat())
|
||||||
CAST_CRE(pSummoner)->AI()->AttackStart(pWho);
|
pSummoner->ToCreature()->AI()->AttackStart(pWho);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -492,10 +492,10 @@ public:
|
|||||||
|
|
||||||
if (me->isSummon())
|
if (me->isSummon())
|
||||||
{
|
{
|
||||||
if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
|
if (Unit* pSummoner = me->ToTempSummon()->GetSummoner())
|
||||||
{
|
{
|
||||||
if (pSummoner && pSummoner->isAlive())
|
if (pSummoner && pSummoner->GetTypeId() == TYPEID_UNIT && pSummoner->isAlive())
|
||||||
CAST_CRE(pSummoner)->DisappearAndDie();
|
pSummoner->ToCreature()->DisappearAndDie();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -507,10 +507,10 @@ public:
|
|||||||
|
|
||||||
if (me->isSummon())
|
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, pSummoner->GetAI())->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())->uiPhase = 5;
|
||||||
//me->ChangeOrient(0.0f, pSummoner);
|
//me->ChangeOrient(0.0f, pSummoner);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1312,10 +1312,10 @@ public:
|
|||||||
|
|
||||||
void JustDied(Unit* /*killer*/)
|
void JustDied(Unit* /*killer*/)
|
||||||
{
|
{
|
||||||
if (CAST_SUM(me))
|
if (TempSummon* summon = me->ToTempSummon())
|
||||||
if (Creature* pSummoner = CAST_CRE(CAST_SUM(me)->GetSummoner()))
|
if (Unit* summoner = summon->GetSummoner())
|
||||||
if (pSummoner->AI())
|
if (summoner->IsAIEnabled)
|
||||||
pSummoner->AI()->DoAction(ACTION_FLESH_TENTACLE_KILLED);
|
summoner->GetAI()->DoAction(ACTION_FLESH_TENTACLE_KILLED);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -190,7 +190,10 @@ class npc_tiger_matriarch_credit : public CreatureScript
|
|||||||
{
|
{
|
||||||
for (std::list<Creature*>::iterator itr = tigers.begin(); itr != tigers.end(); ++itr)
|
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)
|
if (!summoner->HasAura(SPELL_NO_SUMMON_AURA) && !summoner->HasAura(SPELL_SUMMON_ZENTABRA_TRIGGER)
|
||||||
&& !summoner->isInCombat())
|
&& !summoner->isInCombat())
|
||||||
{
|
{
|
||||||
@@ -223,7 +226,10 @@ class npc_tiger_matriarch : public CreatureScript
|
|||||||
|
|
||||||
struct npc_tiger_matriarchAI : public ScriptedAI
|
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)
|
void IsSummonedBy(Unit* summoner)
|
||||||
{
|
{
|
||||||
@@ -242,10 +248,10 @@ class npc_tiger_matriarch : public CreatureScript
|
|||||||
|
|
||||||
void KilledUnit(Unit* victim)
|
void KilledUnit(Unit* victim)
|
||||||
{
|
{
|
||||||
if (victim->GetTypeId() != TYPEID_UNIT)
|
if (victim->GetTypeId() != TYPEID_UNIT || !victim->isSummon())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Unit* vehSummoner = CAST_SUM(victim)->GetSummoner())
|
if (Unit* vehSummoner = victim->ToTempSummon()->GetSummoner())
|
||||||
{
|
{
|
||||||
vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA);
|
vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA);
|
||||||
vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS);
|
vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS);
|
||||||
@@ -257,11 +263,14 @@ class npc_tiger_matriarch : public CreatureScript
|
|||||||
|
|
||||||
void DamageTaken(Unit* attacker, uint32& damage)
|
void DamageTaken(Unit* attacker, uint32& damage)
|
||||||
{
|
{
|
||||||
|
if (!attacker->isSummon())
|
||||||
|
return;
|
||||||
|
|
||||||
if (HealthBelowPct(20))
|
if (HealthBelowPct(20))
|
||||||
{
|
{
|
||||||
damage = 0;
|
damage = 0;
|
||||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
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->AddAura(SPELL_SUMMON_ZENTABRA_TRIGGER, vehSummoner);
|
||||||
vehSummoner->CastSpell(vehSummoner, SPELL_SUMMON_ZENTABRA, true);
|
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_SPIRIT_OF_THE_TIGER_RIDER);
|
||||||
vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER);
|
vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER);
|
||||||
}
|
}
|
||||||
|
|
||||||
me->ForcedDespawn();
|
me->ForcedDespawn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -294,7 +304,8 @@ class npc_tiger_matriarch : public CreatureScript
|
|||||||
events.ScheduleEvent(EVENT_POUNCE, 30000);
|
events.ScheduleEvent(EVENT_POUNCE, 30000);
|
||||||
break;
|
break;
|
||||||
case EVENT_NOSUMMON: // Reapply SPELL_NO_SUMMON_AURA
|
case EVENT_NOSUMMON: // Reapply SPELL_NO_SUMMON_AURA
|
||||||
if (Unit* vehSummoner = CAST_SUM(_tiger)->GetSummoner())
|
if (_tiger && _tiger->isSummon())
|
||||||
|
if (Unit* vehSummoner = _tiger->ToTempSummon()->GetSummoner())
|
||||||
me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner);
|
me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner);
|
||||||
events.ScheduleEvent(EVENT_NOSUMMON, 50000);
|
events.ScheduleEvent(EVENT_NOSUMMON, 50000);
|
||||||
break;
|
break;
|
||||||
|
|||||||
+3
-7
@@ -415,13 +415,9 @@ public:
|
|||||||
void JustDied(Unit* /*pKiller*/)
|
void JustDied(Unit* /*pKiller*/)
|
||||||
{
|
{
|
||||||
if (me->isSummon())
|
if (me->isSummon())
|
||||||
{
|
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||||
if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
|
if (summoner->isAlive())
|
||||||
{
|
summoner->GetAI()->SetData(1, 0);
|
||||||
if (pSummoner && pSummoner->isAlive())
|
|
||||||
CAST_CRE(pSummoner)->AI()->SetData(1, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -511,7 +511,7 @@ public:
|
|||||||
bool liveSide;
|
bool liveSide;
|
||||||
bool gateClose;
|
bool gateClose;
|
||||||
|
|
||||||
bool isOnSameSide(const Unit *pWho)
|
bool isOnSameSide(const Unit *pWho) const
|
||||||
{
|
{
|
||||||
return (liveSide == IN_LIVE_SIDE(pWho));
|
return (liveSide == IN_LIVE_SIDE(pWho));
|
||||||
}
|
}
|
||||||
@@ -530,11 +530,9 @@ public:
|
|||||||
void JustDied(Unit * /*killer*/)
|
void JustDied(Unit * /*killer*/)
|
||||||
{
|
{
|
||||||
if (me->isSummon())
|
if (me->isSummon())
|
||||||
{
|
if (Unit* owner = me->ToTempSummon()->GetSummoner())
|
||||||
if (Unit *owner = CAST_SUM(me)->GetSummoner())
|
|
||||||
CombatAI::JustDied(owner);
|
CombatAI::JustDied(owner);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void EnterEvadeMode()
|
void EnterEvadeMode()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1299,7 +1299,7 @@ public:
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (me->isSummon())
|
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;
|
CAST_AI(npc_thassarian::npc_thassarianAI, CAST_CRE(pSummoner)->AI())->bArthasInPosition = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1331,7 +1331,7 @@ public:
|
|||||||
me->AddUnitState(UNIT_STAT_STUNNED);
|
me->AddUnitState(UNIT_STAT_STUNNED);
|
||||||
me->CastSpell(me, SPELL_STUN, true);
|
me->CastSpell(me, SPELL_STUN, true);
|
||||||
if (me->isSummon())
|
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;
|
CAST_AI(npc_thassarian::npc_thassarianAI, CAST_CRE(pSummoner)->AI())->bArlosInPosition = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1388,7 +1388,7 @@ public:
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (me->isSummon())
|
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;
|
CAST_AI(npc_thassarian::npc_thassarianAI, CAST_CRE(pSummoner)->AI())->bTalbotInPosition = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1493,21 +1493,21 @@ public:
|
|||||||
if (!bDone)
|
if (!bDone)
|
||||||
{
|
{
|
||||||
if (Creature* pTalbot = me->FindNearestCreature(NPC_PRINCE_VALANAR, 50.0f, true))
|
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->AddUnitState(UNIT_STAT_STUNNED);
|
||||||
me->CastSpell(me, SPELL_STUN, true);
|
me->CastSpell(me, SPELL_STUN, true);
|
||||||
|
|
||||||
if (me->isSummon())
|
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())->bLeryssaInPosition = true;
|
CAST_AI(npc_thassarian::npc_thassarianAI, pSummoner->GetAI())->bLeryssaInPosition = true;
|
||||||
bDone = true;
|
bDone = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
me->SetStandState(UNIT_STAND_STATE_SIT);
|
me->SetStandState(UNIT_STAND_STATE_SIT);
|
||||||
if (me->isSummon())
|
if (me->isSummon())
|
||||||
if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
|
if (Unit* pSummoner = me->ToTempSummon()->GetSummoner())
|
||||||
pSummoner->SetStandState(UNIT_STAND_STATE_SIT);
|
pSummoner->SetStandState(UNIT_STAND_STATE_SIT);
|
||||||
uiPhaseTimer = 1500;
|
uiPhaseTimer = 1500;
|
||||||
Phase = 1;
|
Phase = 1;
|
||||||
@@ -1524,7 +1524,7 @@ public:
|
|||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
if (me->isSummon())
|
if (me->isSummon())
|
||||||
if (Unit* pThassarian = CAST_SUM(me)->GetSummoner())
|
if (Unit* pThassarian = me->ToTempSummon()(me)->GetSummoner())
|
||||||
DoScriptText(SAY_THASSARIAN_4, pThassarian);
|
DoScriptText(SAY_THASSARIAN_4, pThassarian);
|
||||||
uiPhaseTimer = 5000;
|
uiPhaseTimer = 5000;
|
||||||
++Phase;
|
++Phase;
|
||||||
@@ -1536,7 +1536,7 @@ public:
|
|||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (me->isSummon())
|
if (me->isSummon())
|
||||||
if (Unit* pThassarian = CAST_SUM(me)->GetSummoner())
|
if (Unit* pThassarian = me->ToTempSummon()->GetSummoner())
|
||||||
DoScriptText(SAY_THASSARIAN_5, pThassarian);
|
DoScriptText(SAY_THASSARIAN_5, pThassarian);
|
||||||
uiPhaseTimer = 5000;
|
uiPhaseTimer = 5000;
|
||||||
++Phase;
|
++Phase;
|
||||||
@@ -1548,7 +1548,7 @@ public:
|
|||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
if (me->isSummon())
|
if (me->isSummon())
|
||||||
if (Unit* pThassarian = CAST_SUM(me)->GetSummoner())
|
if (Unit* pThassarian = me->ToTempSummon()->GetSummoner())
|
||||||
DoScriptText(SAY_THASSARIAN_6, pThassarian);
|
DoScriptText(SAY_THASSARIAN_6, pThassarian);
|
||||||
uiPhaseTimer = 5000;
|
uiPhaseTimer = 5000;
|
||||||
++Phase;
|
++Phase;
|
||||||
@@ -1561,10 +1561,10 @@ public:
|
|||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (me->isSummon())
|
if (me->isSummon())
|
||||||
if (Unit* pThassarian = CAST_SUM(me)->GetSummoner())
|
if (Unit* pThassarian = me->ToTempSummon()->GetSummoner())
|
||||||
{
|
{
|
||||||
DoScriptText(SAY_THASSARIAN_7, pThassarian);
|
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;
|
uiPhaseTimer = 5000;
|
||||||
Phase = 0;
|
Phase = 0;
|
||||||
|
|||||||
@@ -173,41 +173,26 @@ public:
|
|||||||
|
|
||||||
void Reset()
|
void Reset()
|
||||||
{
|
{
|
||||||
InitScriptData();
|
uint64 summonerGUID = 0;
|
||||||
}
|
Player* player = NULL;
|
||||||
|
|
||||||
void InitScriptData()
|
|
||||||
{
|
|
||||||
Player* pPlayer = NULL;
|
|
||||||
if (me->isSummon())
|
if (me->isSummon())
|
||||||
if (Unit* summoner = CAST_SUM(me)->GetSummoner())
|
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||||
if (summoner->GetTypeId() == TYPEID_PLAYER)
|
if (summoner->GetTypeId() == TYPEID_PLAYER)
|
||||||
pPlayer = CAST_PLR(summoner);
|
summonerGUID = summoner->GetGUID();
|
||||||
|
|
||||||
if (!pPlayer)
|
if (!summonerGUID)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
|
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 (waypointId != 26)
|
||||||
if (me->isSummon())
|
|
||||||
if (Unit* summoner = CAST_SUM(me)->GetSummoner())
|
|
||||||
if (summoner->GetTypeId() == TYPEID_PLAYER)
|
|
||||||
pPlayer = CAST_PLR(summoner);
|
|
||||||
|
|
||||||
if (!pPlayer)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch(i)
|
|
||||||
{
|
|
||||||
case 26:
|
|
||||||
me->DespawnOrUnsummon();
|
me->DespawnOrUnsummon();
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -299,15 +299,19 @@ public:
|
|||||||
{
|
{
|
||||||
npc_bushwhackerAI(Creature* pCreature) : ScriptedAI(pCreature)
|
npc_bushwhackerAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||||
{
|
{
|
||||||
MoveToSummoner();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoveToSummoner()
|
void InitializeAI()
|
||||||
{
|
{
|
||||||
|
if (me->isDead())
|
||||||
|
return;
|
||||||
|
|
||||||
if (me->isSummon())
|
if (me->isSummon())
|
||||||
if (Unit* pSummoner = CAST_SUM(me)->GetSummoner())
|
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||||
if (pSummoner)
|
if (summoner)
|
||||||
me->GetMotionMaster()->MovePoint(0, pSummoner->GetPositionX(), pSummoner->GetPositionY(), pSummoner->GetPositionZ());
|
me->GetMotionMaster()->MovePoint(0, summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ());
|
||||||
|
|
||||||
|
Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(const uint32 /*uiDiff*/)
|
void UpdateAI(const uint32 /*uiDiff*/)
|
||||||
|
|||||||
@@ -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
|
// 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 (!me->getVictim() && me->isSummon())
|
||||||
if (Unit * Owner = CAST_SUM(me)->GetSummoner())
|
if (Unit * Owner = me->ToTempSummon()->GetSummoner())
|
||||||
if (Owner->getAttackerForHelper())
|
if (Owner->getAttackerForHelper())
|
||||||
AttackStart(Owner->getAttackerForHelper());
|
AttackStart(Owner->getAttackerForHelper());
|
||||||
}
|
}
|
||||||
@@ -2103,7 +2103,7 @@ public:
|
|||||||
void DamageTaken(Unit* /*pKiller*/, uint32 &damage)
|
void DamageTaken(Unit* /*pKiller*/, uint32 &damage)
|
||||||
{
|
{
|
||||||
if (me->isSummon())
|
if (me->isSummon())
|
||||||
if (Unit* pOwner = CAST_SUM(me)->GetSummoner())
|
if (Unit* pOwner = me->ToTempSummon()->GetSummoner())
|
||||||
{
|
{
|
||||||
if (pOwner->HasAura(GLYPH_OF_SHADOWFIEND))
|
if (pOwner->HasAura(GLYPH_OF_SHADOWFIEND))
|
||||||
if (damage >= me->GetHealth())
|
if (damage >= me->GetHealth())
|
||||||
@@ -2152,7 +2152,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (pCreature->isSummon())
|
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_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);
|
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||||
|
|||||||
Reference in New Issue
Block a user