*Fix Area auras for target without a party.

*Fix Improved soul leech and correct procflags for soul leech.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-03-19 21:47:16 +01:00
parent a2392121f0
commit c6f3532ada
7 changed files with 79 additions and 14 deletions
-1
View File
@@ -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;
+1 -1
View File
@@ -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:
{
+17 -1
View File
@@ -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;
}
}
+52 -10
View File
@@ -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);
}
}
+2 -1
View File
@@ -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);