mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
Core/Spells: Ignore LoS when spells are cast/triggered by gameobjects
... and this is why you shouldn't use the so called hacks. You will just keep adding sh*t on top of more sh*t (like this). Currently, GO spell casts spawn an invisible WORLD_TRIGGER (npc 12999) inside of the gameobject (for certain forms of gameobjects) (and this is why the LoS check was failing). It shouldn't be like that. GOs should be able to cast the spells without having to spawn an auxiliary creature. Fixes "Eye of Acherus" and others
This commit is contained in:
@@ -1674,7 +1674,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId)
|
||||
else
|
||||
{
|
||||
trigger->setFaction(14);
|
||||
// Set owner guid for target if no owner avalible - needed by trigger auras
|
||||
// Set owner guid for target if no owner available - needed by trigger auras
|
||||
// - trigger gets despawned and there's no caster avalible (see AuraEffect::TriggerSpell())
|
||||
trigger->CastSpell(target ? target : trigger, spellInfo, true, 0, 0, target ? target->GetGUID() : 0);
|
||||
}
|
||||
|
||||
@@ -585,9 +585,7 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme
|
||||
CleanupEffectExecuteData();
|
||||
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
m_destTargets[i] = SpellDestination(*m_caster);
|
||||
}
|
||||
}
|
||||
|
||||
Spell::~Spell()
|
||||
@@ -4837,8 +4835,9 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if ((m_spellInfo->AttributesCu & SPELL_ATTR0_CU_REQ_TARGET_FACING_CASTER) && !target->HasInArc(static_cast<float>(M_PI), m_caster))
|
||||
return SPELL_FAILED_NOT_INFRONT;
|
||||
|
||||
if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target))
|
||||
return SPELL_FAILED_LINE_OF_SIGHT;
|
||||
if (m_caster->GetEntry() != WORLD_TRIGGER) // Ignore LOS for gameobjects casts (wrongly casted by a trigger)
|
||||
if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target))
|
||||
return SPELL_FAILED_LINE_OF_SIGHT;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -605,7 +605,7 @@ class SpellMgr
|
||||
|
||||
// Accessors (const or static functions)
|
||||
public:
|
||||
// Spell correctess for client using
|
||||
// Spell correctness for client using
|
||||
static bool IsSpellValid(SpellInfo const* spellInfo, Player* player = NULL, bool msg = true);
|
||||
|
||||
// Spell difficulty
|
||||
|
||||
Reference in New Issue
Block a user