*Fix Gruul's shatter effect damage. Patch provided by _krz.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-11-16 16:56:35 -06:00
parent a32d417cf0
commit 9bcb0119e9
2 changed files with 17 additions and 3 deletions

View File

@@ -1280,7 +1280,7 @@ void GameObject::CastSpell(Unit* target, uint32 spell)
else
{
trigger->setFaction(14);
trigger->CastSpell(target, spell, true);
trigger->CastSpell(target, spell, true, 0, 0, target->GetGUID());
}
//trigger->setDeathState(JUST_DIED);
//trigger->RemoveCorpse();

View File

@@ -333,13 +333,26 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
damage = 200;
break;
}
// must only affect demons
// must only affect demons (also undead?)
case 45072:
{
if(unitTarget->GetCreatureType() != CREATURE_TYPE_DEMON)
if(unitTarget->GetCreatureType() != CREATURE_TYPE_DEMON
|| unitTarget->GetCreatureType() != CREATURE_TYPE_UNDEAD)
return;
break;
}
// gruul's shatter
case 33671:
{
// don't damage self and only players
if(unitTarget->GetGUID() == m_caster->GetGUID() || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[0]));
if(!radius) return;
float distance = m_caster->GetDistance2d(unitTarget);
damage = (distance > radius ) ? 0 : (int32)(m_spellInfo->EffectBasePoints[0]*((radius - distance)/radius));
}break;
}
break;
}
@@ -2637,6 +2650,7 @@ void Spell::EffectPersistentAA(uint32 i)
{
float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
Unit *caster = m_originalCasterGUID ? m_originalCaster : m_caster;
if(!caster) return;
if(Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius);