*Fix Living Bomb target selection.

*Fix healing mod apply for devouring plague.
*Fix psychic horror.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-03-15 23:59:06 +01:00
parent 61f519ca26
commit 5bc3df176a
7 changed files with 25 additions and 14 deletions
+4 -2
View File
@@ -1380,6 +1380,9 @@ void Spell::SearchChainTarget(std::list<Unit*> &TagUnitMap, float max_range, uin
void Spell::SearchAreaTarget(std::list<Unit*> &TagUnitMap, float radius, const uint32 &type, SpellTargets TargetType, uint32 entry)
{
float x, y, z;
Unit *target = m_targets.getUnitTarget();
if(type == PUSH_DEST_CENTER)
{
if(!m_targets.HasDest())
@@ -1393,7 +1396,6 @@ void Spell::SearchAreaTarget(std::list<Unit*> &TagUnitMap, float radius, const u
}
else if(type == PUSH_TARGET_CENTER)
{
Unit *target = m_targets.getUnitTarget();
if(!target)
{
sLog.outError( "SPELL: cannot find unit target for spell ID %u\n", m_spellInfo->Id );
@@ -1410,7 +1412,7 @@ void Spell::SearchAreaTarget(std::list<Unit*> &TagUnitMap, float radius, const u
z = m_caster->GetPositionZ();
}
Trinity::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius, type, TargetType, entry, x, y, z);
Trinity::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius, type, TargetType, entry, x, y, z, target);
if((m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_PLAYERS_ONLY)
|| TargetType == SPELL_TARGETS_ENTRY && !entry)
m_caster->GetMap()->VisitWorld(x, y, radius, notifier);
+11 -5
View File
@@ -634,20 +634,23 @@ namespace Trinity
Unit* i_caster;
uint32 i_entry;
float i_x, i_y, i_z;
Unit* i_unitTarget;
Unit* i_origCaster;
SpellNotifierCreatureAndPlayer(Spell &spell, std::list<Unit*> &data, float radius, const uint32 &type,
SpellTargets TargetType = SPELL_TARGETS_ENEMY, uint32 entry = 0, float x = 0, float y = 0, float z = 0)
SpellTargets TargetType = SPELL_TARGETS_ENEMY, uint32 entry = 0, float x = 0, float y = 0, float z = 0, Unit * unitTarget=NULL)
: i_data(&data), i_spell(spell), i_push_type(type), i_radius(radius), i_radiusSq(radius*radius)
, i_TargetType(TargetType), i_entry(entry), i_x(x), i_y(y), i_z(z)
, i_TargetType(TargetType), i_entry(entry), i_x(x), i_y(y), i_z(z), i_unitTarget(unitTarget)
{
i_caster = spell.GetCaster();
i_origCaster = spell.GetOriginalCaster();
}
template<class T> inline void Visit(GridRefManager<T> &m)
{
assert(i_data);
if(!i_caster)
if(!i_origCaster)
return;
for(typename GridRefManager<T>::iterator itr = m.begin(); itr != m.end(); ++itr)
@@ -658,17 +661,20 @@ namespace Trinity
switch (i_TargetType)
{
case SPELL_TARGETS_ALLY:
if (!itr->getSource()->isAttackableByAOE() || !i_caster->IsFriendlyTo( itr->getSource() ))
if (!itr->getSource()->isAttackableByAOE() || !i_origCaster->IsFriendlyTo( itr->getSource() ))
continue;
break;
case SPELL_TARGETS_ENEMY:
{
if (itr->getSource() == i_unitTarget)
break;
if(itr->getSource()->GetTypeId()==TYPEID_UNIT && ((Creature*)itr->getSource())->isTotem())
continue;
if(!itr->getSource()->isAttackableByAOE())
continue;
Unit* check = i_caster->GetCharmerOrOwnerOrSelf();
Unit* check = i_origCaster->GetCharmerOrOwnerOrSelf();
if( check->GetTypeId()==TYPEID_PLAYER )
{
+3 -2
View File
@@ -2066,7 +2066,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
if(!m_target || !(m_removeMode == AURA_REMOVE_BY_DISPEL || m_removeMode == AURA_REMOVE_BY_DEFAULT))
return;
Unit* target=NULL;
m_target->CastSpell(m_target, GetModifier()->m_amount, true, NULL, NULL, GetCasterGUID());
m_target->CastSpell(target, GetModifier()->m_amount, true, NULL, NULL, GetCasterGUID());
return;
}
break;
@@ -5682,7 +5682,8 @@ void Aura::PeriodicTick()
if(Player *modOwner = pCaster->GetSpellModOwner())
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_MULTIPLE_VALUE, multiplier);
uint32 heal = pCaster->SpellHealingBonus(pCaster, spellProto, uint32(new_damage * multiplier), DOT, stackAmount);
// Don't apply heal mods for this aura
uint32 heal = uint32(new_damage * multiplier);//pCaster->SpellHealingBonus(pCaster, spellProto, uint32(new_damage * multiplier), DOT, stackAmount);
int32 gain = pCaster->ModifyHealth(heal);
pCaster->getHostilRefManager().threatAssist(pCaster, gain * 0.5f, spellProto);
-1
View File
@@ -1160,7 +1160,6 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const * spellP
// Always trigger for this
if (EventProcFlag & (PROC_FLAG_KILLED | PROC_FLAG_KILL | PROC_FLAG_ON_TRAP_ACTIVATION))
return true;
if (spellProcEvent) // Exist event data
{
// Store extra req