*Remove hack for Divine Storm from Unit::DealDamage

*"Zip" some data in SpellMgr::LoadSpellCustomAttr
*Add MaxAffectedTargets for Divine storm heal effect
*Move Divine Storm to correct spellfamily switch-case block in Spell::EffectDummy
*Some ordering fixes of case blocks in Spell::EffectDummy

--HG--
branch : trunk
This commit is contained in:
QAston
2010-07-16 14:42:24 +02:00
parent b406321c01
commit 7e8c61c95a
3 changed files with 54 additions and 90 deletions
-17
View File
@@ -562,23 +562,6 @@ void Unit::DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb)
uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellEntry const *spellProto, bool durabilityLoss)
{
// if attacker is a player and spell is not empty/fail
if (GetTypeId() == TYPEID_PLAYER && spellProto)
{
// on divine storm dealed damage - heal
if (spellProto->SpellFamilyName == SPELLFAMILY_PALADIN && spellProto->SpellFamilyFlags[1] & 0x20000)
{
Unit *pRaidGrpMember = GetNextRandomRaidMemberOrPet(30.0f);
int32 divineDmg = damage * (25 + (HasAura(63220) ? 15 : 0)) / 100; //25%, if has Glyph of Divine Storm -> 40%
if (!pRaidGrpMember)
pRaidGrpMember = this;
CastCustomSpell(pRaidGrpMember, 54172, &divineDmg, 0, 0, true);
}
}
if (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsAIEnabled)
pVictim->ToCreature()->AI()->DamageTaken(this, damage);
+46 -45
View File
@@ -786,33 +786,6 @@ void Spell::EffectDummy(uint32 i)
{
switch (m_spellInfo->Id)
{
// Magic Pull
case 51336:
m_caster->CastSpell(unitTarget,50770,true);
break;
// Wrath of the Astromancer
case 42784:
{
uint32 count = 0;
for (std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
if (ihit->effectMask & (1<<i))
++count;
damage = 12000; // maybe wrong value
damage /= count;
SpellEntry const *spellInfo = sSpellStore.LookupEntry(42784);
// now deal the damage
for (std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
if (ihit->effectMask & (1<<i))
{
if (Unit* casttarget = Unit::GetUnit((*unitTarget), ihit->targetGUID))
m_caster->DealDamage(casttarget, damage, NULL, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, spellInfo, false);
}
return;
}
case 8063: // Deviate Fish
{
if (m_caster->GetTypeId() != TYPEID_PLAYER)
@@ -1163,6 +1136,20 @@ void Spell::EffectDummy(uint32 i)
m_caster->CastSpell(m_caster, spell_id, true, NULL);
return;
}
case 34665: //Administer Antidote
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT
|| unitTarget->GetEntry() != 16880 || unitTarget->ToCreature()->isPet())
return;
unitTarget->ToCreature()->UpdateEntry(16992);
m_caster->ToPlayer()->RewardPlayerAndGroupAtEvent(16992, unitTarget);
if (unitTarget->IsAIEnabled)
unitTarget->ToCreature()->AI()->AttackStart(m_caster);
return;
}
case 35745: // Socrethar's Stone
{
uint32 spell_id;
@@ -1223,6 +1210,29 @@ void Spell::EffectDummy(uint32 i)
DoCreateItem(i, newitemid);
return;
}
// Wrath of the Astromancer
case 42784:
{
uint32 count = 0;
for (std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
if (ihit->effectMask & (1<<i))
++count;
damage = 12000; // maybe wrong value
damage /= count;
SpellEntry const *spellInfo = sSpellStore.LookupEntry(42784);
// now deal the damage
for (std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
if (ihit->effectMask & (1<<i))
{
if (Unit* casttarget = Unit::GetUnit((*unitTarget), ihit->targetGUID))
m_caster->DealDamage(casttarget, damage, NULL, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, spellInfo, false);
}
return;
}
// Demon Broiled Surprise
case 43723:
{
@@ -1255,20 +1265,6 @@ void Spell::EffectDummy(uint32 i)
m_caster->CastSpell(m_caster, 42337, true, NULL);
return;
}
case 34665: //Administer Antidote
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT
|| unitTarget->GetEntry() != 16880 || unitTarget->ToCreature()->isPet())
return;
unitTarget->ToCreature()->UpdateEntry(16992);
m_caster->ToPlayer()->RewardPlayerAndGroupAtEvent(16992, unitTarget);
if (unitTarget->IsAIEnabled)
unitTarget->ToCreature()->AI()->AttackStart(m_caster);
return;
}
case 44997: // Converting Sentry
{
//Converted Sentry Credit
@@ -1327,6 +1323,10 @@ void Spell::EffectDummy(uint32 i)
m_caster->CastSpell(m_caster, 49378, true);
}
return;
// Magic Pull
case 51336:
m_caster->CastSpell(unitTarget,50770,true);
break;
case 52845: // Brewfest Mount Transformation (Faction Swap)
if (m_caster->GetTypeId() != TYPEID_PLAYER)
return;
@@ -1432,6 +1432,11 @@ void Spell::EffectDummy(uint32 i)
m_caster->CastSpell(m_caster, 54586, true);
return;
}
case 54171: //Divine Storm
{
m_caster->CastCustomSpell(unitTarget, 54172, &damage, 0, 0, true);
return;
}
case 58418: // Portal to Orgrimmar
case 58420: // Portal to Stormwind
return; // implemented in EffectScript[0]
@@ -1890,10 +1895,6 @@ void Spell::EffectDummy(uint32 i)
switch(m_spellInfo->Id)
{
case 54171: //Divine Storm
{
m_caster->CastCustomSpell(unitTarget, 54172, &damage, 0, 0, true);
}
case 20425: // Judgement of command
{
if (!unitTarget)
+8 -28
View File
@@ -3615,6 +3615,12 @@ void SpellMgr::LoadSpellCustomAttr()
case 39365: // Thundering Storm
case 41071: // Raise Dead (HACK)
case 52124: // Sky Darkener Assault
case 42442: // Vengeance Landing Cannonfire
case 45863: // Cosmetic - Incinerate to Random Target
case 25425: // Shoot
case 45761: // Shoot
case 42611: // Shoot
case 62374: // Pursued
spellInfo->MaxAffectedTargets = 1;
count++;
break;
@@ -3636,6 +3642,8 @@ void SpellMgr::LoadSpellCustomAttr()
case 54172: // Divine Storm (heal)
case 29213: // Curse of the Plaguebringer - Noth
case 28542: // Life Drain - Sapphiron
case 66588: // Flaming Spear
case 54171: // Divine Storm
spellInfo->MaxAffectedTargets = 3;
count++;
break;
@@ -3760,10 +3768,6 @@ void SpellMgr::LoadSpellCustomAttr()
spellInfo->rangeIndex = 13;
count++;
break;
case 62374: // Pursued
spellInfo->MaxAffectedTargets = 1;
count++;
break;
case 48743: // Death Pact
spellInfo->AttributesEx &= ~SPELL_ATTR_EX_CANT_TARGET_SELF;
count++;
@@ -3785,30 +3789,6 @@ void SpellMgr::LoadSpellCustomAttr()
spellInfo->EffectMiscValue[0] = MECHANIC_IMMUNE_SHIELD;
count++;
break;
case 42442: // Vengeance Landing Cannonfire
spellInfo->MaxAffectedTargets = 1;
count++;
break;
case 45863: // Cosmetic - Incinerate to Random Target
spellInfo->MaxAffectedTargets = 1;
count++;
break;
case 25425: // Shoot
spellInfo->MaxAffectedTargets = 1;
count++;
break;
case 45761: // Shoot
spellInfo->MaxAffectedTargets = 1;
count++;
break;
case 42611: // Shoot
spellInfo->MaxAffectedTargets = 1;
count++;
break;
case 66588: // Flaming Spear
spellInfo->MaxAffectedTargets = 3;
count++;
break;
case 53651:
spellInfo->AttributesEx3 |= SPELL_ATTR_EX3_NO_INITIAL_AGGRO;
count++;