*Implement attribute flag SPELL_ATTR_EX3_DISABLE_PROC - this fixes double proc of seal auras

*Add Judgement Anti-Parry/Dodge Passive spell for paladins.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-07-08 13:00:08 +02:00
parent f28810576d
commit 68b58c1433
4 changed files with 76 additions and 60 deletions
@@ -0,0 +1,6 @@
DELETE FROM `playercreateinfo_spell` WHERE `spell` = 60091;
INSERT INTO `playercreateinfo_spell` (`race`, `class`, `Spell`, `Note`) VALUES
(1, 2, 60091, 'Judgement Anti-Parry/Dodge Passive'),
(3, 2, 60091, 'Judgement Anti-Parry/Dodge Passive'),
(10, 2, 60091, 'Judgement Anti-Parry/Dodge Passive'),
(11, 2, 60091, 'Judgement Anti-Parry/Dodge Passive');
+1 -1
View File
@@ -337,7 +337,7 @@ enum SpellCategory
#define SPELL_ATTR_EX3_UNK16 0x00010000 // 16 no triggers effects that trigger on casting a spell??
#define SPELL_ATTR_EX3_NO_INITIAL_AGGRO 0x00020000 // 17 Soothe Animal, 39758, Mind Soothe
#define SPELL_ATTR_EX3_UNK18 0x00040000 // 18
#define SPELL_ATTR_EX3_UNK19 0x00080000 // 19 spells triggered by spell with this flag can't proc caster auras and can proc from triggered (swings too - 20178)
#define SPELL_ATTR_EX3_DISABLE_PROC 0x00080000 // 19 during aura proc no spells can trigger (20178, 20375)
#define SPELL_ATTR_EX3_DEATH_PERSISTENT 0x00100000 // 20 Death persistent spells
#define SPELL_ATTR_EX3_UNK21 0x00200000 // 21
#define SPELL_ATTR_EX3_REQ_WAND 0x00400000 // 22 Req wand
-9
View File
@@ -824,15 +824,6 @@ void Spell::prepareDataForTriggerSystem(AuraEffect * triggeredByAura)
{
m_procEx |= PROC_EX_INTERNAL_REQ_FAMILY;
}
// Check done for judgements to make them not trigger seal effects
else if (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_UNK1)
{
// Rogue poisons
if (m_spellInfo->SpellFamilyName && m_spellInfo->SpellFamilyFlags)
m_procEx |= PROC_EX_INTERNAL_REQ_FAMILY;
else
m_canTrigger=false;
}
}
}
+68 -49
View File
@@ -211,6 +211,10 @@ void Unit::Update( uint32 p_time )
m_Events.Update( p_time );
_UpdateSpells( p_time );
// If this is set during update SetCantProc(false) call is missing somewhere in the code
// Having this would prevent spells from being proced, so let's crash
assert(!m_procDeep)
if (CanHaveThreatList() && getThreatManager().isNeedUpdateToClient(p_time))
SendThreatListUpdate();
@@ -2786,10 +2790,8 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
if (roll < tmp)
return SPELL_MISS_RESIST;
// Ranged attack cannot be parry/dodge only deflect
// Check damage class instead of attack type to correctly handle judgements
// - they are meele, but can't be dodged/parried/deflected because of ranged dmg class
if (spell->DmgClass == SPELL_DAMAGE_CLASS_RANGED)
// Ranged attacks can only miss, resist and deflect
if (attType == RANGED_ATTACK)
{
// only if in front
if (pVictim->HasInArc(M_PI,this))
@@ -12641,6 +12643,9 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
if (GetTypeId() == TYPEID_PLAYER && i->spellProcEvent && i->spellProcEvent->cooldown)
cooldown = i->spellProcEvent->cooldown;
if (spellInfo->AttributesEx3 & SPELL_ATTR_EX3_DISABLE_PROC)
SetCantProc(true);
// This bool is needed till separate aura effect procs are still here
bool handled = false;
if (HandleAuraProc(pTarget, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled))
@@ -12665,8 +12670,8 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
{
sLog.outDebug("ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
// Don`t drop charge or add cooldown for not started trigger
if (!HandleProcTriggerSpell(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
continue;
if (HandleProcTriggerSpell(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
takeCharges=true;
break;
}
case SPELL_AURA_PROC_TRIGGER_DAMAGE:
@@ -12684,47 +12689,57 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
case SPELL_AURA_DUMMY:
{
sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
if (!HandleDummyAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
continue;
if (procDebug & 1)
sLog.outError("Dummy aura of spell %d procs twice from one effect!",spellInfo->Id);
procDebug |= 1;
if (HandleDummyAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
{
takeCharges=true;
if (procDebug & 1)
sLog.outError("Dummy aura of spell %d procs twice from one effect!",spellInfo->Id);
procDebug |= 1;
}
break;
}
case SPELL_AURA_OBS_MOD_ENERGY:
sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
if (!HandleObsModEnergyAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
continue;
if (procDebug & 2)
sLog.outError("ObsModEnergy aura of spell %d procs twice from one effect!",spellInfo->Id);
procDebug |= 2;
if (HandleObsModEnergyAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
{
takeCharges=true;
if (procDebug & 2)
sLog.outError("ObsModEnergy aura of spell %d procs twice from one effect!",spellInfo->Id);
procDebug |= 2;
}
break;
case SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN:
sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
if (!HandleModDamagePctTakenAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
continue;
if (procDebug & 16)
sLog.outError("ModDamagePctTaken aura of spell %d procs twice from one effect!",spellInfo->Id);
procDebug |= 16;
if (HandleModDamagePctTakenAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
{
takeCharges=true;
if (procDebug & 16)
sLog.outError("ModDamagePctTaken aura of spell %d procs twice from one effect!",spellInfo->Id);
procDebug |= 16;
}
break;
case SPELL_AURA_MOD_HASTE:
{
sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s haste aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
if (!HandleHasteAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
continue;
if (procDebug & 4)
sLog.outError("Haste aura of spell %d procs twice from one effect!",spellInfo->Id);
procDebug |= 4;
if (HandleHasteAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
{
takeCharges=true;
if (procDebug & 4)
sLog.outError("Haste aura of spell %d procs twice from one effect!",spellInfo->Id);
procDebug |= 4;
}
break;
}
case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS:
{
sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
if (!HandleOverrideClassScriptAuraProc(pTarget, damage, triggeredByAura, procSpell, cooldown))
continue;
if (procDebug & 8)
sLog.outError("OverrideClassScripts aura of spell %d procs twice from one effect!",spellInfo->Id);
procDebug |= 8;
if (HandleOverrideClassScriptAuraProc(pTarget, damage, triggeredByAura, procSpell, cooldown))
{
takeCharges=true;
if (procDebug & 8)
sLog.outError("OverrideClassScripts aura of spell %d procs twice from one effect!",spellInfo->Id);
procDebug |= 8;
}
break;
}
case SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE:
@@ -12747,46 +12762,46 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
{
sLog.outDebug("ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
if (!HandleProcTriggerSpell(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
continue;
if (HandleProcTriggerSpell(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
takeCharges=true;
break;
}
case SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK:
// Skip melee hits or instant cast spells
if (procSpell == NULL || GetSpellCastTime(procSpell) == 0)
continue;
if (procSpell && GetSpellCastTime(procSpell) != 0)
takeCharges=true;
break;
case SPELL_AURA_REFLECT_SPELLS_SCHOOL:
// Skip Melee hits and spells ws wrong school
if (procSpell == NULL || (triggeredByAura->GetMiscValue() & procSpell->SchoolMask) == 0)
continue;
if (procSpell && (triggeredByAura->GetMiscValue() & procSpell->SchoolMask)) // School check
takeCharges=true;
break;
case SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT:
case SPELL_AURA_MOD_POWER_COST_SCHOOL:
// Skip melee hits and spells ws wrong school or zero cost
if (procSpell == NULL ||
(procSpell->manaCost == 0 && procSpell->ManaCostPercentage == 0) || // Cost check
if (procSpell &&
(procSpell->manaCost != 0 || procSpell->ManaCostPercentage != 0) && // Cost check
(triggeredByAura->GetMiscValue() & procSpell->SchoolMask) == 0) // School check
continue;
takeCharges=true;
break;
case SPELL_AURA_MECHANIC_IMMUNITY:
// Compare mechanic
if (procSpell==NULL || procSpell->Mechanic != triggeredByAura->GetMiscValue())
continue;
if (procSpell && procSpell->Mechanic == triggeredByAura->GetMiscValue())
takeCharges=true;
break;
case SPELL_AURA_MOD_MECHANIC_RESISTANCE:
// Compare mechanic
if (procSpell==NULL || procSpell->Mechanic != triggeredByAura->GetMiscValue())
continue;
if (procSpell && procSpell->Mechanic == triggeredByAura->GetMiscValue())
takeCharges=true;
break;
case SPELL_AURA_MOD_DAMAGE_FROM_CASTER:
// Compare casters
if (triggeredByAura->GetCasterGUID() != pTarget->GetGUID())
continue;
if (triggeredByAura->GetCasterGUID() == pTarget->GetGUID())
takeCharges=true;
break;
case SPELL_AURA_MOD_SPELL_CRIT_CHANCE:
if (!procSpell)
continue;
if (procSpell)
takeCharges=true;
break;
// These auras may not have charges - that means they have chance to remove based on dmg
case SPELL_AURA_MOD_FEAR:
@@ -12800,6 +12815,8 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
if (roll_chance_f(chance))
RemoveAura(i->aura);
}
else
takeCharges=true;
break;
/*case SPELL_AURA_ADD_FLAT_MODIFIER:
case SPELL_AURA_ADD_PCT_MODIFIER:
@@ -12807,15 +12824,17 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
break;*/
default:
// nothing do, just charges counter
takeCharges=true;
break;
}
takeCharges=true;
}
// Remove charge (aura can be removed by triggers)
if(useCharges && takeCharges)
{
i->aura->DropAuraCharge();
}
if (spellInfo->AttributesEx3 & SPELL_ATTR_EX3_DISABLE_PROC)
SetCantProc(false);
}
// Cleanup proc requirements