aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <none@none>2009-03-11 21:36:02 +0100
committerQAston <none@none>2009-03-11 21:36:02 +0100
commitc3026bc7556c0c9511a043756d35d6b8ec1eb692 (patch)
treef2eaf5288528828a964bc7d2bc7979adbce93532 /src
parent6f4e33c611f0960c7c30ed5f6e8ff5da20c9c3fe (diff)
*Fix divine hymn.
*Prevent unexpected behaviour of dummy proc auras combined with ObsModEnergy auras. --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellEffects.cpp10
-rw-r--r--src/game/Unit.cpp76
-rw-r--r--src/game/Unit.h1
3 files changed, 76 insertions, 11 deletions
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);