mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 22:37:02 +00:00
[8394] Fixes for some non-self only positive spells.
* Propertly reject self targeting for pet spell 2947 and ranks, and spell 54646. * Some related fixes for pet spells with target mode TARGET_SINGLE_FRIEND_2 * Implement original caster bonus part of spell 54646.
This commit is contained in:
parent
f45253ac8b
commit
9eb5a3eea1
7 changed files with 110 additions and 13 deletions
|
|
@ -3859,19 +3859,34 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (m_caster->GetTypeId() == TYPEID_PLAYER) // Target - is player caster
|
||||
else if (m_caster == target)
|
||||
{
|
||||
// Additional check for some spells
|
||||
// If 0 spell effect empty - client not send target data (need use selection)
|
||||
// TODO: check it on next client version
|
||||
if (m_targets.m_targetMask == TARGET_FLAG_SELF &&
|
||||
m_spellInfo->EffectImplicitTargetA[1] == TARGET_CHAIN_DAMAGE)
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER) // Target - is player caster
|
||||
{
|
||||
if (target = m_caster->GetUnit(*m_caster, ((Player *)m_caster)->GetSelection()))
|
||||
m_targets.setUnitTarget(target);
|
||||
else
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
// Additional check for some spells
|
||||
// If 0 spell effect empty - client not send target data (need use selection)
|
||||
// TODO: check it on next client version
|
||||
if (m_targets.m_targetMask == TARGET_FLAG_SELF &&
|
||||
m_spellInfo->EffectImplicitTargetA[1] == TARGET_CHAIN_DAMAGE)
|
||||
{
|
||||
if (target = m_caster->GetUnit(*m_caster, ((Player *)m_caster)->GetSelection()))
|
||||
m_targets.setUnitTarget(target);
|
||||
else
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
}
|
||||
|
||||
// Some special spells with non-caster only mode
|
||||
|
||||
// Fire Shield
|
||||
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK &&
|
||||
m_spellInfo->SpellIconID == 16)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
// Focus Magic (main spell)
|
||||
if (m_spellInfo->Id == 54646)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
|
||||
// check pet presents
|
||||
|
|
@ -4679,7 +4694,12 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
|
|||
bool need = false;
|
||||
for(uint32 i = 0; i < 3; ++i)
|
||||
{
|
||||
if(m_spellInfo->EffectImplicitTargetA[i] == TARGET_CHAIN_DAMAGE || m_spellInfo->EffectImplicitTargetA[i] == TARGET_SINGLE_FRIEND || m_spellInfo->EffectImplicitTargetA[i] == TARGET_DUELVSPLAYER || m_spellInfo->EffectImplicitTargetA[i] == TARGET_SINGLE_PARTY || m_spellInfo->EffectImplicitTargetA[i] == TARGET_CURRENT_ENEMY_COORDINATES)
|
||||
if (m_spellInfo->EffectImplicitTargetA[i] == TARGET_CHAIN_DAMAGE ||
|
||||
m_spellInfo->EffectImplicitTargetA[i] == TARGET_SINGLE_FRIEND ||
|
||||
m_spellInfo->EffectImplicitTargetA[i] == TARGET_SINGLE_FRIEND_2 ||
|
||||
m_spellInfo->EffectImplicitTargetA[i] == TARGET_DUELVSPLAYER ||
|
||||
m_spellInfo->EffectImplicitTargetA[i] == TARGET_SINGLE_PARTY ||
|
||||
m_spellInfo->EffectImplicitTargetA[i] == TARGET_CURRENT_ENEMY_COORDINATES)
|
||||
{
|
||||
need = true;
|
||||
if(!target)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue