Core/Misc: Tweaked ThreatContainer internals
(and many cosmetic changes here and there)
This commit is contained in:
1 parent
6d55ac8c58
commit
876ad50dcd
53 files changed
+312
-426
No files matched your search
@@ -40,8 +40,8 @@ bool GuardAI::CanSeeAlways(WorldObject const* obj)
|
||||
if (!obj->isType(TYPEMASK_UNIT))
|
||||
return false;
|
||||
|
||||
std::list<HostileReference*> threatList = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
ThreatContainer::StorageType threatList = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
if ((*itr)->getUnitGuid() == obj->GetGUID())
|
||||
return true;
|
||||
|
||||
|
||||
@@ -60,25 +60,20 @@ void UnitAI::DoMeleeAttackIfReady()
|
||||
|
||||
bool UnitAI::DoSpellAttackIfReady(uint32 spell)
|
||||
{
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING) || !me->isAttackReady())
|
||||
return true;
|
||||
|
||||
if (me->isAttackReady())
|
||||
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell))
|
||||
{
|
||||
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell))
|
||||
if (me->IsWithinCombatRange(me->getVictim(), spellInfo->GetMaxRange(false)))
|
||||
{
|
||||
if (me->IsWithinCombatRange(me->getVictim(), spellInfo->GetMaxRange(false)))
|
||||
{
|
||||
me->CastSpell(me->getVictim(), spell, false);
|
||||
me->resetAttackTimer();
|
||||
}
|
||||
else
|
||||
return false;
|
||||
me->CastSpell(me->getVictim(), spell, false);
|
||||
me->resetAttackTimer();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Unit* UnitAI::SelectTarget(SelectAggroTarget targetType, uint32 position, float dist, bool playerOnly, int32 aura)
|
||||
@@ -101,8 +96,8 @@ void UnitAI::DoAddAuraToAllHostilePlayers(uint32 spellid)
|
||||
{
|
||||
if (me->isInCombat())
|
||||
{
|
||||
std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
{
|
||||
if (Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -116,8 +111,8 @@ void UnitAI::DoCastToAllHostilePlayers(uint32 spellid, bool triggered)
|
||||
{
|
||||
if (me->isInCombat())
|
||||
{
|
||||
std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
{
|
||||
if (Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
|
||||
@@ -61,7 +61,7 @@ struct DefaultTargetSelector : public std::unary_function<Unit*, bool>
|
||||
// dist: if 0: ignored, if > 0: maximum distance to the reference unit, if < 0: minimum distance to the reference unit
|
||||
// playerOnly: self explaining
|
||||
// aura: if 0: ignored, if > 0: the target shall have the aura, if < 0, the target shall NOT have the aura
|
||||
DefaultTargetSelector(Unit const* unit, float dist, bool playerOnly, int32 aura) : me(unit), m_dist(dist), m_playerOnly(playerOnly), m_aura(aura) {}
|
||||
DefaultTargetSelector(Unit const* unit, float dist, bool playerOnly, int32 aura) : me(unit), m_dist(dist), m_playerOnly(playerOnly), m_aura(aura) { }
|
||||
|
||||
bool operator()(Unit const* target) const
|
||||
{
|
||||
@@ -156,12 +156,12 @@ class UnitAI
|
||||
// predicate shall extend std::unary_function<Unit*, bool>
|
||||
template <class PREDICATE> Unit* SelectTarget(SelectAggroTarget targetType, uint32 position, PREDICATE const& predicate)
|
||||
{
|
||||
const std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const& threatlist = me->getThreatManager().getThreatList();
|
||||
if (position >= threatlist.size())
|
||||
return NULL;
|
||||
|
||||
std::list<Unit*> targetList;
|
||||
for (std::list<HostileReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
if (predicate((*itr)->getTarget()))
|
||||
targetList.push_back((*itr)->getTarget());
|
||||
|
||||
@@ -206,11 +206,11 @@ class UnitAI
|
||||
// predicate shall extend std::unary_function<Unit*, bool>
|
||||
template <class PREDICATE> void SelectTargetList(std::list<Unit*>& targetList, PREDICATE const& predicate, uint32 maxTargets, SelectAggroTarget targetType)
|
||||
{
|
||||
std::list<HostileReference*> const& threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const& threatlist = me->getThreatManager().getThreatList();
|
||||
if (threatlist.empty())
|
||||
return;
|
||||
|
||||
for (std::list<HostileReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
if (predicate((*itr)->getTarget()))
|
||||
targetList.push_back((*itr)->getTarget());
|
||||
|
||||
|
||||
@@ -520,10 +520,10 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
break;
|
||||
case ACTION_T_THREAT_ALL_PCT:
|
||||
{
|
||||
std::list<HostileReference*>& threatList = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::iterator i = threatList.begin(); i != threatList.end(); ++i)
|
||||
if (Unit* Temp = Unit::GetUnit(*me, (*i)->getUnitGuid()))
|
||||
me->getThreatManager().modifyThreatPercent(Temp, action.threat_all_pct.percent);
|
||||
ThreatContainer::StorageType const& threatList = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator i = threatList.begin(); i != threatList.end(); ++i)
|
||||
if (Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()))
|
||||
me->getThreatManager().modifyThreatPercent(unit, action.threat_all_pct.percent);
|
||||
break;
|
||||
}
|
||||
case ACTION_T_QUEST_EVENT:
|
||||
@@ -634,11 +634,11 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
break;
|
||||
case ACTION_T_CAST_EVENT_ALL:
|
||||
{
|
||||
std::list<HostileReference*>& threatList = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::iterator i = threatList.begin(); i != threatList.end(); ++i)
|
||||
if (Unit* Temp = Unit::GetUnit(*me, (*i)->getUnitGuid()))
|
||||
if (Temp->GetTypeId() == TYPEID_PLAYER)
|
||||
Temp->ToPlayer()->CastedCreatureOrGO(action.cast_event_all.creatureId, me->GetGUID(), action.cast_event_all.spellId);
|
||||
ThreatContainer::StorageType const& threatList = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator i = threatList.begin(); i != threatList.end(); ++i)
|
||||
if (Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()))
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
unit->ToPlayer()->CastedCreatureOrGO(action.cast_event_all.creatureId, me->GetGUID(), action.cast_event_all.spellId);
|
||||
break;
|
||||
}
|
||||
case ACTION_T_REMOVEAURASFROMSPELL:
|
||||
@@ -884,11 +884,11 @@ void CreatureEventAI::Reset()
|
||||
(*i).Enabled = true;
|
||||
break;
|
||||
}
|
||||
//default:
|
||||
//TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void EnterCombat()
|
||||
//(*i).Enabled = true;
|
||||
//(*i).Time = 0;
|
||||
//break;
|
||||
default:
|
||||
//TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void EnterCombat()
|
||||
//(*i).Enabled = true;
|
||||
//(*i).Time = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts()
|
||||
if (!result)
|
||||
{
|
||||
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 additional CreatureEventAI Texts data. DB table `creature_ai_texts` is empty.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -99,7 +98,6 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts()
|
||||
while (result->NextRow());
|
||||
|
||||
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u additional CreatureEventAI Texts data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
|
||||
}
|
||||
|
||||
void CreatureEventAIMgr::LoadCreatureEventAI_Summons()
|
||||
@@ -115,7 +113,6 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons()
|
||||
if (!result)
|
||||
{
|
||||
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 CreatureEventAI Summon definitions. DB table `creature_ai_summons` is empty.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -147,7 +144,6 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons()
|
||||
while (result->NextRow());
|
||||
|
||||
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u CreatureEventAI summon definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
|
||||
}
|
||||
|
||||
void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
||||
@@ -168,7 +164,6 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
||||
if (!result)
|
||||
{
|
||||
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 CreatureEventAI scripts. DB table `creature_ai_scripts` is empty.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -739,5 +734,4 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
||||
while (result->NextRow());
|
||||
|
||||
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u CreatureEventAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
|
||||
}
|
||||
@@ -254,12 +254,11 @@ void ScriptedAI::DoResetThreat()
|
||||
return;
|
||||
}
|
||||
|
||||
std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
|
||||
for (std::list<HostileReference*>::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
|
||||
if (unit && DoGetThreat(unit))
|
||||
DoModifyThreatPercent(unit, -100);
|
||||
}
|
||||
@@ -299,7 +298,8 @@ void ScriptedAI::DoTeleportPlayer(Unit* unit, float x, float y, float z, float o
|
||||
if (Player* player = unit->ToPlayer())
|
||||
player->TeleportTo(unit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT);
|
||||
else
|
||||
sLog->outError(LOG_FILTER_TSCR, "Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.", me->GetGUID(), me->GetEntry(), unit->GetTypeId(), unit->GetGUID(), x, y, z, o);
|
||||
sLog->outError(LOG_FILTER_TSCR, "Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.",
|
||||
me->GetGUID(), me->GetEntry(), unit->GetTypeId(), unit->GetGUID(), x, y, z, o);
|
||||
}
|
||||
|
||||
void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
|
||||
@@ -331,6 +331,7 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyCC(float range)
|
||||
Trinity::FriendlyCCedInRange u_check(me, range);
|
||||
Trinity::CreatureListSearcher<Trinity::FriendlyCCedInRange> searcher(me, list, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -340,6 +341,7 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 u
|
||||
Trinity::FriendlyMissingBuffInRange u_check(me, range, uiSpellid);
|
||||
Trinity::CreatureListSearcher<Trinity::FriendlyMissingBuffInRange> searcher(me, list, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -451,7 +453,6 @@ void Scripted_NoMovementAI::AttackStart(Unit* target)
|
||||
}
|
||||
|
||||
// BossAI - for instanced bosses
|
||||
|
||||
BossAI::BossAI(Creature* creature, uint32 bossId) : ScriptedAI(creature),
|
||||
instance(creature->GetInstanceScript()),
|
||||
summons(creature),
|
||||
@@ -503,8 +504,9 @@ void BossAI::TeleportCheaters()
|
||||
{
|
||||
float x, y, z;
|
||||
me->GetPosition(x, y, z);
|
||||
std::list<HostileReference*>& threatList = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
|
||||
ThreatContainer::StorageType threatList = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
if (Unit* target = (*itr)->getTarget())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && !CheckBoundary(target))
|
||||
target->NearTeleportTo(x, y, z, 0);
|
||||
|
||||
@@ -430,8 +430,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (!me)
|
||||
break;
|
||||
|
||||
std::list<HostileReference*> const& threatList = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator i = threatList.begin(); i != threatList.end(); ++i)
|
||||
ThreatContainer::StorageType threatList = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator i = threatList.begin(); i != threatList.end(); ++i)
|
||||
{
|
||||
if (Unit* target = Unit::GetUnit(*me, (*i)->getUnitGuid()))
|
||||
{
|
||||
@@ -2346,8 +2346,8 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
{
|
||||
if (me)
|
||||
{
|
||||
std::list<HostileReference*> const& threatList = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator i = threatList.begin(); i != threatList.end(); ++i)
|
||||
ThreatContainer::StorageType threatList = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator i = threatList.begin(); i != threatList.end(); ++i)
|
||||
if (Unit* temp = Unit::GetUnit(*me, (*i)->getUnitGuid()))
|
||||
l->push_back(temp);
|
||||
}
|
||||
|
||||
@@ -253,25 +253,29 @@ Unit* HostileReference::getSourceUnit()
|
||||
|
||||
void ThreatContainer::clearReferences()
|
||||
{
|
||||
for (std::list<HostileReference*>::const_iterator i = iThreatList.begin(); i != iThreatList.end(); ++i)
|
||||
for (ThreatContainer::StorageType::const_iterator i = iThreatList.begin(); i != iThreatList.end(); ++i)
|
||||
{
|
||||
(*i)->unlink();
|
||||
delete (*i);
|
||||
}
|
||||
|
||||
iThreatList.clear();
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// Return the HostileReference of NULL, if not found
|
||||
HostileReference* ThreatContainer::getReferenceByTarget(Unit* victim)
|
||||
HostileReference* ThreatContainer::getReferenceByTarget(Unit* victim) const
|
||||
{
|
||||
if (!victim)
|
||||
return NULL;
|
||||
|
||||
uint64 guid = victim->GetGUID();
|
||||
for (std::list<HostileReference*>::const_iterator i = iThreatList.begin(); i != iThreatList.end(); ++i)
|
||||
if ((*i) && (*i)->getUnitGuid() == guid)
|
||||
return (*i);
|
||||
uint64 const guid = victim->GetGUID();
|
||||
for (ThreatContainer::StorageType::const_iterator i = iThreatList.begin(); i != iThreatList.end(); ++i)
|
||||
{
|
||||
HostileReference *ref = (*i);
|
||||
if (ref && ref->getUnitGuid() == guid)
|
||||
return ref;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -310,16 +314,16 @@ void ThreatContainer::update()
|
||||
// return the next best victim
|
||||
// could be the current victim
|
||||
|
||||
HostileReference* ThreatContainer::selectNextVictim(Creature* attacker, HostileReference* currentVictim)
|
||||
HostileReference* ThreatContainer::selectNextVictim(Creature* attacker, HostileReference* currentVictim) const
|
||||
{
|
||||
HostileReference* currentRef = NULL;
|
||||
bool found = false;
|
||||
bool noPriorityTargetFound = false;
|
||||
|
||||
std::list<HostileReference*>::const_iterator lastRef = iThreatList.end();
|
||||
ThreatContainer::StorageType::const_iterator lastRef = iThreatList.end();
|
||||
--lastRef;
|
||||
|
||||
for (std::list<HostileReference*>::const_iterator iter = iThreatList.begin(); iter != iThreatList.end() && !found;)
|
||||
for (ThreatContainer::StorageType::const_iterator iter = iThreatList.begin(); iter != iThreatList.end() && !found;)
|
||||
{
|
||||
currentRef = (*iter);
|
||||
|
||||
@@ -577,17 +581,15 @@ bool ThreatManager::isNeedUpdateToClient(uint32 time)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reset all aggro without modifying the threadlist.
|
||||
// Reset all aggro without modifying the threatlist.
|
||||
void ThreatManager::resetAllAggro()
|
||||
{
|
||||
std::list<HostileReference*> &threatList = getThreatList();
|
||||
ThreatContainer::StorageType &threatList = iThreatContainer.iThreatList;
|
||||
if (threatList.empty())
|
||||
return;
|
||||
|
||||
for (std::list<HostileReference*>::iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
{
|
||||
for (ThreatContainer::StorageType::iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
(*itr)->setThreat(0);
|
||||
}
|
||||
|
||||
setDirty(true);
|
||||
}
|
||||
@@ -142,39 +142,57 @@ class ThreatManager;
|
||||
|
||||
class ThreatContainer
|
||||
{
|
||||
private:
|
||||
std::list<HostileReference*> iThreatList;
|
||||
bool iDirty;
|
||||
protected:
|
||||
friend class ThreatManager;
|
||||
|
||||
void remove(HostileReference* hostileRef) { iThreatList.remove(hostileRef); }
|
||||
void addReference(HostileReference* hostileRef) { iThreatList.push_back(hostileRef); }
|
||||
void clearReferences();
|
||||
|
||||
// Sort the list if necessary
|
||||
void update();
|
||||
public:
|
||||
ThreatContainer() { iDirty = false; }
|
||||
typedef std::list<HostileReference*> StorageType;
|
||||
|
||||
ThreatContainer(): iDirty(false) { }
|
||||
|
||||
~ThreatContainer() { clearReferences(); }
|
||||
|
||||
HostileReference* addThreat(Unit* victim, float threat);
|
||||
|
||||
void modifyThreatPercent(Unit* victim, int32 percent);
|
||||
|
||||
HostileReference* selectNextVictim(Creature* attacker, HostileReference* currentVictim);
|
||||
HostileReference* selectNextVictim(Creature* attacker, HostileReference* currentVictim) const;
|
||||
|
||||
void setDirty(bool isDirty) { iDirty = isDirty; }
|
||||
|
||||
bool isDirty() const { return iDirty; }
|
||||
|
||||
bool empty() const { return iThreatList.empty(); }
|
||||
bool empty() const
|
||||
{
|
||||
return iThreatList.empty();
|
||||
}
|
||||
|
||||
HostileReference* getMostHated() { return iThreatList.empty() ? NULL : iThreatList.front(); }
|
||||
HostileReference* getMostHated() const
|
||||
{
|
||||
return iThreatList.empty() ? NULL : iThreatList.front();
|
||||
}
|
||||
|
||||
HostileReference* getReferenceByTarget(Unit* victim);
|
||||
HostileReference* getReferenceByTarget(Unit* victim) const;
|
||||
|
||||
std::list<HostileReference*>& getThreatList() { return iThreatList; }
|
||||
StorageType const & getThreatList() const { return iThreatList; }
|
||||
|
||||
private:
|
||||
void remove(HostileReference* hostileRef)
|
||||
{
|
||||
iThreatList.remove(hostileRef);
|
||||
}
|
||||
|
||||
void addReference(HostileReference* hostileRef)
|
||||
{
|
||||
iThreatList.push_back(hostileRef);
|
||||
}
|
||||
|
||||
void clearReferences();
|
||||
|
||||
// Sort the list if necessary
|
||||
void update();
|
||||
|
||||
StorageType iThreatList;
|
||||
bool iDirty;
|
||||
};
|
||||
|
||||
//=================================================
|
||||
@@ -198,15 +216,15 @@ class ThreatManager
|
||||
|
||||
float getThreat(Unit* victim, bool alsoSearchOfflineList = false);
|
||||
|
||||
bool isThreatListEmpty() { return iThreatContainer.empty(); }
|
||||
bool isThreatListEmpty() const { return iThreatContainer.empty(); }
|
||||
|
||||
void processThreatEvent(ThreatRefStatusChangeEvent* threatRefStatusChangeEvent);
|
||||
|
||||
bool isNeedUpdateToClient(uint32 time);
|
||||
|
||||
HostileReference* getCurrentVictim() { return iCurrentVictim; }
|
||||
HostileReference* getCurrentVictim() const { return iCurrentVictim; }
|
||||
|
||||
Unit* getOwner() { return iOwner; }
|
||||
Unit* getOwner() const { return iOwner; }
|
||||
|
||||
Unit* getHostilTarget();
|
||||
|
||||
@@ -223,11 +241,11 @@ class ThreatManager
|
||||
// Reset all aggro of unit in threadlist satisfying the predicate.
|
||||
template<class PREDICATE> void resetAggro(PREDICATE predicate)
|
||||
{
|
||||
std::list<HostileReference*> &threatList = getThreatList();
|
||||
ThreatContainer::StorageType &threatList = iThreatContainer.iThreatList;
|
||||
if (threatList.empty())
|
||||
return;
|
||||
|
||||
for (std::list<HostileReference*>::iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
for (ThreatContainer::StorageType::iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
{
|
||||
HostileReference* ref = (*itr);
|
||||
|
||||
@@ -241,8 +259,8 @@ class ThreatManager
|
||||
|
||||
// methods to access the lists from the outside to do some dirty manipulation (scriping and such)
|
||||
// I hope they are used as little as possible.
|
||||
std::list<HostileReference*>& getThreatList() { return iThreatContainer.getThreatList(); }
|
||||
std::list<HostileReference*>& getOfflineThreatList() { return iThreatOfflineContainer.getThreatList(); }
|
||||
ThreatContainer::StorageType const & getThreatList() const { return iThreatContainer.getThreatList(); }
|
||||
ThreatContainer::StorageType const & getOfflineThreatList() const { return iThreatOfflineContainer.getThreatList(); }
|
||||
ThreatContainer& getOnlineContainer() { return iThreatContainer; }
|
||||
ThreatContainer& getOfflineContainer() { return iThreatOfflineContainer; }
|
||||
private:
|
||||
@@ -273,4 +291,3 @@ namespace Trinity
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -17378,11 +17378,11 @@ void Unit::SendThreatListUpdate()
|
||||
WorldPacket data(SMSG_THREAT_UPDATE, 8 + count * 8);
|
||||
data.append(GetPackGUID());
|
||||
data << uint32(count);
|
||||
std::list<HostileReference*>& tlist = getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
|
||||
ThreatContainer::StorageType const &tlist = getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
|
||||
{
|
||||
data.appendPackGUID((*itr)->getUnitGuid());
|
||||
data << uint32((*itr)->getThreat() * 100);
|
||||
data << uint32((*itr)->getThreat()*100);
|
||||
}
|
||||
SendMessageToSet(&data, false);
|
||||
}
|
||||
@@ -17399,8 +17399,8 @@ void Unit::SendChangeCurrentVictimOpcode(HostileReference* pHostileReference)
|
||||
data.append(GetPackGUID());
|
||||
data.appendPackGUID(pHostileReference->getUnitGuid());
|
||||
data << uint32(count);
|
||||
std::list<HostileReference*>& tlist = getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
|
||||
ThreatContainer::StorageType const &tlist = getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
|
||||
{
|
||||
data.appendPackGUID((*itr)->getUnitGuid());
|
||||
data << uint32((*itr)->getThreat());
|
||||
|
||||
@@ -81,18 +81,22 @@ void VisibleChangesNotifier::Visit(PlayerMapType &m)
|
||||
|
||||
iter->getSource()->UpdateVisibilityOf(&i_object);
|
||||
|
||||
if (!iter->getSource()->GetSharedVisionList().empty())
|
||||
if (iter->getSource()->HasSharedVision())
|
||||
{
|
||||
for (SharedVisionList::const_iterator i = iter->getSource()->GetSharedVisionList().begin();
|
||||
i != iter->getSource()->GetSharedVisionList().end(); ++i)
|
||||
{
|
||||
if ((*i)->m_seer == iter->getSource())
|
||||
(*i)->UpdateVisibilityOf(&i_object);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VisibleChangesNotifier::Visit(CreatureMapType &m)
|
||||
{
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if (!iter->getSource()->GetSharedVisionList().empty())
|
||||
if (iter->getSource()->HasSharedVision())
|
||||
for (SharedVisionList::const_iterator i = iter->getSource()->GetSharedVisionList().begin();
|
||||
i != iter->getSource()->GetSharedVisionList().end(); ++i)
|
||||
if ((*i)->m_seer == iter->getSource())
|
||||
@@ -154,7 +158,7 @@ void PlayerRelocationNotifier::Visit(CreatureMapType &m)
|
||||
|
||||
void CreatureRelocationNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
for (PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
Player* player = iter->getSource();
|
||||
|
||||
@@ -170,7 +174,7 @@ void CreatureRelocationNotifier::Visit(CreatureMapType &m)
|
||||
if (!i_creature.isAlive())
|
||||
return;
|
||||
|
||||
for (CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
Creature* c = iter->getSource();
|
||||
CreatureUnitRelocationWorker(&i_creature, c);
|
||||
@@ -249,7 +253,7 @@ void MessageDistDeliverer::Visit(PlayerMapType &m)
|
||||
continue;
|
||||
|
||||
// Send packet to all who are sharing the player's vision
|
||||
if (!target->GetSharedVisionList().empty())
|
||||
if (target->HasSharedVision())
|
||||
{
|
||||
SharedVisionList::const_iterator i = target->GetSharedVisionList().begin();
|
||||
for (; i != target->GetSharedVisionList().end(); ++i)
|
||||
@@ -274,7 +278,7 @@ void MessageDistDeliverer::Visit(CreatureMapType &m)
|
||||
continue;
|
||||
|
||||
// Send packet to all who are sharing the creature's vision
|
||||
if (!target->GetSharedVisionList().empty())
|
||||
if (target->HasSharedVision())
|
||||
{
|
||||
SharedVisionList::const_iterator i = target->GetSharedVisionList().begin();
|
||||
for (; i != target->GetSharedVisionList().end(); ++i)
|
||||
|
||||
@@ -798,8 +798,8 @@ public:
|
||||
if (!target || target->isTotem() || target->isPet())
|
||||
return false;
|
||||
|
||||
std::list<HostileReference*>& threatList = target->getThreatManager().getThreatList();
|
||||
std::list<HostileReference*>::iterator itr;
|
||||
ThreatContainer::StorageType const &threatList = target->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator itr;
|
||||
uint32 count = 0;
|
||||
handler->PSendSysMessage("Threat list of %s (guid %u)", target->GetName().c_str(), target->GetGUIDLow());
|
||||
for (itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
|
||||
@@ -240,8 +240,8 @@ public:
|
||||
//Affliction_Timer
|
||||
if (Affliction_Timer <= diff)
|
||||
{
|
||||
std::list<HostileReference*> threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
if ((*i) && (*i)->getSource())
|
||||
{
|
||||
|
||||
@@ -187,13 +187,11 @@ public:
|
||||
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1))
|
||||
DoCast(target, SPELL_HATEFUL_BOLT);
|
||||
|
||||
} else HatefulBoltTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_curator()
|
||||
|
||||
@@ -132,9 +132,7 @@ public:
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_maiden_of_virtue()
|
||||
|
||||
@@ -111,7 +111,6 @@ public:
|
||||
DoScriptText(SAY_DISARMED, me);
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_midnight : public CreatureScript
|
||||
@@ -232,7 +231,6 @@ public:
|
||||
CAST_AI(boss_attumen::boss_attumenAI, pAttumen->AI())->Midnight = value;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void boss_attumen::boss_attumenAI::UpdateAI(const uint32 diff)
|
||||
@@ -284,9 +282,9 @@ void boss_attumen::boss_attumenAI::UpdateAI(const uint32 diff)
|
||||
if (ChargeTimer <= diff)
|
||||
{
|
||||
Unit* target = NULL;
|
||||
std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
|
||||
std::vector<Unit*> target_list;
|
||||
for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr != t_list.end(); ++itr)
|
||||
{
|
||||
target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (target && !target->IsWithinDist(me, ATTACK_DISTANCE, false))
|
||||
|
||||
@@ -307,7 +307,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
struct boss_moroes_guestAI : public ScriptedAI
|
||||
@@ -452,7 +451,6 @@ public:
|
||||
} else ShadowWordPain_Timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_baron_rafe_dreuger : public CreatureScript
|
||||
@@ -510,7 +508,6 @@ public:
|
||||
} else HammerOfJustice_Timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_lady_catriona_von_indi : public CreatureScript
|
||||
@@ -581,7 +578,6 @@ public:
|
||||
} else DispelMagic_Timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_lady_keira_berrybuck : public CreatureScript
|
||||
@@ -656,7 +652,6 @@ public:
|
||||
} else Cleanse_Timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_lord_robin_daris : public CreatureScript
|
||||
@@ -713,7 +708,6 @@ public:
|
||||
} else WhirlWind_Timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_lord_crispin_ference : public CreatureScript
|
||||
@@ -778,7 +772,6 @@ public:
|
||||
} else ShieldWall_Timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_moroes()
|
||||
|
||||
@@ -333,7 +333,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_netherspite()
|
||||
|
||||
@@ -413,7 +413,6 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_nightbane()
|
||||
|
||||
@@ -169,7 +169,6 @@ public:
|
||||
|
||||
void Cleanup();
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_malchezaar : public CreatureScript
|
||||
@@ -314,14 +313,14 @@ public:
|
||||
if (!info)
|
||||
return;
|
||||
|
||||
std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
|
||||
std::vector<Unit*> targets;
|
||||
|
||||
if (t_list.empty())
|
||||
return;
|
||||
|
||||
//begin + 1, so we don't target the one with the highest threat
|
||||
std::list<HostileReference*>::const_iterator itr = t_list.begin();
|
||||
ThreatContainer::StorageType::const_iterator itr = t_list.begin();
|
||||
std::advance(itr, 1);
|
||||
for (; itr != t_list.end(); ++itr) //store the threat list in a different container
|
||||
if (Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
@@ -483,14 +482,12 @@ public:
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SUNDER_ARMOR);
|
||||
SunderArmorTimer = urand(10000, 18000);
|
||||
|
||||
} else SunderArmorTimer -= diff;
|
||||
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = urand(6000, 12000);
|
||||
|
||||
} else Cleave_Timer -= diff;
|
||||
}
|
||||
else
|
||||
@@ -602,15 +599,14 @@ public:
|
||||
positions.push_back(point);
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void netherspite_infernal::netherspite_infernalAI::Cleanup()
|
||||
{
|
||||
Unit* pMalchezaar = Unit::GetUnit(*me, malchezaar);
|
||||
Creature *pMalchezaar = Unit::GetCreature(*me, malchezaar);
|
||||
|
||||
if (pMalchezaar && pMalchezaar->isAlive())
|
||||
CAST_AI(boss_malchezaar::boss_malchezaarAI, CAST_CRE(pMalchezaar)->AI())->Cleanup(me, point);
|
||||
CAST_AI(boss_malchezaar::boss_malchezaarAI, pMalchezaar->AI())->Cleanup(me, point);
|
||||
}
|
||||
|
||||
void AddSC_boss_malchezaar()
|
||||
|
||||
@@ -187,13 +187,13 @@ public:
|
||||
void FlameWreathEffect()
|
||||
{
|
||||
std::vector<Unit*> targets;
|
||||
std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
|
||||
|
||||
if (t_list.empty())
|
||||
return;
|
||||
|
||||
//store the threat list in a different container
|
||||
for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
{
|
||||
Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
//only on alive players
|
||||
@@ -508,7 +508,6 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class mob_aran_elemental : public CreatureScript
|
||||
@@ -546,7 +545,6 @@ public:
|
||||
} else CastTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_shade_of_aran()
|
||||
|
||||
@@ -127,7 +127,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class mob_demon_chain : public CreatureScript
|
||||
@@ -165,7 +164,6 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class mob_fiendish_portal : public CreatureScript
|
||||
@@ -200,7 +198,6 @@ public:
|
||||
summons.DespawnAll();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#define SPELL_FIREBOLT 30050 // Blasts a target for 181-209 Fire damage.
|
||||
@@ -245,7 +242,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_terestian_illhoof : public CreatureScript
|
||||
@@ -422,7 +418,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_terestian_illhoof()
|
||||
|
||||
@@ -216,7 +216,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class mob_tito : public CreatureScript
|
||||
@@ -271,7 +270,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void boss_dorothee::boss_dorotheeAI::SummonTito()
|
||||
@@ -398,7 +396,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_tinhead : public CreatureScript
|
||||
@@ -508,7 +505,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_roar : public CreatureScript
|
||||
@@ -617,7 +613,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_crone : public CreatureScript
|
||||
@@ -699,7 +694,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class mob_cyclone : public CreatureScript
|
||||
@@ -743,7 +737,6 @@ public:
|
||||
} else MoveTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
/**************************************/
|
||||
@@ -792,7 +785,6 @@ public:
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class boss_bigbadwolf : public CreatureScript
|
||||
@@ -915,10 +907,8 @@ public:
|
||||
DoCast(me->getVictim(), SPELL_WIDE_SWIPE);
|
||||
SwipeTimer = urand(25000, 30000);
|
||||
} else SwipeTimer -= diff;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
/**********************************************/
|
||||
@@ -977,7 +967,7 @@ void PretendToDie(Creature* creature)
|
||||
creature->GetMotionMaster()->MovementExpired(false);
|
||||
creature->GetMotionMaster()->MoveIdle();
|
||||
creature->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
};
|
||||
}
|
||||
|
||||
void Resurrect(Creature* target)
|
||||
{
|
||||
@@ -992,7 +982,7 @@ void Resurrect(Creature* target)
|
||||
}
|
||||
else
|
||||
target->GetMotionMaster()->Initialize();
|
||||
};
|
||||
}
|
||||
|
||||
class boss_julianne : public CreatureScript
|
||||
{
|
||||
@@ -1114,7 +1104,6 @@ public:
|
||||
|
||||
void UpdateAI(const uint32 diff);
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_romulo : public CreatureScript
|
||||
@@ -1321,7 +1310,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void boss_julianne::boss_julianneAI::UpdateAI(const uint32 diff)
|
||||
|
||||
@@ -288,7 +288,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Load(const char* chrIn)
|
||||
void Load(char const* chrIn)
|
||||
{
|
||||
if (!chrIn)
|
||||
{
|
||||
@@ -308,7 +308,6 @@ public:
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_instance_karazhan()
|
||||
|
||||
@@ -321,7 +321,6 @@ public:
|
||||
WipeTimer = 15000;
|
||||
} else WipeTimer -= diff;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -344,17 +343,17 @@ public:
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
pBarnesAI->m_uiEventId = EVENT_OZ;
|
||||
sLog->outInfo(LOG_FILTER_TSCR, "TSCR: player (GUID " UI64FMTD ") manually set Opera event to EVENT_OZ", player->GetGUID());
|
||||
sLog->outInfo(LOG_FILTER_TSCR, "player (GUID " UI64FMTD ") manually set Opera event to EVENT_OZ", player->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+4:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
pBarnesAI->m_uiEventId = EVENT_HOOD;
|
||||
sLog->outInfo(LOG_FILTER_TSCR, "TSCR: player (GUID " UI64FMTD ") manually set Opera event to EVENT_HOOD", player->GetGUID());
|
||||
sLog->outInfo(LOG_FILTER_TSCR, "player (GUID " UI64FMTD ") manually set Opera event to EVENT_HOOD", player->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+5:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
pBarnesAI->m_uiEventId = EVENT_RAJ;
|
||||
sLog->outInfo(LOG_FILTER_TSCR, "TSCR: player (GUID " UI64FMTD ") manually set Opera event to EVENT_RAJ", player->GetGUID());
|
||||
sLog->outInfo(LOG_FILTER_TSCR, "player (GUID " UI64FMTD ") manually set Opera event to EVENT_RAJ", player->GetGUID());
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -397,7 +396,6 @@ public:
|
||||
{
|
||||
return new npc_barnesAI(creature);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/*###
|
||||
@@ -438,7 +436,6 @@ public:
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/*###
|
||||
@@ -538,7 +535,7 @@ public:
|
||||
|
||||
uint32 NextStep(uint32 Step)
|
||||
{
|
||||
Unit* arca = Unit::GetUnit(*me, ArcanagosGUID);
|
||||
Creature* arca = Unit::GetCreature(*me, ArcanagosGUID);
|
||||
Map* map = me->GetMap();
|
||||
switch (Step)
|
||||
{
|
||||
@@ -548,21 +545,21 @@ public:
|
||||
return 10000;
|
||||
case 2:
|
||||
if (arca)
|
||||
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_2, LANG_UNIVERSAL, 0);
|
||||
arca->MonsterYell(SAY_DIALOG_ARCANAGOS_2, LANG_UNIVERSAL, 0);
|
||||
return 20000;
|
||||
case 3:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_3, LANG_UNIVERSAL, 0);
|
||||
return 10000;
|
||||
case 4:
|
||||
if (arca)
|
||||
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, 0);
|
||||
arca->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, 0);
|
||||
return 20000;
|
||||
case 5:
|
||||
me->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, 0);
|
||||
return 20000;
|
||||
case 6:
|
||||
if (arca)
|
||||
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, 0);
|
||||
arca->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, 0);
|
||||
return 10000;
|
||||
case 7:
|
||||
FireArcanagosTimer = 500;
|
||||
@@ -580,7 +577,7 @@ public:
|
||||
return 1000;
|
||||
case 11:
|
||||
if (arca)
|
||||
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, 0);
|
||||
arca->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, 0);
|
||||
return 5000;
|
||||
case 12:
|
||||
arca->GetMotionMaster()->MovePoint(0, -11010.82f, -1761.18f, 156.47f);
|
||||
@@ -613,12 +610,10 @@ public:
|
||||
return 5000;
|
||||
default : return 9999999;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
|
||||
if (YellTimer <= diff)
|
||||
{
|
||||
if (EventStarted)
|
||||
@@ -645,7 +640,6 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_karazhan()
|
||||
|
||||
@@ -64,4 +64,3 @@ enum OperaEvents
|
||||
|
||||
#define ERROR_INST_DATA(a) sLog->outError(LOG_FILTER_TSCR, "Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry());
|
||||
#endif
|
||||
|
||||
@@ -189,20 +189,20 @@ public:
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void SetThreatList(Creature* SummonedUnit)
|
||||
void SetThreatList(Creature* summonedUnit)
|
||||
{
|
||||
if (!SummonedUnit)
|
||||
if (!summonedUnit)
|
||||
return;
|
||||
|
||||
std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
|
||||
std::list<HostileReference*>::const_iterator i = m_threatlist.begin();
|
||||
for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
|
||||
ThreatContainer::StorageType const &threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator i = threatlist.begin();
|
||||
for (i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
|
||||
if (unit && unit->isAlive())
|
||||
{
|
||||
float threat = me->getThreatManager().getThreat(unit);
|
||||
SummonedUnit->AddThreat(unit, threat);
|
||||
summonedUnit->AddThreat(unit, threat);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -212,9 +212,9 @@ public:
|
||||
float x = KaelLocations[0][0];
|
||||
float y = KaelLocations[0][1];
|
||||
me->SetPosition(x, y, LOCATION_Z, 0.0f);
|
||||
//me->SendMonsterMove(x, y, LOCATION_Z, 0, 0, 0); // causes some issues...
|
||||
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
|
||||
for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator i = threatlist.begin();
|
||||
for (i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
|
||||
if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
|
||||
@@ -225,8 +225,9 @@ public:
|
||||
|
||||
void CastGravityLapseKnockUp()
|
||||
{
|
||||
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
|
||||
for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator i = threatlist.begin();
|
||||
for (i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
|
||||
if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
|
||||
@@ -237,8 +238,9 @@ public:
|
||||
|
||||
void CastGravityLapseFly() // Use Fly Packet hack for now as players can't cast "fly" spells unless in map 530. Has to be done a while after they get knocked into the air...
|
||||
{
|
||||
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
|
||||
for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator i = threatlist.begin();
|
||||
for (i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
|
||||
if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
|
||||
@@ -257,8 +259,9 @@ public:
|
||||
|
||||
void RemoveGravityLapse()
|
||||
{
|
||||
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
|
||||
for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator i = threatlist.begin();
|
||||
for (i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
|
||||
if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
|
||||
@@ -306,7 +309,6 @@ public:
|
||||
|
||||
if (PhoenixTimer <= diff)
|
||||
{
|
||||
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
|
||||
|
||||
uint8 random = urand(1, 2);
|
||||
@@ -410,7 +412,6 @@ public:
|
||||
Orb->AddThreat(target, 1000000.0f);
|
||||
Orb->AI()->AttackStart(target);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DoCast(me, SPELL_GRAVITY_LAPSE_CHANNEL);
|
||||
@@ -431,7 +432,6 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class mob_felkael_flamestrike : public CreatureScript
|
||||
@@ -473,7 +473,6 @@ public:
|
||||
} else FlameStrikeTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class mob_felkael_phoenix : public CreatureScript
|
||||
@@ -522,7 +521,6 @@ public:
|
||||
{
|
||||
damage = 0;
|
||||
return;
|
||||
|
||||
}
|
||||
//Don't really die in all phases of Kael'Thas
|
||||
if (instance && instance->GetData(DATA_KAELTHAS_EVENT) == 0)
|
||||
@@ -544,9 +542,7 @@ public:
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
me->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
@@ -556,7 +552,6 @@ public:
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
|
||||
//If we are fake death, we cast revbirth and after that we kill the phoenix to spawn the egg.
|
||||
if (FakeDeath)
|
||||
{
|
||||
@@ -568,7 +563,6 @@ public:
|
||||
|
||||
if (Rebirth)
|
||||
{
|
||||
|
||||
if (Death_Timer <= diff)
|
||||
{
|
||||
me->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
|
||||
@@ -576,7 +570,6 @@ public:
|
||||
Rebirth = false;
|
||||
} else Death_Timer -= diff;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
@@ -593,7 +586,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class mob_felkael_phoenix_egg : public CreatureScript
|
||||
@@ -627,10 +619,8 @@ public:
|
||||
me->SummonCreature(CREATURE_PHOENIX, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
|
||||
me->Kill(me);
|
||||
} else HatchTimer -= diff;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class mob_arcane_sphere : public CreatureScript
|
||||
@@ -687,7 +677,6 @@ public:
|
||||
} else ChangeTargetTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_felblood_kaelthas()
|
||||
|
||||
@@ -331,7 +331,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
enum eHealingPotion
|
||||
@@ -574,7 +573,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
enum eWarlockSpells
|
||||
@@ -671,7 +669,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
enum eKickDown
|
||||
@@ -728,7 +725,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
enum eMageSpells
|
||||
@@ -835,8 +831,8 @@ public:
|
||||
if (Blink_Timer <= diff)
|
||||
{
|
||||
bool InMeleeRange = false;
|
||||
std::list<HostileReference*>& t_list = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
{
|
||||
if (Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
{
|
||||
@@ -859,7 +855,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
enum eWarriorSpells
|
||||
@@ -922,8 +917,8 @@ public:
|
||||
if (Intercept_Stun_Timer <= diff)
|
||||
{
|
||||
bool InMeleeRange = false;
|
||||
std::list<HostileReference*>& t_list = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
{
|
||||
if (Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
{
|
||||
@@ -979,7 +974,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
enum eHunterSpells
|
||||
@@ -1103,7 +1097,6 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
enum Spells
|
||||
@@ -1203,7 +1196,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
enum eEngineerSpells
|
||||
@@ -1298,7 +1290,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -105,20 +105,20 @@ public:
|
||||
for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
|
||||
{
|
||||
//Unit* unit = Unit::GetUnit(*me, FelCrystals[i]);
|
||||
Unit* unit = Unit::GetUnit(*me, *itr);
|
||||
if (unit)
|
||||
if (Creature *creature = Unit::GetCreature(*me, *itr))
|
||||
{
|
||||
if (!unit->isAlive())
|
||||
CAST_CRE(unit)->Respawn(); // Let the core handle setting death state, etc.
|
||||
if (!creature->isAlive())
|
||||
creature->Respawn(); // Let the core handle setting death state, etc.
|
||||
|
||||
// Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here.
|
||||
unit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
}
|
||||
|
||||
instance->HandleGameObject(instance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true);
|
||||
// Open the big encounter door. Close it in Aggro and open it only in JustDied(and here)
|
||||
// Small door opened after event are expected to be closed by default
|
||||
// Small door opened after event are expected to be closed by default
|
||||
|
||||
// Set Inst data for encounter
|
||||
instance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
|
||||
} else sLog->outError(LOG_FILTER_TSCR, ERROR_INST_DATA);
|
||||
@@ -291,7 +291,6 @@ public:
|
||||
DrainCrystalTimer = urand(20000, 25000);
|
||||
} else DrainCrystalTimer -= diff;
|
||||
}
|
||||
|
||||
}else
|
||||
{
|
||||
if (IsDraining)
|
||||
@@ -319,7 +318,6 @@ public:
|
||||
DoMeleeAttackIfReady(); // No need to check if we are draining crystal here, as the spell has a stun.
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class mob_fel_crystal : public CreatureScript
|
||||
@@ -365,7 +363,6 @@ public:
|
||||
} else sLog->outError(LOG_FILTER_TSCR, ERROR_INST_DATA);
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_selin_fireheart()
|
||||
|
||||
@@ -192,7 +192,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class mob_pure_energy : public CreatureScript
|
||||
@@ -224,7 +223,6 @@ public:
|
||||
void MoveInLineOfSight(Unit* /*who*/) {}
|
||||
void AttackStart(Unit* /*who*/) {}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_vexallus()
|
||||
|
||||
@@ -262,7 +262,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_instance_magisters_terrace()
|
||||
|
||||
@@ -140,14 +140,14 @@ public:
|
||||
if (lList.isEmpty())
|
||||
return;
|
||||
|
||||
SpellInfo const* pSpell = sSpellMgr->GetSpellInfo(SPELL_ORB_KILL_CREDIT);
|
||||
SpellInfo const* spell = sSpellMgr->GetSpellInfo(SPELL_ORB_KILL_CREDIT);
|
||||
|
||||
for (Map::PlayerList::const_iterator i = lList.begin(); i != lList.end(); ++i)
|
||||
{
|
||||
if (Player* player = i->getSource())
|
||||
{
|
||||
if (pSpell && pSpell->Effects[0].MiscValue)
|
||||
player->KilledMonsterCredit(pSpell->Effects[0].MiscValue, 0);
|
||||
if (spell && spell->Effects[0].MiscValue)
|
||||
player->KilledMonsterCredit(spell->Effects[0].MiscValue, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -170,7 +170,6 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_magisters_terrace()
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#define DEF_MAGISTERS_TERRACE_H
|
||||
|
||||
#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy."
|
||||
#endif
|
||||
|
||||
enum Data
|
||||
{
|
||||
@@ -47,3 +46,5 @@ enum Data
|
||||
|
||||
DATA_ESCAPE_ORB = 16
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -46,7 +46,7 @@ uint32 RandomLaugh[] = {11965, 11975, 11976};
|
||||
enum Entry
|
||||
{
|
||||
HH_MOUNTED = 23682,
|
||||
HH_DISMOUNTED = 23800, // unhorsed?? wtf type of engrish was that?
|
||||
HH_DISMOUNTED = 23800,
|
||||
HEAD = 23775,
|
||||
PULSING_PUMPKIN = 23694,
|
||||
PUMPKIN_FIEND = 23545,
|
||||
@@ -127,7 +127,7 @@ static Locations Spawn[]=
|
||||
{1765.28f, 1347.46f, 17.55f} //spawn point for smoke
|
||||
};
|
||||
|
||||
static const char* Text[]=
|
||||
static char const* Text[]=
|
||||
{
|
||||
"Horseman rise...",
|
||||
"Your time is nigh...",
|
||||
@@ -592,8 +592,8 @@ public:
|
||||
caster->GetMotionMaster()->Clear(false);
|
||||
caster->GetMotionMaster()->MoveFollow(me, 6, float(urand(0, 5)));
|
||||
//DoResetThreat();//not sure if need
|
||||
std::list<HostileReference*>::const_iterator itr;
|
||||
for (itr = caster->getThreatManager().getThreatList().begin(); itr != caster->getThreatManager().getThreatList().end(); ++itr)
|
||||
ThreatContainer::StorageType threatlist = caster->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (unit && unit->isAlive() && unit != caster)
|
||||
|
||||
@@ -153,12 +153,7 @@ public:
|
||||
uint32 Start_Timer;
|
||||
|
||||
void Reset() {}
|
||||
|
||||
void WaypointReached(uint32 /*waypointId*/)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 /*waypointId*/) {}
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
@@ -344,7 +344,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_brutallus()
|
||||
|
||||
@@ -121,13 +121,12 @@ public:
|
||||
|
||||
if (instance)
|
||||
{
|
||||
Unit* Temp = Unit::GetUnit(*me, instance->GetData64(DATA_ALYTHESS));
|
||||
if (Temp)
|
||||
if (Creature *temp = Unit::GetCreature(*me, instance->GetData64(DATA_ALYTHESS)))
|
||||
{
|
||||
if (Temp->isDead())
|
||||
CAST_CRE(Temp)->Respawn();
|
||||
else if (Temp->getVictim())
|
||||
me->getThreatManager().addThreat(Temp->getVictim(), 0.0f);
|
||||
if (temp->isDead())
|
||||
temp->Respawn();
|
||||
else if (temp->getVictim())
|
||||
me->getThreatManager().addThreat(temp->getVictim(), 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,9 +152,9 @@ public:
|
||||
|
||||
if (instance)
|
||||
{
|
||||
Unit* Temp = Unit::GetUnit(*me, instance->GetData64(DATA_ALYTHESS));
|
||||
if (Temp && Temp->isAlive() && !(Temp->getVictim()))
|
||||
CAST_CRE(Temp)->AI()->AttackStart(who);
|
||||
Creature *temp = Unit::GetCreature(*me, instance->GetData64(DATA_ALYTHESS));
|
||||
if (temp && temp->isAlive() && !temp->getVictim())
|
||||
temp->AI()->AttackStart(who);
|
||||
}
|
||||
|
||||
if (instance)
|
||||
@@ -341,7 +340,6 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_alythess : public CreatureScript
|
||||
@@ -383,13 +381,12 @@ public:
|
||||
|
||||
if (instance)
|
||||
{
|
||||
Unit* Temp = Unit::GetUnit(*me, instance->GetData64(DATA_SACROLASH));
|
||||
if (Temp)
|
||||
if (Creature *temp = Unit::GetCreature((*me), instance->GetData64(DATA_SACROLASH)))
|
||||
{
|
||||
if (Temp->isDead())
|
||||
CAST_CRE(Temp)->Respawn();
|
||||
else if (Temp->getVictim())
|
||||
me->getThreatManager().addThreat(Temp->getVictim(), 0.0f);
|
||||
if (temp->isDead())
|
||||
temp->Respawn();
|
||||
else if (temp->getVictim())
|
||||
me->getThreatManager().addThreat(temp->getVictim(), 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -416,9 +413,9 @@ public:
|
||||
|
||||
if (instance)
|
||||
{
|
||||
Unit* Temp = Unit::GetUnit(*me, instance->GetData64(DATA_SACROLASH));
|
||||
if (Temp && Temp->isAlive() && !(Temp->getVictim()))
|
||||
CAST_CRE(Temp)->AI()->AttackStart(who);
|
||||
Creature *temp = Unit::GetCreature(*me, instance->GetData64(DATA_SACROLASH));
|
||||
if (temp && temp->isAlive() && !temp->getVictim())
|
||||
temp->AI()->AttackStart(who);
|
||||
}
|
||||
|
||||
if (instance)
|
||||
@@ -480,7 +477,6 @@ public:
|
||||
{
|
||||
switch (spell->Id)
|
||||
{
|
||||
|
||||
case SPELL_BLAZE:
|
||||
target->CastSpell(target, SPELL_BLAZE_SUMMON, true);
|
||||
case SPELL_CONFLAGRATION:
|
||||
@@ -670,7 +666,6 @@ public:
|
||||
} else EnrageTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class mob_shadow_image : public CreatureScript
|
||||
@@ -705,7 +700,6 @@ public:
|
||||
{
|
||||
switch (spell->Id)
|
||||
{
|
||||
|
||||
case SPELL_SHADOW_FURY:
|
||||
case SPELL_DARK_STRIKE:
|
||||
if (!target->HasAura(SPELL_DARK_FLAME))
|
||||
@@ -752,7 +746,6 @@ public:
|
||||
} else DarkstrikeTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_eredar_twins()
|
||||
|
||||
@@ -512,7 +512,6 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class mob_felmyst_vapor : public CreatureScript
|
||||
@@ -545,7 +544,6 @@ public:
|
||||
AttackStart(target);
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class mob_felmyst_trail : public CreatureScript
|
||||
@@ -573,7 +571,6 @@ public:
|
||||
void MoveInLineOfSight(Unit* /*who*/) {}
|
||||
void UpdateAI(const uint32 /*diff*/) {}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_felmyst()
|
||||
|
||||
@@ -304,11 +304,20 @@ public:
|
||||
|
||||
if (SpectralBlastTimer <= diff)
|
||||
{
|
||||
std::list<HostileReference*> &m_threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const& m_threatlist = me->getThreatManager().getThreatList();
|
||||
std::list<Unit*> targetList;
|
||||
for (std::list<HostileReference*>::const_iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
|
||||
if ((*itr)->getTarget() && (*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER && (*itr)->getTarget()->GetGUID() != me->getVictim()->GetGUID() && !(*itr)->getTarget()->HasAura(AURA_SPECTRAL_EXHAUSTION) && (*itr)->getTarget()->GetPositionZ() > me->GetPositionZ()-5)
|
||||
targetList.push_back((*itr)->getTarget());
|
||||
for (ThreatContainer::StorageType::const_iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
|
||||
{
|
||||
Unit* target = (*itr)->getTarget();
|
||||
if (target
|
||||
&& target->GetTypeId() == TYPEID_PLAYER
|
||||
&& target->GetGUID() != me->getVictim()->GetGUID()
|
||||
&& target->GetPositionZ() > me->GetPositionZ() - 5
|
||||
&& !target->HasAura(AURA_SPECTRAL_EXHAUSTION))
|
||||
{
|
||||
targetList.push_back(target);
|
||||
}
|
||||
}
|
||||
if (targetList.empty())
|
||||
{
|
||||
SpectralBlastTimer = 1000;
|
||||
@@ -431,7 +440,6 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_kalec : public CreatureScript
|
||||
@@ -533,7 +541,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class kalecgos_teleporter : public GameObjectScript
|
||||
@@ -561,7 +568,6 @@ public:
|
||||
player->CastSpell(player, SPELL_TELEPORT_SPECTRAL, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class boss_sathrovarr : public CreatureScript
|
||||
@@ -761,15 +767,12 @@ public:
|
||||
|
||||
if (ResetThreat <= diff)
|
||||
{
|
||||
for (std::list<HostileReference*>::const_iterator itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr)
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
{
|
||||
if (Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
{
|
||||
if (unit->GetPositionZ() > me->GetPositionZ()+5)
|
||||
{
|
||||
if (unit->GetPositionZ() > me->GetPositionZ() + 5)
|
||||
me->getThreatManager().modifyThreatPercent(unit, -100);
|
||||
}
|
||||
}
|
||||
}
|
||||
ResetThreat = 1000;
|
||||
} else ResetThreat -= diff;
|
||||
@@ -799,7 +802,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_kalecgos()
|
||||
|
||||
@@ -367,7 +367,6 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class go_orb_of_the_blue_flight : public GameObjectScript
|
||||
@@ -391,7 +390,6 @@ public:
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
//AI for Kil'jaeden Event Controller
|
||||
@@ -492,7 +490,6 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
//AI for Kil'jaeden
|
||||
@@ -900,7 +897,6 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
//AI for Hand of the Deceiver
|
||||
@@ -987,8 +983,8 @@ public:
|
||||
{
|
||||
if (Creature* pPortal = DoSpawnCreature(CREATURE_FELFIRE_PORTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 20000))
|
||||
{
|
||||
std::list<HostileReference*>::iterator itr;
|
||||
for (itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr)
|
||||
ThreatContainer::StorageType const &threatlist = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (unit)
|
||||
@@ -1001,7 +997,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
//AI for Felfire Portal
|
||||
@@ -1046,7 +1041,6 @@ public:
|
||||
} else uiSpawnFiendTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
//AI for Felfire Fiend
|
||||
@@ -1104,7 +1098,6 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
//AI for Armageddon target
|
||||
@@ -1159,7 +1152,6 @@ public:
|
||||
} else uiTimer -=diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
//AI for Shield Orbs
|
||||
@@ -1247,7 +1239,6 @@ public:
|
||||
bPointReached = true;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
//AI for Sinister Reflection
|
||||
@@ -1310,7 +1301,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
switch (victimClass) {
|
||||
switch (victimClass)
|
||||
{
|
||||
case CLASS_DRUID:
|
||||
if (uiTimer[1] <= diff)
|
||||
{
|
||||
@@ -1411,13 +1403,12 @@ public:
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
break;
|
||||
}
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "Sinister-Timer");
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
uiTimer[i] -= diff;
|
||||
}
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "Sinister-Timer");
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
uiTimer[i] -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_kiljaeden()
|
||||
|
||||
@@ -199,7 +199,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_muru : public CreatureScript
|
||||
@@ -364,7 +363,6 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class npc_muru_portal : public CreatureScript
|
||||
@@ -448,7 +446,6 @@ public:
|
||||
} else SummonTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class npc_dark_fiend : public CreatureScript
|
||||
@@ -500,7 +497,6 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (me->IsWithinDist(me->getVictim(), 5))
|
||||
{
|
||||
DoCastAOE(SPELL_DARKFIEND_AOE, false);
|
||||
@@ -511,7 +507,6 @@ public:
|
||||
} else WaitTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class npc_void_sentinel : public CreatureScript
|
||||
@@ -567,7 +562,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class npc_blackhole : public CreatureScript
|
||||
@@ -646,7 +640,6 @@ public:
|
||||
else DespawnTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_muru()
|
||||
|
||||
@@ -134,8 +134,9 @@ public:
|
||||
return player;
|
||||
}
|
||||
}
|
||||
else
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!");
|
||||
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -281,7 +282,7 @@ public:
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
void Load(char const* in)
|
||||
{
|
||||
if (!in)
|
||||
{
|
||||
@@ -299,7 +300,6 @@ public:
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_instance_sunwell_plateau()
|
||||
|
||||
@@ -129,7 +129,6 @@ public:
|
||||
} else CheckTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
/* This script is merely a placeholder for the Doomfire that triggers Doomfire spell. It will
|
||||
@@ -220,7 +219,6 @@ public:
|
||||
} else ChangeTargetTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
/* Finally, Archimonde's script. His script isn't extremely complex, most are simply spells on timers.
|
||||
@@ -315,8 +313,8 @@ public:
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
|
||||
if (victim && (victim->GetTypeId() == TYPEID_PLAYER))
|
||||
GainSoulCharge(CAST_PLR(victim));
|
||||
if (victim && victim->GetTypeId() == TYPEID_PLAYER)
|
||||
GainSoulCharge(victim->ToPlayer());
|
||||
}
|
||||
|
||||
void GainSoulCharge(Player* victim)
|
||||
@@ -360,13 +358,13 @@ public:
|
||||
if (victim && me->IsWithinDistInMap(victim, me->GetAttackDistance(victim)))
|
||||
return false;
|
||||
|
||||
std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
|
||||
if (m_threatlist.empty())
|
||||
ThreatContainer::StorageType const &threatlist = me->getThreatManager().getThreatList();
|
||||
if (threatlist.empty())
|
||||
return false;
|
||||
|
||||
std::list<Unit*> targets;
|
||||
std::list<HostileReference*>::const_iterator itr = m_threatlist.begin();
|
||||
for (; itr != m_threatlist.end(); ++itr)
|
||||
ThreatContainer::StorageType::const_iterator itr = threatlist.begin();
|
||||
for (; itr != threatlist.end(); ++itr)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (unit && unit->isAlive())
|
||||
@@ -637,13 +635,8 @@ public:
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 /*waypointId*/)
|
||||
{
|
||||
|
||||
}
|
||||
void WaypointReached(uint32 /*waypointId*/) { }
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_archimonde()
|
||||
|
||||
@@ -90,9 +90,9 @@ public:
|
||||
if (TeleportTimer <= diff)
|
||||
{
|
||||
DoScriptText(SAY_TELEPORT, me);
|
||||
std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
|
||||
std::list<HostileReference*>::const_iterator i = threatlist.begin();
|
||||
for (i = threatlist.begin(); i!= threatlist.end(); ++i)
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator i = threatlist.begin();
|
||||
for (i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
|
||||
if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
|
||||
@@ -158,7 +158,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_azuregos()
|
||||
|
||||
@@ -59,7 +59,8 @@ enum Yells
|
||||
SAY_REQUEST_AID = -1533103, //start of phase 3
|
||||
SAY_ANSWER_REQUEST = -1533104 //lich king answer
|
||||
};
|
||||
enum Event
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_NONE,
|
||||
EVENT_BOLT,
|
||||
@@ -607,13 +608,17 @@ public:
|
||||
case EVENT_DETONATE:
|
||||
{
|
||||
std::vector<Unit*> unitList;
|
||||
std::list<HostileReference*> *threatList = &me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = threatList->begin(); itr != threatList->end(); ++itr)
|
||||
ThreatContainer::StorageType const &threatList = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER
|
||||
&& (*itr)->getTarget()->getPowerType() == POWER_MANA
|
||||
&& (*itr)->getTarget()->GetPower(POWER_MANA))
|
||||
unitList.push_back((*itr)->getTarget());
|
||||
Unit * const target = (*itr)->getTarget();
|
||||
|
||||
if (target->GetTypeId() == TYPEID_PLAYER
|
||||
&& target->getPowerType() == POWER_MANA
|
||||
&& target->GetPower(POWER_MANA))
|
||||
{
|
||||
unitList.push_back(target);
|
||||
}
|
||||
}
|
||||
|
||||
if (!unitList.empty())
|
||||
@@ -654,7 +659,6 @@ public:
|
||||
{
|
||||
return new boss_kelthuzadAI (creature);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class at_kelthuzad_center : public AreaTriggerScript
|
||||
|
||||
@@ -305,8 +305,8 @@ public:
|
||||
summons.DespawnAll();
|
||||
// players that used Hover Disk are no in the aggro list
|
||||
me->SetInCombatWithZone();
|
||||
std::list<HostileReference*> &m_threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
|
||||
ThreatContainer::StorageType const& m_threatlist = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
|
||||
{
|
||||
if (Unit* target = (*itr)->getTarget())
|
||||
{
|
||||
@@ -683,8 +683,8 @@ class spell_malygos_vortex_visual : public SpellScriptLoader
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
std::list<HostileReference*> &m_threatlist = caster->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
|
||||
ThreatContainer::StorageType const& m_threatlist = caster->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
|
||||
{
|
||||
if (Unit* target = (*itr)->getTarget())
|
||||
{
|
||||
|
||||
@@ -80,8 +80,8 @@ public:
|
||||
|
||||
void SonicBoomEffect()
|
||||
{
|
||||
std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
{
|
||||
Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (target && target->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -165,8 +165,8 @@ public:
|
||||
// Thundering Storm
|
||||
if (ThunderingStorm_Timer <= diff)
|
||||
{
|
||||
std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
if (Unit* target = Unit::GetUnit(*me, (*i)->getUnitGuid()))
|
||||
if (target->isAlive() && !me->IsWithinDist(target, 35, false))
|
||||
DoCast(target, SPELL_THUNDERING_STORM, true);
|
||||
@@ -188,8 +188,8 @@ public:
|
||||
return;
|
||||
if (!me->IsWithinMeleeRange(me->getVictim()))
|
||||
{
|
||||
std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
if (Unit* target = Unit::GetUnit(*me, (*i)->getUnitGuid()))
|
||||
if (target->isAlive() && me->IsWithinMeleeRange(target))
|
||||
{
|
||||
@@ -201,7 +201,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_murmur()
|
||||
|
||||
@@ -46,9 +46,9 @@ EndScriptData */
|
||||
#define SOUND_AKAMA_LEAVE 11390
|
||||
|
||||
// Self explanatory
|
||||
const char* SAY_KILL1 = "Who shall be next to taste my blades?!";
|
||||
char const* SAY_KILL1 = "Who shall be next to taste my blades?!";
|
||||
#define SOUND_KILL1 11473
|
||||
const char* SAY_KILL2 = "This is too easy!";
|
||||
char const* SAY_KILL2 = "This is too easy!";
|
||||
#define SOUND_KILL2 11472
|
||||
|
||||
// I think I'll fly now and let my subordinates take you on
|
||||
@@ -254,7 +254,6 @@ struct Yells
|
||||
};
|
||||
|
||||
static const Yells Conversation[22] =
|
||||
|
||||
{
|
||||
{11463, "Akama... your duplicity is hardly surprising. I should have slaughtered you and your malformed brethren long ago.", ILLIDAN_STORMRAGE, 8000, 0, true},
|
||||
{0, "", ILLIDAN_STORMRAGE, 5000, 396, true},
|
||||
@@ -464,7 +463,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
/************************************** Illidan's AI* **************************************/
|
||||
@@ -614,7 +612,8 @@ public:
|
||||
|
||||
void DeleteFromThreatList(uint64 TargetGUID)
|
||||
{
|
||||
for (std::list<HostileReference*>::const_iterator itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr)
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->getUnitGuid() == TargetGUID)
|
||||
{
|
||||
@@ -1151,7 +1150,6 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
/********************************** End of Illidan AI* *****************************************/
|
||||
@@ -1378,7 +1376,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class npc_akama_illidan : public CreatureScript
|
||||
@@ -1491,9 +1488,9 @@ public:
|
||||
|
||||
void KillAllElites()
|
||||
{
|
||||
std::list<HostileReference*>& threatList = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const &threatList = me->getThreatManager().getThreatList();
|
||||
std::vector<Unit*> eliteList;
|
||||
for (std::list<HostileReference*>::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (unit && unit->GetEntry() == ILLIDARI_ELITE)
|
||||
@@ -1649,7 +1646,8 @@ public:
|
||||
|
||||
void HandleChannelSequence()
|
||||
{
|
||||
Unit* Channel = NULL, *Spirit[2] = { NULL, NULL };
|
||||
Unit* Channel = NULL;
|
||||
Unit* Spirit[2] = { NULL, NULL };
|
||||
if (ChannelCount <= 5)
|
||||
{
|
||||
Channel = Unit::GetUnit(*me, ChannelGUID);
|
||||
@@ -1840,7 +1838,6 @@ public:
|
||||
{
|
||||
return new npc_akama_illidanAI(creature);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
void boss_illidan_stormrage::boss_illidan_stormrageAI::Reset()
|
||||
@@ -2000,7 +1997,6 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::HandleTalkSequence()
|
||||
Akama->SetPosition(x, y, z, 0.0f);
|
||||
Akama->MonsterMoveWithSpeed(x, y, z, 0); // Illidan must not die until Akama arrives.
|
||||
Akama->GetMotionMaster()->MoveChase(me);
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2194,7 +2190,6 @@ public:
|
||||
me->SetDisplayId(21431);// appear when hit by Illidan's glaive
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class mob_parasitic_shadowfiend : public CreatureScript
|
||||
|
||||
@@ -128,7 +128,6 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/);
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_reliquary_of_souls : public CreatureScript
|
||||
@@ -233,9 +232,8 @@ public:
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
std::list<HostileReference*>& m_threatlist = target->getThreatManager().getThreatList();
|
||||
std::list<HostileReference*>::const_iterator itr = m_threatlist.begin();
|
||||
for (; itr != m_threatlist.end(); ++itr)
|
||||
ThreatContainer::StorageType threatlist = target->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (unit)
|
||||
@@ -376,7 +374,6 @@ public:
|
||||
} else Timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void npc_enslaved_soul::npc_enslaved_soulAI::JustDied(Unit* /*killer*/)
|
||||
@@ -453,12 +450,12 @@ public:
|
||||
|
||||
void CastFixate()
|
||||
{
|
||||
std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
|
||||
if (m_threatlist.empty())
|
||||
ThreatContainer::StorageType const &threatlist = me->getThreatManager().getThreatList();
|
||||
if (threatlist.empty())
|
||||
return; // No point continuing if empty threatlist.
|
||||
std::list<Unit*> targets;
|
||||
std::list<HostileReference*>::const_iterator itr = m_threatlist.begin();
|
||||
for (; itr != m_threatlist.end(); ++itr)
|
||||
ThreatContainer::StorageType::const_iterator itr = threatlist.begin();
|
||||
for (; itr != threatlist.end(); ++itr)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (unit && unit->isAlive() && (unit->GetTypeId() == TYPEID_PLAYER)) // Only alive players
|
||||
@@ -511,7 +508,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_essence_of_desire : public CreatureScript
|
||||
@@ -615,7 +611,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_essence_of_anger : public CreatureScript
|
||||
@@ -716,7 +711,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_reliquary_of_souls()
|
||||
|
||||
@@ -78,7 +78,6 @@ public:
|
||||
me->CastSpell(me, SPELL_MOLTEN_FLAME, true);
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_supremus : public CreatureScript
|
||||
@@ -183,9 +182,9 @@ public:
|
||||
uint32 health = 0;
|
||||
Unit* target = NULL;
|
||||
|
||||
std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
|
||||
std::list<HostileReference*>::const_iterator i = m_threatlist.begin();
|
||||
for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i)
|
||||
ThreatContainer::StorageType const &threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator i = threatlist.begin();
|
||||
for (i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
|
||||
if (unit && me->IsWithinMeleeRange(unit))
|
||||
@@ -258,7 +257,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class npc_volcano : public CreatureScript
|
||||
@@ -303,9 +301,7 @@ public:
|
||||
}
|
||||
else wait -= diff;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_supremus()
|
||||
|
||||
@@ -169,12 +169,12 @@ public:
|
||||
|
||||
void CheckPlayers()
|
||||
{
|
||||
std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
|
||||
if (m_threatlist.empty())
|
||||
ThreatContainer::StorageType const &threatlist = me->getThreatManager().getThreatList();
|
||||
if (threatlist.empty())
|
||||
return; // No threat list. Don't continue.
|
||||
std::list<HostileReference*>::const_iterator itr = m_threatlist.begin();
|
||||
ThreatContainer::StorageType::const_iterator itr = threatlist.begin();
|
||||
std::list<Unit*> targets;
|
||||
for (; itr != m_threatlist.end(); ++itr)
|
||||
for (; itr != threatlist.end(); ++itr)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (unit && unit->isAlive())
|
||||
@@ -207,7 +207,6 @@ public:
|
||||
} else CheckTeronTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class boss_teron_gorefiend : public CreatureScript
|
||||
@@ -317,20 +316,20 @@ public:
|
||||
return coord;
|
||||
}
|
||||
|
||||
void SetThreatList(Creature* Blossom)
|
||||
void SetThreatList(Creature* blossom)
|
||||
{
|
||||
if (!Blossom)
|
||||
if (!blossom)
|
||||
return;
|
||||
|
||||
std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
|
||||
std::list<HostileReference*>::const_iterator i = m_threatlist.begin();
|
||||
for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
|
||||
ThreatContainer::StorageType const &threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator i = threatlist.begin();
|
||||
for (i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
|
||||
if (unit && unit->isAlive())
|
||||
{
|
||||
float threat = DoGetThreat(unit);
|
||||
Blossom->AddThreat(unit, threat);
|
||||
blossom->AddThreat(unit, threat);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -344,26 +343,26 @@ public:
|
||||
/** WHAT IS FULLY NECESSARY FOR GOREFIEND TO BE 100% COMPLETE *****/
|
||||
/************************************************************************/
|
||||
|
||||
Unit* Ghost = NULL;
|
||||
Unit* ghost = NULL;
|
||||
if (GhostGUID)
|
||||
Ghost = Unit::GetUnit(*me, GhostGUID);
|
||||
if (Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH))
|
||||
ghost = Unit::GetUnit(*me, GhostGUID);
|
||||
if (ghost && ghost->isAlive() && ghost->HasAura(SPELL_SHADOW_OF_DEATH))
|
||||
{
|
||||
/*float x, y, z;
|
||||
Ghost->GetPosition(x, y, z);
|
||||
ghost->GetPosition(x, y, z);
|
||||
Creature* control = me->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000);
|
||||
if (control)
|
||||
{
|
||||
CAST_PLR(Ghost)->Possess(control);
|
||||
Ghost->DealDamage(Ghost, Ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL,
|
||||
CAST_PLR(ghost)->Possess(control);
|
||||
ghost->DealDamage(ghost, ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL,
|
||||
false);
|
||||
}*/
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
Creature* Construct = NULL;
|
||||
float X = CalculateRandomLocation(Ghost->GetPositionX(), 10);
|
||||
float Y = CalculateRandomLocation(Ghost->GetPositionY(), 10);
|
||||
Construct = me->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, Y, Ghost->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
|
||||
float X = CalculateRandomLocation(ghost->GetPositionX(), 10);
|
||||
float Y = CalculateRandomLocation(ghost->GetPositionY(), 10);
|
||||
Construct = me->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, Y, ghost->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
|
||||
if (Construct)
|
||||
{
|
||||
Construct->CastSpell(Construct, SPELL_PASSIVE_SHADOWFORM, true);
|
||||
@@ -511,7 +510,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_teron_gorefiend()
|
||||
|
||||
+2
-6
@@ -171,7 +171,6 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
//Original Leotheras the Blind AI
|
||||
@@ -263,7 +262,6 @@ public:
|
||||
Creature* binder = me->SummonCreature(MOB_SPELLBINDER, nx, ny, z, o, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
if (binder)
|
||||
SpellBinderGUID[i] = binder->GetGUID();
|
||||
|
||||
}
|
||||
}
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
@@ -525,9 +523,9 @@ public:
|
||||
//Summon Inner Demon
|
||||
if (InnerDemons_Timer <= diff)
|
||||
{
|
||||
std::list<HostileReference*>& ThreatList = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const & ThreatList = me->getThreatManager().getThreatList();
|
||||
std::vector<Unit*> TargetList;
|
||||
for (std::list<HostileReference*>::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr)
|
||||
for (ThreatContainer::StorageType::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr)
|
||||
{
|
||||
Unit* tempTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != me->getVictim()->GetGUID() && TargetList.size()<5)
|
||||
@@ -602,7 +600,6 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
//Leotheras the Blind Demon Form AI
|
||||
@@ -812,7 +809,6 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) {}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_leotheras_the_blind()
|
||||
|
||||
@@ -176,7 +176,7 @@ struct advisorbase_ai : public ScriptedAI
|
||||
|
||||
//reset encounter
|
||||
if (instance && (instance->GetData(DATA_KAELTHASEVENT) == 1 || instance->GetData(DATA_KAELTHASEVENT) == 3))
|
||||
if (Creature* Kaelthas = Unit::GetCreature((*me), instance->GetData64(DATA_KAELTHAS)))
|
||||
if (Creature* Kaelthas = Unit::GetCreature(*me, instance->GetData64(DATA_KAELTHAS)))
|
||||
Kaelthas->AI()->EnterEvadeMode();
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ class boss_kaelthas : public CreatureScript
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ADVISORS; ++i)
|
||||
{
|
||||
if (Creature* creature = Unit::GetCreature((*me), m_auiAdvisorGuid[i]))
|
||||
if (Creature* creature = Unit::GetCreature(*me, m_auiAdvisorGuid[i]))
|
||||
{
|
||||
creature->Respawn();
|
||||
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
@@ -379,7 +379,6 @@ class boss_kaelthas : public CreatureScript
|
||||
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
AttackStart(target);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -499,7 +498,7 @@ class boss_kaelthas : public CreatureScript
|
||||
case 1:
|
||||
if (Phase_Timer <= diff)
|
||||
{
|
||||
Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[0]));
|
||||
Advisor = (Unit::GetCreature(*me, m_auiAdvisorGuid[0]));
|
||||
|
||||
if (Advisor)
|
||||
{
|
||||
@@ -517,7 +516,7 @@ class boss_kaelthas : public CreatureScript
|
||||
|
||||
//Subphase 2 - Start
|
||||
case 2:
|
||||
Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[0]));
|
||||
Advisor = (Unit::GetCreature(*me, m_auiAdvisorGuid[0]));
|
||||
|
||||
if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD))
|
||||
{
|
||||
@@ -533,7 +532,7 @@ class boss_kaelthas : public CreatureScript
|
||||
case 3:
|
||||
if (Phase_Timer <= diff)
|
||||
{
|
||||
Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[1]));
|
||||
Advisor = (Unit::GetCreature(*me, m_auiAdvisorGuid[1]));
|
||||
|
||||
if (Advisor)
|
||||
{
|
||||
@@ -551,7 +550,7 @@ class boss_kaelthas : public CreatureScript
|
||||
|
||||
//Subphase 3 - Start
|
||||
case 4:
|
||||
Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[1]));
|
||||
Advisor = (Unit::GetCreature(*me, m_auiAdvisorGuid[1]));
|
||||
|
||||
if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD))
|
||||
{
|
||||
@@ -567,7 +566,7 @@ class boss_kaelthas : public CreatureScript
|
||||
case 5:
|
||||
if (Phase_Timer <= diff)
|
||||
{
|
||||
Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[2]));
|
||||
Advisor = (Unit::GetCreature(*me, m_auiAdvisorGuid[2]));
|
||||
|
||||
if (Advisor)
|
||||
{
|
||||
@@ -585,7 +584,7 @@ class boss_kaelthas : public CreatureScript
|
||||
|
||||
//Subphase 4 - Start
|
||||
case 6:
|
||||
Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[2]));
|
||||
Advisor = (Unit::GetCreature(*me, m_auiAdvisorGuid[2]));
|
||||
|
||||
if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD))
|
||||
{
|
||||
@@ -601,7 +600,7 @@ class boss_kaelthas : public CreatureScript
|
||||
case 7:
|
||||
if (Phase_Timer <= diff)
|
||||
{
|
||||
Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[3]));
|
||||
Advisor = (Unit::GetCreature(*me, m_auiAdvisorGuid[3]));
|
||||
|
||||
if (Advisor)
|
||||
{
|
||||
@@ -620,7 +619,7 @@ class boss_kaelthas : public CreatureScript
|
||||
|
||||
//End of phase 1
|
||||
case 8:
|
||||
Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[3]));
|
||||
Advisor = (Unit::GetCreature(*me, m_auiAdvisorGuid[3]));
|
||||
|
||||
if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD))
|
||||
{
|
||||
@@ -691,7 +690,7 @@ class boss_kaelthas : public CreatureScript
|
||||
Creature* Advisor;
|
||||
for (uint8 i = 0; i < MAX_ADVISORS; ++i)
|
||||
{
|
||||
Advisor = Unit::GetCreature((*me), m_auiAdvisorGuid[i]);
|
||||
Advisor = Unit::GetCreature(*me, m_auiAdvisorGuid[i]);
|
||||
|
||||
if (!Advisor)
|
||||
sLog->outError(LOG_FILTER_TSCR, "SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i);
|
||||
@@ -787,7 +786,7 @@ class boss_kaelthas : public CreatureScript
|
||||
if (me->getThreatManager().getThreatList().size() >= 2)
|
||||
for (uint32 i = 0; i < 3; ++i)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "SD2: Kael'Thas mind control not supported.");
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "Kael'Thas mind control not supported.");
|
||||
//DoCast(unit, SPELL_MIND_CONTROL);
|
||||
}
|
||||
|
||||
@@ -879,11 +878,12 @@ class boss_kaelthas : public CreatureScript
|
||||
//Phase 5
|
||||
if (Phase == 6)
|
||||
{
|
||||
|
||||
//GravityLapse_Timer
|
||||
if (GravityLapse_Timer <= diff)
|
||||
{
|
||||
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType::const_iterator i = threatlist.begin();
|
||||
|
||||
switch (GravityLapse_Phase)
|
||||
{
|
||||
case 0:
|
||||
@@ -894,7 +894,7 @@ class boss_kaelthas : public CreatureScript
|
||||
me->MonsterMoveWithSpeed(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0);
|
||||
|
||||
// 1) Kael'thas will portal the whole raid right into his body
|
||||
for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
|
||||
for (i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
|
||||
if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
|
||||
@@ -915,7 +915,7 @@ class boss_kaelthas : public CreatureScript
|
||||
DoScriptText(RAND(SAY_GRAVITYLAPSE1, SAY_GRAVITYLAPSE2), me);
|
||||
|
||||
// 2) At that point he will put a Gravity Lapse debuff on everyone
|
||||
for (i = me->getThreatManager().getThreatList().begin(); i != me->getThreatManager().getThreatList().end(); ++i)
|
||||
for (i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
if (Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()))
|
||||
{
|
||||
@@ -948,7 +948,7 @@ class boss_kaelthas : public CreatureScript
|
||||
|
||||
case 3:
|
||||
//Remove flight
|
||||
for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
|
||||
for (i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
if (Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()))
|
||||
{
|
||||
@@ -1287,8 +1287,8 @@ class boss_grand_astromancer_capernian : public CreatureScript
|
||||
{
|
||||
bool InMeleeRange = false;
|
||||
Unit* target = NULL;
|
||||
std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator i = m_threatlist.begin(); i!= m_threatlist.end(); ++i)
|
||||
ThreatContainer::StorageType const &threatlist = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator i = threatlist.begin(); i!= threatlist.end(); ++i)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid());
|
||||
//if in melee range
|
||||
|
||||
Reference in new issue
Block a user