[9424] Some code/comments cleanup in EffectScriptEffect

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-02-20 19:01:05 +01:00
parent 6c44c6f5a7
commit 8bb13412e5
2 changed files with 114 additions and 114 deletions

View file

@ -5144,8 +5144,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
{ {
switch(m_spellInfo->Id) switch(m_spellInfo->Id)
{ {
// Bending Shinbone case 8856: // Bending Shinbone
case 8856:
{ {
if (!itemTarget && m_caster->GetTypeId()!=TYPEID_PLAYER) if (!itemTarget && m_caster->GetTypeId()!=TYPEID_PLAYER)
return; return;
@ -5160,16 +5159,15 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
m_caster->CastSpell(m_caster,spell_id,true,NULL); m_caster->CastSpell(m_caster,spell_id,true,NULL);
return; return;
} }
// Piccolo of the Flaming Fire case 17512: // Piccolo of the Flaming Fire
case 17512:
{ {
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return; return;
unitTarget->HandleEmoteCommand(EMOTE_STATE_DANCE); unitTarget->HandleEmoteCommand(EMOTE_STATE_DANCE);
return; return;
} }
// Escape artist case 20589: // Escape artist
case 20589:
{ {
if (!unitTarget) if (!unitTarget)
return; return;
@ -5178,12 +5176,10 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
unitTarget->RemoveSpellsCausingAura(SPELL_AURA_MOD_DECREASE_SPEED); unitTarget->RemoveSpellsCausingAura(SPELL_AURA_MOD_DECREASE_SPEED);
return; return;
} }
// Brittle Armor - need remove one 24575 Brittle Armor aura case 24590: // Brittle Armor - need remove one 24575 Brittle Armor aura
case 24590:
unitTarget->RemoveSingleSpellAurasFromStack(24575); unitTarget->RemoveSingleSpellAurasFromStack(24575);
return; return;
// PX-238 Winter Wondervolt TRAP case 26275: // PX-238 Winter Wondervolt TRAP
case 26275:
{ {
uint32 spells[4] = { 26272, 26157, 26273, 26274 }; uint32 spells[4] = { 26272, 26157, 26273, 26274 };
@ -5199,12 +5195,10 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
unitTarget->CastSpell(unitTarget, iTmpSpellId, true); unitTarget->CastSpell(unitTarget, iTmpSpellId, true);
return; return;
} }
// Mercurial Shield - need remove one 26464 Mercurial Shield aura case 26465: // Mercurial Shield - need remove one 26464 Mercurial Shield aura
case 26465:
unitTarget->RemoveSingleSpellAurasFromStack(26464); unitTarget->RemoveSingleSpellAurasFromStack(26464);
return; return;
// Orb teleport spells case 25140: // Orb teleport spells
case 25140:
case 25143: case 25143:
case 25650: case 25650:
case 25652: case 25652:
@ -5234,9 +5228,8 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
unitTarget->CastSpell(unitTarget,spellid,false); unitTarget->CastSpell(unitTarget,spellid,false);
return; return;
} }
// Shadow Flame (All script effects, not just end ones to prevent player from dodging the last triggered spell) case 22539: // Shadow Flame (All script effects, not just end ones to
case 22539: case 22972: // prevent player from dodging the last triggered spell)
case 22972:
case 22975: case 22975:
case 22976: case 22976:
case 22977: case 22977:
@ -5260,8 +5253,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
m_caster->CastSpell(unitTarget, 22682, true); m_caster->CastSpell(unitTarget, 22682, true);
return; return;
} }
// Summon Black Qiraji Battle Tank case 26656: // Summon Black Qiraji Battle Tank
case 26656:
{ {
if (!unitTarget) if (!unitTarget)
return; return;
@ -5274,10 +5266,10 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
unitTarget->CastSpell(unitTarget, 25863, false); unitTarget->CastSpell(unitTarget, 25863, false);
else else
unitTarget->CastSpell(unitTarget, 26655, false); unitTarget->CastSpell(unitTarget, 26655, false);
return; return;
} }
// Mirren's Drinking Hat case 29830: // Mirren's Drinking Hat
case 29830:
{ {
uint32 item = 0; uint32 item = 0;
switch ( urand(1, 6) ) switch ( urand(1, 6) )
@ -5292,21 +5284,22 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
case 6: case 6:
item = 23586; break; // Aerie Peak Pale Ale item = 23586; break; // Aerie Peak Pale Ale
} }
if (item) if (item)
DoCreateItem(eff_idx,item); DoCreateItem(eff_idx,item);
break; break;
} }
// Improved Sprint case 30918: // Improved Sprint
case 30918:
{ {
if (!unitTarget) if (!unitTarget)
return; return;
// Removes snares and roots. // Removes snares and roots.
unitTarget->RemoveAurasAtMechanicImmunity(IMMUNE_TO_ROOT_AND_SNARE_MASK,30918,true); unitTarget->RemoveAurasAtMechanicImmunity(IMMUNE_TO_ROOT_AND_SNARE_MASK,30918,true);
break; break;
} }
// Flame Crash case 41126: // Flame Crash
case 41126:
{ {
if (!unitTarget) if (!unitTarget)
return; return;
@ -5314,8 +5307,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
unitTarget->CastSpell(unitTarget, 41131, true); unitTarget->CastSpell(unitTarget, 41131, true);
break; break;
} }
// Force Cast - Portal Effect: Sunwell Isle case 44876: // Force Cast - Portal Effect: Sunwell Isle
case 44876:
{ {
if (!unitTarget) if (!unitTarget)
return; return;
@ -5323,8 +5315,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
unitTarget->CastSpell(unitTarget, 44870, true); unitTarget->CastSpell(unitTarget, 44870, true);
break; break;
} }
// Goblin Weather Machine case 46203: // Goblin Weather Machine
case 46203:
{ {
if (!unitTarget) if (!unitTarget)
return; return;
@ -5340,18 +5331,15 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
unitTarget->CastSpell(unitTarget, spellId, true); unitTarget->CastSpell(unitTarget, spellId, true);
break; break;
} }
//5,000 Gold case 46642: //5,000 Gold
case 46642:
{ {
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return; return;
((Player*)unitTarget)->ModifyMoney(50000000); ((Player*)unitTarget)->ModifyMoney(50000000);
break; break;
} }
// Surge Needle Teleporter case 47097: // Surge Needle Teleporter
case 47097:
{ {
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return; return;
@ -5363,13 +5351,11 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
break; break;
} }
// High Executor's Branding Iron case 48603: // High Executor's Branding Iron
case 48603:
// Torture the Torturer: High Executor's Branding Iron Impact // Torture the Torturer: High Executor's Branding Iron Impact
unitTarget->CastSpell(unitTarget, 48614, true); unitTarget->CastSpell(unitTarget, 48614, true);
return; return;
// Emblazon Runeblade case 51770: // Emblazon Runeblade
case 51770:
{ {
Unit* caster = GetAffectiveCaster(); Unit* caster = GetAffectiveCaster();
if (!caster) if (!caster)
@ -5378,17 +5364,16 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
caster->CastSpell(caster, damage, false); caster->CastSpell(caster, damage, false);
break; break;
} }
// Death Gate case 52751: // Death Gate
case 52751:
{ {
if (!unitTarget || unitTarget->getClass() != CLASS_DEATH_KNIGHT) if (!unitTarget || unitTarget->getClass() != CLASS_DEATH_KNIGHT)
return; return;
// triggered spell is stored in m_spellInfo->EffectBasePoints[0] // triggered spell is stored in m_spellInfo->EffectBasePoints[0]
unitTarget->CastSpell(unitTarget, damage, false); unitTarget->CastSpell(unitTarget, damage, false);
break; break;
} }
// Winged Steed of the Ebon Blade case 54729: // Winged Steed of the Ebon Blade
case 54729:
{ {
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return; return;
@ -5406,8 +5391,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
} }
return; return;
} }
// Demonic Empowerment (succubus Vanish effect) case 54436: // Demonic Empowerment (succubus Vanish effect)
case 54436:
{ {
if (!unitTarget) if (!unitTarget)
return; return;
@ -5419,10 +5403,13 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
return; return;
} }
case 55693: // Remove Collapsing Cave Aura case 55693: // Remove Collapsing Cave Aura
{
if (!unitTarget) if (!unitTarget)
return; return;
unitTarget->RemoveAurasDueToSpell(m_spellInfo->CalculateSimpleValue(eff_idx)); unitTarget->RemoveAurasDueToSpell(m_spellInfo->CalculateSimpleValue(eff_idx));
break; break;
}
case 58418: // Portal to Orgrimmar case 58418: // Portal to Orgrimmar
case 58420: // Portal to Stormwind case 58420: // Portal to Stormwind
{ {
@ -5438,6 +5425,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
return; return;
} }
case 59317: // Teleporting case 59317: // Teleporting
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return; return;
@ -5449,7 +5437,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
unitTarget->CastSpell(unitTarget, 59314, true); unitTarget->CastSpell(unitTarget, 59314, true);
return; return;
// random spell learn instead placeholder } // random spell learn instead placeholder
case 60893: // Northrend Alchemy Research case 60893: // Northrend Alchemy Research
case 61177: // Northrend Inscription Research case 61177: // Northrend Inscription Research
case 61288: // Minor Inscription Research case 61288: // Minor Inscription Research
@ -5462,6 +5450,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
// learn random explicit discovery recipe (if any) // learn random explicit discovery recipe (if any)
if (uint32 discoveredSpell = GetExplicitDiscoverySpell(m_spellInfo->Id, (Player*)m_caster)) if (uint32 discoveredSpell = GetExplicitDiscoverySpell(m_spellInfo->Id, (Player*)m_caster))
((Player*)m_caster)->learnSpell(discoveredSpell, false); ((Player*)m_caster)->learnSpell(discoveredSpell, false);
return; return;
} }
case 69377: //Fortitude case 69377: //Fortitude
@ -5495,8 +5484,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
{ {
switch(m_spellInfo->Id) switch(m_spellInfo->Id)
{ {
// Healthstone creating spells case 6201: // Healthstone creating spells
case 6201:
case 6202: case 6202:
case 5699: case 5699:
case 11729: case 11729:
@ -5507,6 +5495,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
{ {
if (!unitTarget) if (!unitTarget)
return; return;
uint32 itemtype; uint32 itemtype;
uint32 rank = 0; uint32 rank = 0;
Unit::AuraList const& mDummyAuras = unitTarget->GetAurasByType(SPELL_AURA_DUMMY); Unit::AuraList const& mDummyAuras = unitTarget->GetAurasByType(SPELL_AURA_DUMMY);
@ -5524,7 +5513,8 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
} }
} }
static uint32 const itypes[8][3] = { static uint32 const itypes[8][3] =
{
{ 5512, 19004, 19005}, // Minor Healthstone { 5512, 19004, 19005}, // Minor Healthstone
{ 5511, 19006, 19007}, // Lesser Healthstone { 5511, 19006, 19007}, // Lesser Healthstone
{ 5509, 19008, 19009}, // Healthstone { 5509, 19008, 19009}, // Healthstone
@ -5559,11 +5549,11 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
DoCreateItem( eff_idx, itemtype ); DoCreateItem( eff_idx, itemtype );
return; return;
} }
// Demonic Empowerment case 47193: // Demonic Empowerment
case 47193:
{ {
if (!unitTarget) if (!unitTarget)
return; return;
uint32 entry = unitTarget->GetEntry(); uint32 entry = unitTarget->GetEntry();
uint32 spellID; uint32 spellID;
switch(entry) switch(entry)
@ -5579,8 +5569,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
unitTarget->CastSpell(unitTarget,spellID,true); unitTarget->CastSpell(unitTarget,spellID,true);
return; return;
} }
// Everlasting Affliction case 47422: // Everlasting Affliction
case 47422:
{ {
// Need refresh caster corruption auras on target // Need refresh caster corruption auras on target
Unit::AuraMap& suAuras = unitTarget->GetAuras(); Unit::AuraMap& suAuras = unitTarget->GetAuras();
@ -5594,12 +5583,12 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
} }
return; return;
} }
// Guarded by The Light (Paladin spell with SPELLFAMILY_WARLOCK) case 63521: // Guarded by The Light (Paladin spell with SPELLFAMILY_WARLOCK)
case 63521:
{ {
// Divine Plea, refresh on target (3 aura slots) // Divine Plea, refresh on target (3 aura slots)
if (Aura* aura = unitTarget->GetAura(54428, EFFECT_INDEX_0)) if (Aura* aura = unitTarget->GetAura(54428, EFFECT_INDEX_0))
aura->RefreshAura(); aura->RefreshAura();
return; return;
} }
} }
@ -5609,11 +5598,11 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
{ {
switch(m_spellInfo->Id) switch(m_spellInfo->Id)
{ {
// Pain and Suffering case 47948: // Pain and Suffering
case 47948:
{ {
if (!unitTarget) if (!unitTarget)
return; return;
// Refresh Shadow Word: Pain on target // Refresh Shadow Word: Pain on target
Unit::AuraMap& auras = unitTarget->GetAuras(); Unit::AuraMap& auras = unitTarget->GetAuras();
for(Unit::AuraMap::iterator itr = auras.begin(); itr != auras.end(); ++itr) for(Unit::AuraMap::iterator itr = auras.begin(); itr != auras.end(); ++itr)
@ -5638,11 +5627,11 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
{ {
switch(m_spellInfo->Id) switch(m_spellInfo->Id)
{ {
// Chimera Shot case 53209: // Chimera Shot
case 53209:
{ {
if (!unitTarget) if (!unitTarget)
return; return;
uint32 spellId = 0; uint32 spellId = 0;
int32 basePoint = 0; int32 basePoint = 0;
Unit* target = unitTarget; Unit* target = unitTarget;
@ -5652,10 +5641,12 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
Aura *aura = (*i).second; Aura *aura = (*i).second;
if (aura->GetCasterGUID() != m_caster->GetGUID()) if (aura->GetCasterGUID() != m_caster->GetGUID())
continue; continue;
// Search only Serpent Sting, Viper Sting, Scorpid Sting auras // Search only Serpent Sting, Viper Sting, Scorpid Sting auras
uint64 familyFlag = aura->GetSpellProto()->SpellFamilyFlags; uint64 familyFlag = aura->GetSpellProto()->SpellFamilyFlags;
if (!(familyFlag & UI64LIT(0x000000800000C000))) if (!(familyFlag & UI64LIT(0x000000800000C000)))
continue; continue;
// Refresh aura duration // Refresh aura duration
aura->RefreshAura(); aura->RefreshAura();
@ -5666,6 +5657,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
basePoint = aura->GetModifier()->m_amount * 5 * 40 / 100; basePoint = aura->GetModifier()->m_amount * 5 * 40 / 100;
spellId = 53353; // Chimera Shot - Serpent spellId = 53353; // Chimera Shot - Serpent
} }
// Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting. // Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting.
if ((familyFlag & UI64LIT(0x0000008000000000)) && aura->GetEffIndex() == EFFECT_INDEX_0) if ((familyFlag & UI64LIT(0x0000008000000000)) && aura->GetEffIndex() == EFFECT_INDEX_0)
{ {
@ -5688,6 +5680,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
spellId = 53358; // Chimera Shot - Viper spellId = 53358; // Chimera Shot - Viper
target = m_caster; target = m_caster;
} }
// Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute. // Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute.
if (familyFlag & UI64LIT(0x0000000000008000)) if (familyFlag & UI64LIT(0x0000000000008000))
spellId = 53359; // Chimera Shot - Scorpid spellId = 53359; // Chimera Shot - Scorpid
@ -5698,8 +5691,10 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
// spellId = 53366; // 53366 Chimera Shot - Wyvern // spellId = 53366; // 53366 Chimera Shot - Wyvern
//} //}
} }
if (spellId) if (spellId)
m_caster->CastCustomSpell(target, spellId, &basePoint, 0, 0, false); m_caster->CastCustomSpell(target, spellId, &basePoint, 0, 0, false);
return; return;
} }
case 53412: // Invigoration (pet triggered script, master targeted) case 53412: // Invigoration (pet triggered script, master targeted)
@ -5722,8 +5717,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
} }
return; return;
} }
// Master's Call case 53271: // Master's Call
case 53271:
{ {
if (!unitTarget) if (!unitTarget)
return; return;
@ -5744,6 +5738,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
{ {
if (!unitTarget || !unitTarget->isAlive()) if (!unitTarget || !unitTarget->isAlive())
return; return;
uint32 spellId1 = 0; uint32 spellId1 = 0;
uint32 spellId2 = 0; uint32 spellId2 = 0;
@ -5758,6 +5753,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
sLog.outError("Unsupported Judgement (seal trigger) spell (Id: %u) in Spell::EffectScriptEffect",m_spellInfo->Id); sLog.outError("Unsupported Judgement (seal trigger) spell (Id: %u) in Spell::EffectScriptEffect",m_spellInfo->Id);
return; return;
} }
// offensive seals have aura dummy in 2 effect // offensive seals have aura dummy in 2 effect
Unit::AuraList const& m_dummyAuras = m_caster->GetAurasByType(SPELL_AURA_DUMMY); Unit::AuraList const& m_dummyAuras = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator itr = m_dummyAuras.begin(); itr != m_dummyAuras.end(); ++itr) for(Unit::AuraList::const_iterator itr = m_dummyAuras.begin(); itr != m_dummyAuras.end(); ++itr)
@ -5771,6 +5767,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
continue; continue;
break; break;
} }
// if there were no offensive seals than there is seal with proc trigger aura // if there were no offensive seals than there is seal with proc trigger aura
if (!spellId2) if (!spellId2)
{ {
@ -5783,10 +5780,13 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
break; break;
} }
} }
if (spellId1) if (spellId1)
m_caster->CastSpell(unitTarget, spellId1, true); m_caster->CastSpell(unitTarget, spellId1, true);
if (spellId2) if (spellId2)
m_caster->CastSpell(unitTarget, spellId2, true); m_caster->CastSpell(unitTarget, spellId2, true);
return; return;
} }
} }
@ -5794,19 +5794,19 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
{ {
switch(m_spellInfo->Id) switch(m_spellInfo->Id)
{ {
// Dreaming Glory case 28698: // Dreaming Glory
case 28698:
{ {
if (!unitTarget) if (!unitTarget)
return; return;
unitTarget->CastSpell(unitTarget, 28694, true); unitTarget->CastSpell(unitTarget, 28694, true);
break; break;
} }
// Netherbloom case 28702: // Netherbloom
case 28702:
{ {
if (!unitTarget) if (!unitTarget)
return; return;
// 25% chance of casting a random buff // 25% chance of casting a random buff
if (roll_chance_i(75)) if (roll_chance_i(75))
return; return;
@ -5820,18 +5820,19 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
for(uint8 i = 0; i < 5; ++i) for(uint8 i = 0; i < 5; ++i)
if (unitTarget->HasAura(spellid + i, EFFECT_INDEX_0)) if (unitTarget->HasAura(spellid + i, EFFECT_INDEX_0))
return; return;
unitTarget->CastSpell(unitTarget, spellid+urand(0, 4), true); unitTarget->CastSpell(unitTarget, spellid+urand(0, 4), true);
break; break;
} }
case 28720: // Nightmare Vine
// Nightmare Vine
case 28720:
{ {
if (!unitTarget) if (!unitTarget)
return; return;
// 25% chance of casting Nightmare Pollen // 25% chance of casting Nightmare Pollen
if (roll_chance_i(75)) if (roll_chance_i(75))
return; return;
unitTarget->CastSpell(unitTarget, 28721, true); unitTarget->CastSpell(unitTarget, 28721, true);
break; break;
} }
@ -5842,8 +5843,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
{ {
switch(m_spellInfo->Id) switch(m_spellInfo->Id)
{ {
// Pestilence case 50842: // Pestilence
case 50842:
{ {
if (!unitTarget) if (!unitTarget)
return; return;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9423" #define REVISION_NR "9424"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__