mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Core/Threat: My dictionary informs me that "fixtate" is not, in fact, a word. Corrected to "fixate".
fd33b1c follow-up
This commit is contained in:
@@ -451,33 +451,33 @@ void ThreatManager::ClearAllThreat()
|
|||||||
while (!_myThreatListEntries.empty());
|
while (!_myThreatListEntries.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThreatManager::FixtateTarget(Unit* target)
|
void ThreatManager::FixateTarget(Unit* target)
|
||||||
{
|
{
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
auto it = _myThreatListEntries.find(target->GetGUID());
|
auto it = _myThreatListEntries.find(target->GetGUID());
|
||||||
if (it != _myThreatListEntries.end())
|
if (it != _myThreatListEntries.end())
|
||||||
{
|
{
|
||||||
_fixtateRef = it->second;
|
_fixateRef = it->second;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_fixtateRef = nullptr;
|
_fixateRef = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Unit* ThreatManager::GetFixtateTarget() const
|
Unit* ThreatManager::GetFixateTarget() const
|
||||||
{
|
{
|
||||||
if (_fixtateRef)
|
if (_fixateRef)
|
||||||
return _fixtateRef->GetVictim();
|
return _fixateRef->GetVictim();
|
||||||
else
|
else
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreatReference const* ThreatManager::ReselectVictim()
|
ThreatReference const* ThreatManager::ReselectVictim()
|
||||||
{
|
{
|
||||||
// fixtated target is always preferred
|
// fixated target is always preferred
|
||||||
if (_fixtateRef && _fixtateRef->IsAvailable())
|
if (_fixateRef && _fixateRef->IsAvailable())
|
||||||
return _fixtateRef;
|
return _fixateRef;
|
||||||
|
|
||||||
ThreatReference const* oldVictimRef = _currentVictimRef;
|
ThreatReference const* oldVictimRef = _currentVictimRef;
|
||||||
if (oldVictimRef && oldVictimRef->IsOffline())
|
if (oldVictimRef && oldVictimRef->IsOffline())
|
||||||
@@ -725,8 +725,8 @@ void ThreatManager::PurgeThreatListRef(ObjectGuid const& guid, bool sendRemove)
|
|||||||
|
|
||||||
if (_currentVictimRef == ref)
|
if (_currentVictimRef == ref)
|
||||||
_currentVictimRef = nullptr;
|
_currentVictimRef = nullptr;
|
||||||
if (_fixtateRef == ref)
|
if (_fixateRef == ref)
|
||||||
_fixtateRef = nullptr;
|
_fixateRef = nullptr;
|
||||||
|
|
||||||
_sortedThreatList.erase(ref->_handle);
|
_sortedThreatList.erase(ref->_handle);
|
||||||
if (sendRemove && ref->IsAvailable())
|
if (sendRemove && ref->IsAvailable())
|
||||||
|
|||||||
@@ -160,11 +160,11 @@ class TC_GAME_API ThreatManager
|
|||||||
// Removes all targets from the threat list (will cause evade in UpdateVictim if called)
|
// Removes all targets from the threat list (will cause evade in UpdateVictim if called)
|
||||||
void ClearAllThreat();
|
void ClearAllThreat();
|
||||||
|
|
||||||
// Fixtate on the passed target; this target will always be selected until the fixtate is cleared
|
// Fixate on the passed target; this target will always be selected until the fixate is cleared
|
||||||
// (if the target is not in the threat list, does nothing)
|
// (if the target is not in the threat list, does nothing)
|
||||||
void FixtateTarget(Unit* target);
|
void FixateTarget(Unit* target);
|
||||||
void ClearFixtate() { FixtateTarget(nullptr); }
|
void ClearFixate() { FixateTarget(nullptr); }
|
||||||
Unit* GetFixtateTarget() const;
|
Unit* GetFixateTarget() const;
|
||||||
|
|
||||||
// sends SMSG_THREAT_UPDATE to all nearby clients (used by client to forward threat list info to addons)
|
// sends SMSG_THREAT_UPDATE to all nearby clients (used by client to forward threat list info to addons)
|
||||||
void SendThreatListToClients() const;
|
void SendThreatListToClients() const;
|
||||||
@@ -210,7 +210,7 @@ class TC_GAME_API ThreatManager
|
|||||||
std::unordered_map<ObjectGuid, ThreatReference*> _myThreatListEntries;
|
std::unordered_map<ObjectGuid, ThreatReference*> _myThreatListEntries;
|
||||||
ThreatReference const* _currentVictimRef;
|
ThreatReference const* _currentVictimRef;
|
||||||
ThreatReference const* ReselectVictim();
|
ThreatReference const* ReselectVictim();
|
||||||
ThreatReference const* _fixtateRef;
|
ThreatReference const* _fixateRef;
|
||||||
|
|
||||||
///== OTHERS' THREAT LISTS ==
|
///== OTHERS' THREAT LISTS ==
|
||||||
void PutThreatenedByMeRef(ObjectGuid const& guid, ThreatReference* ref);
|
void PutThreatenedByMeRef(ObjectGuid const& guid, ThreatReference* ref);
|
||||||
|
|||||||
@@ -885,7 +885,7 @@ public:
|
|||||||
handler->PSendSysMessage("%s (GUID %u, SpawnID %u) is not engaged, but still has a threat list? Well, here it is:", target->GetName().c_str(), target->GetGUID().GetCounter(), target->GetTypeId() == TYPEID_UNIT ? target->ToCreature()->GetSpawnId() : 0);
|
handler->PSendSysMessage("%s (GUID %u, SpawnID %u) is not engaged, but still has a threat list? Well, here it is:", target->GetName().c_str(), target->GetGUID().GetCounter(), target->GetTypeId() == TYPEID_UNIT ? target->ToCreature()->GetSpawnId() : 0);
|
||||||
|
|
||||||
count = 0;
|
count = 0;
|
||||||
Unit* fixtateVictim = mgr.GetFixtateTarget();
|
Unit* fixateVictim = mgr.GetFixateTarget();
|
||||||
for (ThreatReference const* ref : mgr.GetSortedThreatList())
|
for (ThreatReference const* ref : mgr.GetSortedThreatList())
|
||||||
{
|
{
|
||||||
Unit* unit = ref->GetVictim();
|
Unit* unit = ref->GetVictim();
|
||||||
@@ -902,8 +902,8 @@ public:
|
|||||||
onlineStr = "";
|
onlineStr = "";
|
||||||
}
|
}
|
||||||
char const* tauntStr;
|
char const* tauntStr;
|
||||||
if (unit == fixtateVictim)
|
if (unit == fixateVictim)
|
||||||
tauntStr = " [FIXTATE]";
|
tauntStr = " [FIXATE]";
|
||||||
else
|
else
|
||||||
switch (ref->GetTauntState())
|
switch (ref->GetTauntState())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ enum Spells
|
|||||||
// Anub'ar Skirmisher
|
// Anub'ar Skirmisher
|
||||||
SPELL_CHARGE = 52538,
|
SPELL_CHARGE = 52538,
|
||||||
SPELL_BACKSTAB = 52540,
|
SPELL_BACKSTAB = 52540,
|
||||||
SPELL_FIXTATE_TRIGGER = 52536,
|
SPELL_FIXATE_TRIGGER = 52536,
|
||||||
SPELL_FIXTATE_TRIGGERED = 52537,
|
SPELL_FIXATE_TRIGGERED = 52537,
|
||||||
|
|
||||||
// Anub'ar Shadowcaster
|
// Anub'ar Shadowcaster
|
||||||
SPELL_SHADOW_BOLT = 52534,
|
SPELL_SHADOW_BOLT = 52534,
|
||||||
@@ -755,7 +755,7 @@ class npc_anub_ar_skirmisher : public CreatureScript
|
|||||||
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
|
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
|
||||||
{
|
{
|
||||||
if (spell->Id == SPELL_CHARGE && target)
|
if (spell->Id == SPELL_CHARGE && target)
|
||||||
DoCast(target, SPELL_FIXTATE_TRIGGER);
|
DoCast(target, SPELL_FIXATE_TRIGGER);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -961,35 +961,35 @@ class spell_gatewatcher_subboss_trigger : public SpellScriptLoader
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class spell_anub_ar_skirmisher_fixtate : public SpellScriptLoader
|
class spell_anub_ar_skirmisher_fixate : public SpellScriptLoader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
spell_anub_ar_skirmisher_fixtate() : SpellScriptLoader("spell_anub_ar_skirmisher_fixtate") { }
|
spell_anub_ar_skirmisher_fixate() : SpellScriptLoader("spell_anub_ar_skirmisher_fixate") { }
|
||||||
|
|
||||||
class spell_anub_ar_skirmisher_fixtate_SpellScript : public SpellScript
|
class spell_anub_ar_skirmisher_fixate_SpellScript : public SpellScript
|
||||||
{
|
{
|
||||||
PrepareSpellScript(spell_anub_ar_skirmisher_fixtate_SpellScript);
|
PrepareSpellScript(spell_anub_ar_skirmisher_fixate_SpellScript);
|
||||||
|
|
||||||
bool Validate(SpellInfo const* /*spell*/) override
|
bool Validate(SpellInfo const* /*spell*/) override
|
||||||
{
|
{
|
||||||
return ValidateSpellInfo({ SPELL_FIXTATE_TRIGGERED });
|
return ValidateSpellInfo({ SPELL_FIXATE_TRIGGERED });
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||||
{
|
{
|
||||||
if (Unit* target = GetHitUnit())
|
if (Unit* target = GetHitUnit())
|
||||||
target->CastSpell(GetCaster(), SPELL_FIXTATE_TRIGGERED, true);
|
target->CastSpell(GetCaster(), SPELL_FIXATE_TRIGGERED, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
{
|
{
|
||||||
OnEffectHitTarget += SpellEffectFn(spell_anub_ar_skirmisher_fixtate_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
OnEffectHitTarget += SpellEffectFn(spell_anub_ar_skirmisher_fixate_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
SpellScript* GetSpellScript() const override
|
SpellScript* GetSpellScript() const override
|
||||||
{
|
{
|
||||||
return new spell_anub_ar_skirmisher_fixtate_SpellScript();
|
return new spell_anub_ar_skirmisher_fixate_SpellScript();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1071,7 +1071,7 @@ void AddSC_boss_krik_thir()
|
|||||||
new npc_gatewatcher_web_wrap();
|
new npc_gatewatcher_web_wrap();
|
||||||
|
|
||||||
new spell_gatewatcher_subboss_trigger();
|
new spell_gatewatcher_subboss_trigger();
|
||||||
new spell_anub_ar_skirmisher_fixtate();
|
new spell_anub_ar_skirmisher_fixate();
|
||||||
new spell_gatewatcher_web_wrap();
|
new spell_gatewatcher_web_wrap();
|
||||||
|
|
||||||
new achievement_watch_him_die();
|
new achievement_watch_him_die();
|
||||||
|
|||||||
Reference in New Issue
Block a user