aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQAston <none@none>2009-06-10 23:44:30 +0200
committerQAston <none@none>2009-06-10 23:44:30 +0200
commitda067afe12b457e603fd9f3af6914764c48a07dd (patch)
tree4436fd11765815908a7281c76cbd5b4cc9b49e00
parent5ad8284841af267a45f5099f391e1aba9f57576a (diff)
*Fix Improved Spell Reflection
*Fix Glyph of Improved Scorch *Sword And Board *Fix Glyph of Devastate - original patch by CRAZyBUg --HG-- branch : trunk
-rw-r--r--sql/updates/3914_world_spell_proc_event.sql4
-rw-r--r--sql/world_spell_full.sql3
-rw-r--r--src/game/SharedDefines.h2
-rw-r--r--src/game/Spell.cpp6
-rw-r--r--src/game/SpellAuras.cpp30
-rw-r--r--src/game/SpellAuras.h1
-rw-r--r--src/game/SpellEffects.cpp7
-rw-r--r--src/game/SpellMgr.cpp6
-rw-r--r--src/game/SpellMgr.h4
-rw-r--r--src/game/Unit.cpp120
-rw-r--r--src/game/Unit.h4
11 files changed, 142 insertions, 45 deletions
diff --git a/sql/updates/3914_world_spell_proc_event.sql b/sql/updates/3914_world_spell_proc_event.sql
new file mode 100644
index 00000000000..54ee080f1a4
--- /dev/null
+++ b/sql/updates/3914_world_spell_proc_event.sql
@@ -0,0 +1,4 @@
+DELETE FROM `spell_proc_event` WHERE `entry` IN (59088, 59089, 58388);
+INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
+(59088, 0x00, 4, 0x00000000, 0x00000002, 0x00000000, 0x00010000, 0x00000000, 0, 0, 0), -- Improved Spell Reflection
+(59089, 0x00, 4, 0x00000000, 0x00000002, 0x00000000, 0x00010000, 0x00000000, 0, 0, 0); -- Improved Spell Reflection \ No newline at end of file
diff --git a/sql/world_spell_full.sql b/sql/world_spell_full.sql
index b0d025ba1c5..0305998be26 100644
--- a/sql/world_spell_full.sql
+++ b/sql/world_spell_full.sql
@@ -1466,7 +1466,6 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell
(58364, 0x00, 4, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Revenge
(58372, 0x00, 4, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Hamstring
(58386, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0, 0, 0), -- Glyph of Overpower
-(58388, 0x00, 4, 0x00000040, 0x00000000, 0x00000000, 0x00000110, 0x00000000, 0, 0, 0), -- Glyph of Devastate
(58426, 0x00, 8, 0x00400000, 0x00000000, 0x00000000, 0x00014000, 0x00006001, 0, 0, 0), -- Overkill
(58435, 0x00, 5, 0x00000002, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Pandemic (Rank 1)
(58436, 0x00, 5, 0x00000002, 0x00000100, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Pandemic (Rank 2)
@@ -1484,6 +1483,8 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell
(58874, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Damage Shield (Rank 2)
(58901, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Tears of Anguish
(59057, 0x00, 15, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Rime (Rank 3)
+(59088, 0x00, 4, 0x00000000, 0x00000002, 0x00000000, 0x00010000, 0x00000000, 0, 0, 0), -- Improved Spell Reflection
+(59089, 0x00, 4, 0x00000000, 0x00000002, 0x00000000, 0x00010000, 0x00000000, 0, 0, 0), -- Improved Spell Reflection
(59176, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Spell Damping
(59327, 0x00, 15, 0x08000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Rune Tap
(59725, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0, 0, 0), -- Spell Reflection
diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h
index 3234fc28baa..7a00340111d 100644
--- a/src/game/SharedDefines.h
+++ b/src/game/SharedDefines.h
@@ -1054,7 +1054,7 @@ enum Targets
TARGET_DST_TARGET_ENEMY = 53, // set unit coordinates as dest, only 16 target B imlemented
TARGET_UNIT_CONE_ENEMY_UNKNOWN = 54, // 180 degree, or different angle
TARGET_DEST_CASTER_FRONT_LEAP = 55, // for a leap spell
- TARGET_UNIT_RAID_CASTER = 56,
+ TARGET_UNIT_RAID_CASTER = 56,
TARGET_UNIT_TARGET_RAID = 57,
TARGET_UNIT_NEARBY_RAID = 58,
TARGET_UNIT_CONE_ALLY = 59,
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 8226308c220..77774d6031f 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -2202,7 +2202,7 @@ void Spell::SetTargetMap(uint32 i, uint32 cur)
{
case TARGET_UNIT_AREA_PARTY_SRC:
case TARGET_UNIT_AREA_PARTY_DST:
- m_caster->GetPartyMember(unitList, radius); //fix me
+ m_caster->GetPartyMemberInDist(unitList, radius); //fix me
break;
case TARGET_OBJECT_AREA_SRC: // fix me
case TARGET_OBJECT_AREA_DST:
@@ -2237,10 +2237,10 @@ void Spell::SetTargetMap(uint32 i, uint32 cur)
break;
}
case TARGET_UNIT_PARTY_TARGET:
- m_targets.getUnitTarget()->GetPartyMember(unitList, radius);
+ m_targets.getUnitTarget()->GetPartyMemberInDist(unitList, radius);
break;
case TARGET_UNIT_PARTY_CASTER:
- m_caster->GetPartyMember(unitList, radius);
+ m_caster->GetPartyMemberInDist(unitList, radius);
break;
case TARGET_UNIT_RAID_CASTER:
m_caster->GetRaidMember(unitList, radius);
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 30e81e39587..0b726f742aa 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -80,7 +80,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&AuraEffect::HandleAuraModPacify, // 25 SPELL_AURA_MOD_PACIFY
&AuraEffect::HandleAuraModRoot, // 26 SPELL_AURA_MOD_ROOT
&AuraEffect::HandleAuraModSilence, // 27 SPELL_AURA_MOD_SILENCE
- &AuraEffect::HandleNoImmediateEffect, // 28 SPELL_AURA_REFLECT_SPELLS implement in Unit::SpellHitResult
+ &AuraEffect::HandleReflectSpells, // 28 SPELL_AURA_REFLECT_SPELLS implement in Unit::SpellHitResult
&AuraEffect::HandleAuraModStat, // 29 SPELL_AURA_MOD_STAT
&AuraEffect::HandleAuraModSkill, // 30 SPELL_AURA_MOD_SKILL
&AuraEffect::HandleAuraModIncreaseSpeed, // 31 SPELL_AURA_MOD_INCREASE_SPEED
@@ -730,7 +730,7 @@ void AreaAuraEffect::Update(uint32 diff)
switch(m_areaAuraType)
{
case AREA_AURA_PARTY:
- source->GetPartyMember(targets, m_radius);
+ source->GetPartyMemberInDist(targets, m_radius);
break;
case AREA_AURA_RAID:
source->GetRaidMember(targets, m_radius);
@@ -7161,3 +7161,29 @@ void AuraEffect::HandleAuraSafeFall( bool Apply, bool Real , bool /*changeAmount
if(Apply && Real && GetId()==32474 && m_target->GetTypeId()==TYPEID_PLAYER)
((Player*)m_target)->ActivateTaxiPathTo(506,GetId());
}
+
+void AuraEffect::HandleReflectSpells( bool Apply, bool Real , bool /*changeAmount*/)
+{
+ // implemented in Unit::SpellHitResult
+
+ // only special case
+ if(!Apply && Real && m_spellProto->SpellFamilyName == SPELLFAMILY_WARRIOR && m_spellProto->SpellFamilyFlags[1] & 0x2)
+ {
+ if (Unit * caster = GetCaster())
+ {
+ // Improved Spell Reflection
+ if (caster->GetDummyAura(59089) || caster->GetDummyAura(59088))
+ {
+ // aura remove - remove auras from all party members
+ std::list<Unit*> PartyMembers;
+ m_target->GetPartyMembers(PartyMembers);
+ for (std::list<Unit*>::iterator itr = PartyMembers.begin();itr!=PartyMembers.end();++itr)
+ {
+ if ((*itr)!= m_target)
+ (*itr)->RemoveAurasWithFamily(SPELLFAMILY_WARRIOR, 0, 0x2, 0, GetCasterGUID());
+ }
+ }
+ }
+ }
+}
+
diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
index 9b7b024e02a..db99660b0ec 100644
--- a/src/game/SpellAuras.h
+++ b/src/game/SpellAuras.h
@@ -331,6 +331,7 @@ class TRINITY_DLL_SPEC AuraEffect
void HandlePhase(bool Apply, bool Real, bool changeAmount);
void HandleAuraAllowOnlyAbility(bool apply, bool Real, bool changeAmount);
void HandleCharmConvert(bool apply, bool Real, bool changeAmount);
+ void HandleReflectSpells( bool Apply, bool Real , bool changeAmount);
// add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras
void HandleShapeshiftBoosts(bool apply);
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 8d6d0bc7ae8..1e3c1d78dfe 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -4211,7 +4211,12 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
}
if (!spellInfo)
break;
- m_caster->CastSpell(unitTarget, spellInfo, true);
+ int32 count = 1;
+ // Glyph of Devastate
+ if (AuraEffect * aurEff = m_caster->GetDummyAura(58388))
+ count += aurEff->GetAmount();
+ for (;count>0;count--)
+ m_caster->CastSpell(unitTarget, spellInfo, true);
if (stack)
spell_bonus += stack * CalculateDamage(2, unitTarget);
}
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index e6af1d7ba21..9901b0fe7af 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -3341,6 +3341,12 @@ void SpellMgr::LoadSpellCustomAttr()
case 45150: // Meteor Slash
mSpellCustomAttr[i] |= SPELL_ATTR_CU_SHARE_DAMAGE;
break;
+ case 59725: // Improved Spell Reflection - aoe aura
+ // Target entry seems to be wrong for this spell :/
+ spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_PARTY_CASTER;
+ spellInfo->EffectRadiusIndex[0] = 45;
+ //mSpellCustomAttr[i] |= SPELL_ATTR_CU_EXCLUDE_SELF;
+ //break;
case 27820: // Mana Detonation
//case 28062: case 39090: // Positive/Negative Charge
//case 28085: case 39093:
diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
index 053a5d0e17a..1f64dc3f585 100644
--- a/src/game/SpellMgr.h
+++ b/src/game/SpellMgr.h
@@ -439,8 +439,8 @@ enum ProcFlags
PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT = 0x00010000, // 16 Successful negative spell cast (by default only on damage)
PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT = 0x00020000, // 17 Taken negative spell (by default only on damage)
- PROC_FLAG_ON_DO_PERIODIC = 0x00040000, // 18 Successful do periodic (damage / healing, determined from 14-17 flags)
- PROC_FLAG_ON_TAKE_PERIODIC = 0x00080000, // 19 Taken spell periodic (damage / healing, determined from 14-17 flags)
+ PROC_FLAG_ON_DO_PERIODIC = 0x00040000, // 18 Successful do periodic (damage / healing, determined from 14,16 flags)
+ PROC_FLAG_ON_TAKE_PERIODIC = 0x00080000, // 19 Taken spell periodic (damage / healing, determined from 15,17 flags)
PROC_FLAG_TAKEN_ANY_DAMAGE = 0x00100000, // 20 Taken any damage
PROC_FLAG_ON_TRAP_ACTIVATION = 0x00200000, // 21 On trap activation
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index b8bcf656b9f..ac11c3b3317 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -500,6 +500,23 @@ void Unit::RemoveAurasWithInterruptFlags(uint32 flag, uint32 except)
UpdateInterruptMask();
}
+void Unit::RemoveAurasWithFamily(uint32 family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, uint64 casterGUID)
+{
+ for(AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end();)
+ {
+ if (!casterGUID || iter->second->GetCasterGUID() == casterGUID)
+ {
+ SpellEntry const *spell = iter->second->GetSpellProto();
+ if (spell->SpellFamilyName == family && spell->SpellFamilyFlags.HasFlag(familyFlag1, familyFlag2, familyFlag3))
+ {
+ RemoveAura(iter);
+ continue;
+ }
+ }
+ ++iter;
+ }
+}
+
void Unit::UpdateInterruptMask()
{
m_interruptMask = 0;
@@ -5421,35 +5438,13 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
triggered_spell_id = 22858;
break;
}
- // Glyph of Devastate
- if(dummySpell->Id==58388)
+ // Improved Spell Reflection
+ if(dummySpell->Id==59088
+ || dummySpell->Id==59089)
{
- // get highest rank of the Sunder Armor spell
- if (GetTypeId()!=TYPEID_PLAYER)
- return false;
- const PlayerSpellMap& sp_list = ((Player*)this)->GetSpellMap();
- for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
- {
- // only highest rank is shown in spell book, so simply check if shown in spell book
- if(!itr->second->active || itr->second->disabled || itr->second->state == PLAYERSPELL_REMOVED)
- continue;
-
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
- if (!spellInfo)
- continue;
-
- if (spellInfo->SpellFamilyFlags.IsEqual(SPELLFAMILYFLAG_WARRIOR_SUNDERARMOR)
- && spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR)
- {
- triggered_spell_id = spellInfo->Id;
- break;
- }
- }
- if (!triggered_spell_id)
- return false;
- for (int32 value = CalculateSpellDamage(dummySpell, 0 , dummySpell->EffectBasePoints[0], pVictim);value>0;value--)
- CastSpell(target,triggered_spell_id,true);
- return true;
+ triggered_spell_id = 59725;
+ target = this;
+ break;
}
// Second Wind
if (dummySpell->SpellIconID == 1697)
@@ -7046,11 +7041,6 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
case SPELLFAMILY_WARRIOR:
if (auraSpellInfo->Id == 50421) // Scent of Blood
trigger_spell_id = 50422;
- // Sword and Board
- else if (trigger_spell_id == 50227)
- // remove cooldown of Shield Slam
- if (GetTypeId()==TYPEID_PLAYER)
- ((Player*)this)->RemoveCategoryCooldown(1209);
break;
case SPELLFAMILY_WARLOCK:
{
@@ -7376,6 +7366,31 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
break;
}
}
+ else
+ {
+ switch (auraSpellInfo->SpellFamilyName)
+ {
+ case SPELLFAMILY_WARRIOR:
+ // Sword and Board
+ if (trigger_spell_id == 50227)
+ // remove cooldown of Shield Slam
+ if (GetTypeId()==TYPEID_PLAYER)
+ ((Player*)this)->RemoveCategoryCooldown(1209);
+ break;
+ case SPELLFAMILY_MAGE:
+ if (trigger_spell_id == 22959)
+ {
+ // Glyph of Improved Scorch
+ if (AuraEffect * aurEff = GetDummyAura(56371))
+ {
+ for (int32 count = aurEff->GetAmount();count>0;count--)
+ CastSpell(pVictim, 22959, true);
+ return true;
+ }
+ }
+ break;
+ }
+ }
// All ok. Check current trigger spell
SpellEntry const* triggerEntry = sSpellStore.LookupEntry(trigger_spell_id);
@@ -13874,7 +13889,7 @@ void Unit::GetRaidMember(std::list<Unit*> &nearMembers, float radius)
}
}
-void Unit::GetPartyMember(std::list<Unit*> &TagUnitMap, float radius)
+void Unit::GetPartyMemberInDist(std::list<Unit*> &TagUnitMap, float radius)
{
Unit *owner = GetCharmerOrOwnerOrSelf();
Group *pGroup = NULL;
@@ -13911,6 +13926,43 @@ void Unit::GetPartyMember(std::list<Unit*> &TagUnitMap, float radius)
}
}
+void Unit::GetPartyMembers(std::list<Unit*> &TagUnitMap)
+{
+ Unit *owner = GetCharmerOrOwnerOrSelf();
+ Group *pGroup = NULL;
+ if (owner->GetTypeId() == TYPEID_PLAYER)
+ pGroup = ((Player*)owner)->GetGroup();
+
+ if(pGroup)
+ {
+ uint8 subgroup = ((Player*)owner)->GetSubGroup();
+
+ for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+ {
+ Player* Target = itr->getSource();
+
+ // IsHostileTo check duel and controlled by enemy
+ if( Target && Target->GetSubGroup()==subgroup && !IsHostileTo(Target) )
+ {
+ if(Target->isAlive() && IsInMap(Target) )
+ TagUnitMap.push_back(Target);
+
+ if(Guardian* pet = Target->GetGuardianPet())
+ if(pet->isAlive() && IsInMap(Target) )
+ TagUnitMap.push_back(pet);
+ }
+ }
+ }
+ else
+ {
+ if(owner->isAlive() && (owner == this || IsInMap(owner)))
+ TagUnitMap.push_back(owner);
+ if(Guardian* pet = owner->GetGuardianPet())
+ if(pet->isAlive() && (pet == this || IsInMap(pet)))
+ TagUnitMap.push_back(pet);
+ }
+}
+
void Unit::HandleAuraEffect(AuraEffect * aureff, bool apply)
{
if (aureff->GetParentAura()->IsRemoved())
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 5dea3b3304b..039dabd791f 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1123,7 +1123,8 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
bool IsNeutralToAll() const;
bool IsInPartyWith(Unit const* unit) const;
bool IsInRaidWith(Unit const* unit) const;
- void GetPartyMember(std::list<Unit*> &units, float dist);
+ void GetPartyMemberInDist(std::list<Unit*> &units, float dist);
+ void GetPartyMembers(std::list<Unit*> &units);
void GetRaidMember(std::list<Unit*> &units, float dist);
bool IsContestedGuard() const
{
@@ -1403,6 +1404,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void RemoveNotOwnSingleTargetAuras();
bool RemoveNoStackAurasDueToAura(Aura *Aur);
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = NULL);
+ void Unit::RemoveAurasWithFamily(uint32 family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, uint64 casterGUID);
void RemoveMovementImpairingAuras();
void RemoveAllAuras();
void RemoveArenaAuras(bool onleave = false);