mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-17 16:10:49 +01:00
*Fix Blessing of Sanctuary
--HG-- branch : trunk
This commit is contained in:
8
sql/updates/2963_world_spell_proc_event.sql
Normal file
8
sql/updates/2963_world_spell_proc_event.sql
Normal file
@@ -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);
|
||||
@@ -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++;
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user