diff options
-rw-r--r-- | sql/updates/2963_world_spell_proc_event.sql | 8 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 2 | ||||
-rw-r--r-- | src/game/Unit.cpp | 72 | ||||
-rw-r--r-- | src/game/Unit.h | 1 |
4 files changed, 81 insertions, 2 deletions
diff --git a/sql/updates/2963_world_spell_proc_event.sql b/sql/updates/2963_world_spell_proc_event.sql new file mode 100644 index 00000000000..84550fb374f --- /dev/null +++ b/sql/updates/2963_world_spell_proc_event.sql @@ -0,0 +1,8 @@ +DELETE FROM `spell_proc_event` WHERE `entry` IN (20911, 25899); +-- Blessing of sanctuary +INSERT INTO `spell_proc_event` VALUES +(20911, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0), +(25899, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000070, 0.000000, 0.000000, 0); + +DELETE FROM `spell_required` WHERE `spell_id` IN (25899); +INSERT INTO spell_required VALUES (25899, 20911); diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index da1ddc9c3e7..5c754c651d6 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -2557,7 +2557,7 @@ void SpellMgr::LoadPetLevelupSpellMap() if(!spell || !spell->spellLevel || GetTalentSpellPos(spell->Id)) continue; // TODO: some spells have no spellfamilyflag but should be learned - if (!spell->SpellFamilyFlags) + if (!spell->SpellFamilyName) continue; mPetLevelupSpellMap.insert(PetLevelupSpellMap::value_type(creatureFamily->ID, std::make_pair(spell->spellLevel , spell->Id ))); count++; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 48b28179591..6df490c9185 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -6579,7 +6579,69 @@ bool Unit::HandleObsModEnergyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* if(!triggerEntry) { - sLog.outError("Unit::HandleDummyAuraProc: Spell %u have not existed triggered spell %u",dummySpell->Id,triggered_spell_id); + sLog.outError("Unit::HandleObsModEnergyAuraProc: 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::HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const * procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown) +{ + SpellEntry const *dummySpell = triggeredByAura->GetSpellProto (); + uint32 effIndex = triggeredByAura->GetEffIndex(); + int32 triggerAmount = triggeredByAura->GetAmount(); + + Item* castItem = triggeredByAura->GetParentAura()->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER + ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetParentAura()->GetCastItemGUID()) : NULL; + + uint32 triggered_spell_id = 0; + Unit* target = pVictim; + int32 basepoints0 = 0; + + switch(dummySpell->SpellFamilyName) + { + case SPELLFAMILY_PALADIN: + { + // Blessing of Sanctuary + if ( dummySpell->SpellFamilyFlags[0] & 0x10000000 ) + { + switch (getPowerType()) + { + case POWER_MANA: triggered_spell_id = 57319; break; + case POWER_RAGE: triggered_spell_id = 57320; break; + case POWER_RUNIC_POWER: triggered_spell_id = 57321; break; + default: + return false; + } + } + 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::HandleModDamagePctTakenAuraProc: Spell %u have not existed triggered spell %u",dummySpell->Id,triggered_spell_id); return false; } @@ -11752,6 +11814,14 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag 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; + 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 055eb9f3a38..539d8859684 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1709,6 +1709,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, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); bool HandleObsModEnergyAuraProc( Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + bool HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); bool HandleHasteAuraProc( Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); bool HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); bool HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 cooldown); |