diff options
-rw-r--r-- | sql/updates/1825_world.sql | 1 | ||||
-rw-r--r-- | sql/updates/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 10 | ||||
-rw-r--r-- | src/game/Unit.cpp | 76 | ||||
-rw-r--r-- | src/game/Unit.h | 1 |
5 files changed, 78 insertions, 11 deletions
diff --git a/sql/updates/1825_world.sql b/sql/updates/1825_world.sql new file mode 100644 index 00000000000..9548a529cdd --- /dev/null +++ b/sql/updates/1825_world.sql @@ -0,0 +1 @@ +INSERT INTO `spell_linked_spell` VALUES (-47953, 60406, 0, 'Divine hymn buff to enemies'); diff --git a/sql/updates/CMakeLists.txt b/sql/updates/CMakeLists.txt index dc4dfb35d8b..fb76773c5b8 100644 --- a/sql/updates/CMakeLists.txt +++ b/sql/updates/CMakeLists.txt @@ -75,4 +75,5 @@ INSTALL(FILES 1764_world.sql 1766_world.sql 1814_world.sql +1825_world.sql DESTINATION share/trinity/sql/updates)
\ No newline at end of file diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 73aea9761b4..ef206ae4660 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -5139,6 +5139,16 @@ void Spell::EffectScriptEffect(uint32 effIndex) } return; } + // Divine Hymn + case 47951: + { + if (!unitTarget) + return; + Unit * target=NULL; + unitTarget->CastSpell(target, 59600, false); + unitTarget->CastSpell(target, 47953, false); + return; + } default: break; } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index cfd4a8ead5a..58d419de98f 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -5912,16 +5912,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu } case SPELLFAMILY_HUNTER: { - // Aspect of the Viper - if ( dummySpell->SpellFamilyFlags[1] & 0x40000 ) - { - uint32 maxmana = GetMaxPower(POWER_MANA); - basepoints0 = maxmana* GetAttackTime(RANGED_ATTACK)/1000.0f/100.0f; - - target = this; - triggered_spell_id = 34075; - break; - } // Thrill of the Hunt if ( dummySpell->SpellIconID == 2236 ) { @@ -6684,6 +6674,66 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu return true; } +bool Unit::HandleObsModEnergyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const * procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown) +{ + SpellEntry const *dummySpell = triggeredByAura->GetSpellProto (); + uint32 effIndex = triggeredByAura->GetEffIndex(); + int32 triggerAmount = triggeredByAura->GetModifier()->m_amount; + + Item* castItem = triggeredByAura->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER + ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGUID()) : NULL; + + uint32 triggered_spell_id = 0; + Unit* target = pVictim; + int32 basepoints0 = 0; + + switch(dummySpell->SpellFamilyName) + { + case SPELLFAMILY_HUNTER: + { + // Aspect of the Viper + if ( dummySpell->SpellFamilyFlags[1] & 0x40000 ) + { + uint32 maxmana = GetMaxPower(POWER_MANA); + basepoints0 = maxmana* GetAttackTime(RANGED_ATTACK)/1000.0f/100.0f; + + target = this; + triggered_spell_id = 34075; + break; + } + break; + } + } + // processed charge only counting case + if(!triggered_spell_id) + return true; + + SpellEntry const* triggerEntry = sSpellStore.LookupEntry(triggered_spell_id); + + if(!triggerEntry) + { + sLog.outError("Unit::HandleDummyAuraProc: Spell %u have not existed triggered spell %u",dummySpell->Id,triggered_spell_id); + return false; + } + + // default case + if(!target || target!=this && !target->isAlive()) + return false; + + if( cooldown && GetTypeId()==TYPEID_PLAYER && ((Player*)this)->HasSpellCooldown(triggered_spell_id)) + return false; + + if(basepoints0) + CastCustomSpell(target,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); + else + CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura); + + if( cooldown && GetTypeId()==TYPEID_PLAYER ) + ((Player*)this)->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown); + + return true; +} + bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlags, uint32 procEx, uint32 cooldown) { // Get triggered aura spell info @@ -11675,7 +11725,6 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag break; } case SPELL_AURA_MANA_SHIELD: - case SPELL_AURA_OBS_MOD_ENERGY: 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()); @@ -11683,6 +11732,11 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag continue; 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; + 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()); diff --git a/src/game/Unit.h b/src/game/Unit.h index c6f9c4d17c9..1f40b748fb6 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1607,6 +1607,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject bool IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent ); bool HandleDummyAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + bool HandleObsModEnergyAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); bool HandleHasteAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); bool HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); bool HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 cooldown); |