Core/Scripts: Implemented 2 new target selectors, one specialized for spells, checking auras, range and attributes; and the other is a very simple non-tank selection what is sufficient for most cases
This commit is contained in:
@@ -5594,6 +5594,13 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
instance->DoCastSpellOnPlayers(65037); // Achievement criteria marker
|
||||
break;
|
||||
}
|
||||
// Dark Hunger (The Lich King encounter)
|
||||
case 69383:
|
||||
{
|
||||
basepoints0 = CalculatePctN(int32(damage), 50);
|
||||
triggered_spell_id = 69384;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -9240,7 +9247,7 @@ ReputationRank Unit::GetReactionTo(Unit const* target) const
|
||||
if (GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_FFA_PVP
|
||||
&& target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_FFA_PVP)
|
||||
return REP_HOSTILE;
|
||||
|
||||
|
||||
if (selfPlayerOwner)
|
||||
{
|
||||
if (FactionTemplateEntry const* targetFactionTemplateEntry = target->getFactionTemplateEntry())
|
||||
@@ -12416,7 +12423,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co
|
||||
&& target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_FFA_PVP)
|
||||
return true;
|
||||
|
||||
return (GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_UNK1)
|
||||
return (GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_UNK1)
|
||||
|| (target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_UNK1);
|
||||
}
|
||||
return true;
|
||||
@@ -13479,7 +13486,7 @@ void Unit::ApplyDiminishingAura(DiminishingGroup group, bool apply)
|
||||
}
|
||||
}
|
||||
|
||||
float Unit::GetSpellMaxRangeForTarget(Unit* target, SpellInfo const* spellInfo)
|
||||
float Unit::GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const
|
||||
{
|
||||
if (!spellInfo->RangeEntry)
|
||||
return 0;
|
||||
@@ -13488,7 +13495,7 @@ float Unit::GetSpellMaxRangeForTarget(Unit* target, SpellInfo const* spellInfo)
|
||||
return spellInfo->GetMaxRange(!IsHostileTo(target));
|
||||
}
|
||||
|
||||
float Unit::GetSpellMinRangeForTarget(Unit* target, SpellInfo const* spellInfo)
|
||||
float Unit::GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const
|
||||
{
|
||||
if (!spellInfo->RangeEntry)
|
||||
return 0;
|
||||
|
||||
@@ -1255,8 +1255,8 @@ class Unit : public WorldObject
|
||||
void ClearDiminishings() { m_Diminishing.clear(); }
|
||||
|
||||
// target dependent range checks
|
||||
float GetSpellMaxRangeForTarget(Unit* target, SpellInfo const* spellInfo);
|
||||
float GetSpellMinRangeForTarget(Unit* target, SpellInfo const* spellInfo);
|
||||
float GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const;
|
||||
float GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const;
|
||||
|
||||
virtual void Update(uint32 time);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user