diff options
| -rw-r--r-- | sql/updates/3451_world_spell_proc_event.sql | 11 | ||||
| -rw-r--r-- | sql/world_spell_full.sql | 7 | ||||
| -rw-r--r-- | src/game/Player.cpp | 8 | ||||
| -rw-r--r-- | src/game/Player.h | 1 | ||||
| -rw-r--r-- | src/game/Spell.cpp | 6 | ||||
| -rw-r--r-- | src/game/SpellEffects.cpp | 17 | ||||
| -rw-r--r-- | src/game/Unit.cpp | 16 | ||||
| -rw-r--r-- | src/game/Unit.h | 4 |
8 files changed, 57 insertions, 13 deletions
diff --git a/sql/updates/3451_world_spell_proc_event.sql b/sql/updates/3451_world_spell_proc_event.sql new file mode 100644 index 00000000000..3665eecf8e6 --- /dev/null +++ b/sql/updates/3451_world_spell_proc_event.sql @@ -0,0 +1,11 @@ +DELETE FROM `spell_proc_event` WHERE `entry` IN (20177, 20179, 20181, 20180, 20182); +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(20177, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0), +(20179, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0), +(20181, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0), +(20180, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0), +(20182, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0); + +DELETE FROM `spell_proc_event` WHERE `entry` IN (50720); +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES +( 50720, 59665, 0, 'Vigilance (redirect threat)');
\ No newline at end of file diff --git a/sql/world_spell_full.sql b/sql/world_spell_full.sql index 9f072b7b49e..788decbeddf 100644 --- a/sql/world_spell_full.sql +++ b/sql/world_spell_full.sql @@ -77,6 +77,7 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comm ( 32390, 60467, 2, 'Shadow Embrace Rank4'), ( 32391, 60468, 2, 'Shadow Embrace Rank5'), ( 33206, 44416, 2, 'Pain Suppression (threat)'), +( 50720, 59665, 0, 'Vigilance (redirect threat)'), -- Creature ( 36574, 36650, 0, 'Apply Phase Slip Vulnerability'), -- instance @@ -766,7 +767,11 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell (20164, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0), (20165, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0), (20166, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0), -(20182, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0), +(20177, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0), +(20179, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0), +(20181, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0), +(20180, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0), +(20182, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0), (20210, 0, 10, 3221225472, 0, 0, 0, 2, 0, 0, 0), (20212, 0, 10, 3221225472, 0, 0, 0, 2, 0, 0, 0), (20213, 0, 10, 3221225472, 0, 0, 0, 2, 0, 0, 0), diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 2bdae866aab..12d106ecd13 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -3324,6 +3324,14 @@ void Player::RemoveSpellCooldown( uint32 spell_id, bool update /* = false */ ) } } +void Player::RemoveCategoryCooldown( uint32 cat ) +{ + SpellCategoryStore::const_iterator i_scstore = sSpellCategoryStore.find(cat); + if(i_scstore != sSpellCategoryStore.end()) + for(SpellCategorySet::const_iterator i_scset = i_scstore->second.begin(); i_scset != i_scstore->second.end(); ++i_scset) + RemoveSpellCooldown(*i_scset, true); +} + void Player::RemoveArenaSpellCooldowns() { // remove cooldowns on spells that has < 15 min CD diff --git a/src/game/Player.h b/src/game/Player.h index 54560f05f03..428981cdf34 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1386,6 +1386,7 @@ class TRINITY_DLL_SPEC Player : public Unit void SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId = 0, Spell* spell = NULL); void ProhibitSpellScholl(SpellSchoolMask idSchoolMask, uint32 unTimeMs ); void RemoveSpellCooldown(uint32 spell_id, bool update = false); + void RemoveCategoryCooldown(uint32 cat); void RemoveArenaSpellCooldowns(); void RemoveAllSpellCooldown(); void _LoadSpellCooldowns(QueryResult *result); diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index d23491f9d68..0a9bf4747f0 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1054,7 +1054,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) // Do triggers for unit (reflect triggers passed on hit phase for correct drop charge) if (canEffectTrigger && missInfo != SPELL_MISS_REFLECT) - caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo); + caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo, m_triggeredByAuraSpell); if (m_spellAura) m_spellAura->SetProcDamage(addhealth); @@ -1080,7 +1080,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) // Do triggers for unit (reflect triggers passed on hit phase for correct drop charge) if (canEffectTrigger && missInfo != SPELL_MISS_REFLECT) - caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo); + caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo, m_triggeredByAuraSpell); if (m_spellAura) m_spellAura->SetProcDamage(damageInfo.damage); @@ -1102,7 +1102,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) procEx |= createProcExtendMask(&damageInfo, missInfo); // Do triggers for unit (reflect triggers passed on hit phase for correct drop charge) if (canEffectTrigger && missInfo != SPELL_MISS_REFLECT) - caster->ProcDamageAndSpell(unit, procAttacker, procVictim, procEx, 0, m_attackType, m_spellInfo); + caster->ProcDamageAndSpell(unit, procAttacker, procVictim, procEx, 0, m_attackType, m_spellInfo, m_triggeredByAuraSpell); } if( !m_caster->IsFriendlyTo(unit) && !IsPositiveSpell(m_spellInfo->Id)) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index a3f1a637f9a..5ce8ec41f32 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -502,7 +502,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) case SPELLFAMILY_PRIEST: { // Shadow Word: Death - deals damage equal to damage done to caster - if ((m_spellInfo->SpellFamilyFlags[1] & 0x2 )&& m_damage < unitTarget->GetHealth()) + if ((m_spellInfo->SpellFamilyFlags[1] & 0x2 )) m_caster->CastCustomSpell(m_caster, 32409, &damage, 0, 0, true); break; } @@ -4850,7 +4850,7 @@ void Spell::EffectScriptEffect(uint32 effIndex) unitTarget->CastSpell(unitTarget, spellId, true); break; } - //5,000 Gold + // 5,000 Gold case 46642: { if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) @@ -4860,6 +4860,17 @@ void Spell::EffectScriptEffect(uint32 effIndex) break; } + // Vigilance + case 50725: + { + if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) + return; + + // Remove Taunt cooldown + ((Player*)unitTarget)->RemoveSpellCooldown(355, true); + + return; + } // Emblazon Runeblade case 51770: { @@ -5194,7 +5205,7 @@ void Spell::EffectScriptEffect(uint32 effIndex) { switch (iter->first) { - // Seal of light, wisdom, justice + // Seal of light, Seal of wisdom, Seal of justice case 20165: case 20166: case 20164: diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 12b588e53a7..f6fb9d73f2d 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4567,15 +4567,15 @@ void Unit::SendSpellNonMeleeDamageLog(Unit *target,uint32 SpellID,uint32 Damage, SendSpellNonMeleeDamageLog(&log); } -void Unit::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVictim, uint32 procExtra, uint32 amount, WeaponAttackType attType, SpellEntry const *procSpell) +void Unit::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVictim, uint32 procExtra, uint32 amount, WeaponAttackType attType, SpellEntry const *procSpell, SpellEntry const * procAura) { // Not much to do if no flags are set. if (procAttacker) - ProcDamageAndSpellFor(false,pVictim,procAttacker, procExtra,attType, procSpell, amount); + ProcDamageAndSpellFor(false,pVictim,procAttacker, procExtra,attType, procSpell, amount, procAura); // Now go on with a victim's events'n'auras // Not much to do if no flags are set or there is no victim if(pVictim && pVictim->isAlive() && procVictim) - pVictim->ProcDamageAndSpellFor(true,this,procVictim, procExtra, attType, procSpell, amount); + pVictim->ProcDamageAndSpellFor(true,this,procVictim, procExtra, attType, procSpell, amount, procAura); } void Unit::SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo) @@ -7013,6 +7013,11 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig case SPELLFAMILY_WARRIOR: if (auraSpellInfo->Id == 50421) // Scent of Blood trigger_spell_id = 50422; + // Sword and Board + else if (trigger_spell_id == 50227) + // remove cooldown of Shield Slam + if (GetTypeId()==TYPEID_PLAYER) + ((Player*)this)->RemoveCategoryCooldown(1209); break; case SPELLFAMILY_WARLOCK: { @@ -11926,7 +11931,7 @@ uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missC return procEx; } -void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage ) +void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage , SpellEntry const * procAura) { // For melee/ranged based attack need update skills and set some Aura states if (procFlag & MELEE_BASED_TRIGGER_MASK) @@ -11998,6 +12003,9 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag // Fill procTriggered list for(AuraMap::const_iterator itr = GetAuras().begin(); itr!= GetAuras().end(); ++itr) { + // Do not allow auras to proc from effect of itself + if (procAura && procAura->Id == itr->first) + continue; ProcTriggeredData triggerData(itr->second); if(!IsTriggeredAtSpellProcEvent(pTarget, triggerData.aura, procSpell, procFlag, procExtra, attType, isVictim, (damage > 0), triggerData.spellProcEvent)) continue; diff --git a/src/game/Unit.h b/src/game/Unit.h index b22902ba40b..35f4ef1763b 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1080,8 +1080,8 @@ class TRINITY_DLL_SPEC Unit : public WorldObject void Kill(Unit *pVictim, bool durabilityLoss = true); int32 DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellProto, bool critical = false); - void ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellEntry const *procSpell = NULL); - void ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage ); + void ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellEntry const *procSpell = NULL, SpellEntry const * procAura = NULL); + void ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage , SpellEntry const * procAura = NULL); void HandleEmoteCommand(uint32 anim_id); void AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType = BASE_ATTACK, bool extra = false ); |
