aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/2021_world.sql6
-rw-r--r--sql/updates/CMakeLists.txt1
-rw-r--r--src/game/Spell.cpp1
-rw-r--r--src/game/SpellAuras.cpp2
-rw-r--r--src/game/SpellEffects.cpp18
-rw-r--r--src/game/Unit.cpp62
-rw-r--r--src/game/Unit.h3
7 files changed, 79 insertions, 14 deletions
diff --git a/sql/updates/2021_world.sql b/sql/updates/2021_world.sql
new file mode 100644
index 00000000000..38e86847763
--- /dev/null
+++ b/sql/updates/2021_world.sql
@@ -0,0 +1,6 @@
+DELETE FROM `spell_proc_event` WHERE `entry` IN (30293, 30295, 30296);
+INSERT INTO `spell_proc_event` VALUES
+-- Soul Leech
+(30293, 0x00, 5, 0x00000381, 0x200C0, 0x00000000, 0x0000000, 0x0000000, 0.000000, 0.000000, 0),
+(30295, 0x00, 5, 0x00000381, 0x200C0, 0x00000000, 0x0000000, 0x0000000, 0.000000, 0.000000, 0),
+(30296, 0x00, 5, 0x00000381, 0x200C0, 0x00000000, 0x0000000, 0x0000000, 0.000000, 0.000000, 0); \ No newline at end of file
diff --git a/sql/updates/CMakeLists.txt b/sql/updates/CMakeLists.txt
index 83d237c5eb2..7412d137532 100644
--- a/sql/updates/CMakeLists.txt
+++ b/sql/updates/CMakeLists.txt
@@ -87,4 +87,5 @@ INSTALL(FILES
1939_word.sql
1957_word.sql
2013_world.sql
+2021_world.sql
DESTINATION share/trinity/sql/updates) \ No newline at end of file
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index dd699e32633..881a68e6c19 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1524,7 +1524,6 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
// TagUnitMap.push_back(target);
//else
m_caster->GetRaidMember(TagUnitMap, radius_f);
- TagUnitMap.push_back(m_caster);
break;
}
}break;
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 6415638169f..97112095d62 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -651,7 +651,7 @@ void AreaAura::Update(uint32 diff)
caster->GetPartyMember(targets, m_radius);
break;
case AREA_AURA_RAID:
- caster->GetRaidMember(targets, m_radius);
+ caster->GetRaidMember(targets, m_radius);
break;
case AREA_AURA_FRIEND:
{
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index eca088eba05..5176bca920f 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -5099,6 +5099,22 @@ void Spell::EffectScriptEffect(uint32 effIndex)
DoCreateItem( effIndex, itemtype );
return;
}
+ // Everlasting Affliction
+ case 47422:
+ // Refresh corruption on target
+ Unit::AuraMap& auras = unitTarget->GetAuras();
+ for(Unit::AuraMap::iterator itr = auras.begin(); itr != auras.end(); ++itr)
+ {
+ SpellEntry const *spellInfo = (*itr).second->GetSpellProto();
+ if( spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK &&
+ spellInfo->SpellFamilyFlags[0] & 0x2 &&
+ (*itr).second->GetCasterGUID() == m_caster->GetGUID())
+ {
+ unitTarget->RefreshAurasByCasterSpell(spellInfo->Id, m_caster->GetGUID());
+ return;
+ }
+ }
+ break;
}
break;
}
@@ -5120,7 +5136,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
spellInfo->SpellFamilyFlags[0] & 0x8000 &&
(*itr).second->GetCasterGUID() == m_caster->GetGUID())
{
- (*itr).second->RefreshAura();
+ unitTarget->RefreshAurasByCasterSpell((*itr).second->GetId(), m_caster->GetGUID());
return;
}
}
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index abb8843efb6..e037c17bead 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -4134,6 +4134,23 @@ void Unit::RemoveAurasByCasterSpell(uint32 spellId, uint8 effindex, uint64 caste
}
}
+void Unit::RefreshAurasByCasterSpell(uint32 spellId, uint64 casterGUID)
+{
+ // Lookup for auras already applied from spell
+ for(uint8 i = 0; i < 3; ++i)
+ {
+ spellEffectPair spair = spellEffectPair(spellId, i);
+ for(AuraMap::const_iterator itr = GetAuras().lower_bound(spair); itr != GetAuras().upper_bound(spair); ++itr)
+ {
+ if(itr->second->GetCasterGUID()==casterGUID)
+ {
+ itr->second->RefreshAura();
+ break;
+ }
+ }
+ }
+}
+
void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeler)
{
for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); )
@@ -5641,6 +5658,23 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 30295:
case 30296:
{
+ // Improved Soul Leech
+ AuraList const& SoulLeechAuras = GetAurasByType(SPELL_AURA_DUMMY);
+ for(Unit::AuraList::const_iterator i = SoulLeechAuras.begin();i != SoulLeechAuras.end(); ++i)
+ {
+ if ((*i)->GetId()==54117 || (*i)->GetId()==54118)
+ {
+ basepoints0 = int32((*i)->GetModifier()->m_amount);
+ if (target = GetPet())
+ {
+ // regen mana for pet
+ CastCustomSpell(target,54607,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
+ }
+ // regen mana for caster
+ CastCustomSpell(this,59117,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
+ break;
+ }
+ }
// health
basepoints0 = int32(damage*triggerAmount/100);
target = this;
@@ -12658,7 +12692,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry con
if(Player* modOwner = GetSpellModOwner())
{
modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_CHANCE_OF_SUCCESS,chance);
- modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_PROC_CHANCE,chance);
+ modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_PROC_PER_MINUTE,chance);
}
return roll_chance_f(chance);
@@ -13378,17 +13412,25 @@ void Unit::GetRaidMember(std::list<Unit*> &nearMembers, float radius)
return;
Group *pGroup = owner->GetGroup();
- if(!pGroup)
- return;
-
- for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+ if(pGroup)
{
- Player* Target = itr->getSource();
+ for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+ {
+ Player* Target = itr->getSource();
- // IsHostileTo check duel and controlled by enemy
- if( Target && Target != this && Target->isAlive()
- && IsWithinDistInMap(Target, radius) && !IsHostileTo(Target) )
- nearMembers.push_back(Target);
+ // IsHostileTo check duel and controlled by enemy
+ if( Target && Target != this && Target->isAlive()
+ && IsWithinDistInMap(Target, radius) && !IsHostileTo(Target) )
+ nearMembers.push_back(Target);
+ }
+ }
+ else
+ {
+ if(owner->isAlive() && (owner == this || IsWithinDistInMap(owner, radius)))
+ nearMembers.push_back(owner);
+ if(Pet* pet = owner->GetPet())
+ if(pet->isAlive() && (pet == this && IsWithinDistInMap(pet, radius)))
+ nearMembers.push_back(pet);
}
}
diff --git a/src/game/Unit.h b/src/game/Unit.h
index d3125aaff61..cee3a93339b 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -114,7 +114,7 @@ enum SpellModOp
SPELLMOD_EFFECT3 = 23,
SPELLMOD_SPELL_BONUS_DAMAGE = 24,
// spellmod 25
- SPELLMOD_PROC_CHANCE = 26,
+ SPELLMOD_PROC_PER_MINUTE = 26,
SPELLMOD_MULTIPLE_VALUE = 27,
SPELLMOD_RESIST_DISPEL_CHANCE = 28,
SPELLMOD_CRIT_DAMAGE_BONUS_2 = 29, //one not used spell
@@ -1235,6 +1235,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId);
void RemoveAurasByCasterSpell(uint32 spellId, uint64 casterGUID, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT);
void RemoveAurasByCasterSpell(uint32 spellId, uint8 effindex, uint64 casterGUID, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT);
+ void RefreshAurasByCasterSpell(uint32 spellId, uint64 casterGUID);
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeler);
void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit *stealer);
void RemoveAurasDueToSpellByCancel(uint32 spellId);