mirror of
https://github.com/mangosfour/server.git
synced 2025-12-21 01:37:05 +00:00
[10762] Implement SPELL_AURA_IGNORE_UNIT_STATE (252).
Original patch provided by Wojta
Note: From patch excluded talent 44543 and ranks stacking code.
It look like need another implemention different from suggested,
or at least more research.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
In patch added enum IgnoreUnitState and related checks now more cheating protected.
This commit is contained in:
parent
16cd545df8
commit
f7b4b88e02
11 changed files with 70 additions and 20 deletions
|
|
@ -4236,7 +4236,8 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
if(bg->GetStatus() == STATUS_WAIT_LEAVE)
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
|
||||
if (m_caster->isInCombat() && IsNonCombatSpell(m_spellInfo) && !m_IsTriggeredSpell)
|
||||
if (!m_IsTriggeredSpell && IsNonCombatSpell(m_spellInfo) &&
|
||||
m_caster->isInCombat() && !m_caster->IsIgnoreUnitState(m_spellInfo, IGNORE_UNIT_COMBAT_STATE))
|
||||
return SPELL_FAILED_AFFECTING_COMBAT;
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && !((Player*)m_caster)->isGameMaster() &&
|
||||
|
|
@ -4310,7 +4311,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
return SPELL_FAILED_MOVING;
|
||||
}
|
||||
|
||||
if (!m_IsTriggeredSpell && NeedsComboPoints(m_spellInfo) &&
|
||||
if (!m_IsTriggeredSpell && NeedsComboPoints(m_spellInfo) && !m_caster->IsIgnoreUnitState(m_spellInfo, IGNORE_UNIT_TARGET_STATE) &&
|
||||
(!m_targets.getUnitTarget() || m_targets.getUnitTarget()->GetObjectGuid() != ((Player*)m_caster)->GetComboTargetGuid()))
|
||||
// warrior not have real combo-points at client side but use this way for mark allow Overpower use
|
||||
return m_caster->getClass() == CLASS_WARRIOR ? SPELL_FAILED_CASTER_AURASTATE : SPELL_FAILED_NO_COMBO_POINTS;
|
||||
|
|
@ -4347,7 +4348,8 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
if(non_caster_target)
|
||||
{
|
||||
// target state requirements (apply to non-self only), to allow cast affects to self like Dirty Deeds
|
||||
if(m_spellInfo->TargetAuraState && !target->HasAuraStateForCaster(AuraState(m_spellInfo->TargetAuraState),m_caster->GetGUID()))
|
||||
if (m_spellInfo->TargetAuraState && !target->HasAuraStateForCaster(AuraState(m_spellInfo->TargetAuraState), m_caster->GetGUID()) &&
|
||||
!m_caster->IsIgnoreUnitState(m_spellInfo, IGNORE_UNIT_TARGET_STATE))
|
||||
return SPELL_FAILED_TARGET_AURASTATE;
|
||||
|
||||
// Not allow casting on flying player
|
||||
|
|
@ -4782,12 +4784,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
break;
|
||||
case SPELL_EFFECT_DUMMY:
|
||||
{
|
||||
if(m_spellInfo->SpellIconID == 1648) // Execute
|
||||
{
|
||||
if(!m_targets.getUnitTarget() || m_targets.getUnitTarget()->GetHealth() > m_targets.getUnitTarget()->GetMaxHealth()*0.2)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
else if (m_spellInfo->Id == 51582) // Rocket Boots Engaged
|
||||
if (m_spellInfo->Id == 51582) // Rocket Boots Engaged
|
||||
{
|
||||
if(m_caster->IsInWater())
|
||||
return SPELL_FAILED_ONLY_ABOVEWATER;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue