*Fix divine hymn.
*Prevent unexpected behaviour of dummy proc auras combined with ObsModEnergy auras. --HG-- branch : trunk
This commit is contained in:
@@ -0,0 +1 @@
|
||||
INSERT INTO `spell_linked_spell` VALUES (-47953, 60406, 0, 'Divine hymn buff to enemies');
|
||||
@@ -75,4 +75,5 @@ INSTALL(FILES
|
||||
1764_world.sql
|
||||
1766_world.sql
|
||||
1814_world.sql
|
||||
1825_world.sql
|
||||
DESTINATION share/trinity/sql/updates)
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+65
-11
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user