[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,10 +5144,9 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
{
switch(m_spellInfo->Id)
{
// Bending Shinbone
case 8856:
case 8856: // Bending Shinbone
{
if(!itemTarget && m_caster->GetTypeId()!=TYPEID_PLAYER)
if (!itemTarget && m_caster->GetTypeId()!=TYPEID_PLAYER)
return;
uint32 spell_id = 0;
@ -5160,36 +5159,33 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
m_caster->CastSpell(m_caster,spell_id,true,NULL);
return;
}
// Piccolo of the Flaming Fire
case 17512:
case 17512: // Piccolo of the Flaming Fire
{
if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
unitTarget->HandleEmoteCommand(EMOTE_STATE_DANCE);
return;
}
// Escape artist
case 20589:
case 20589: // Escape artist
{
if(!unitTarget)
if (!unitTarget)
return;
unitTarget->RemoveSpellsCausingAura(SPELL_AURA_MOD_ROOT);
unitTarget->RemoveSpellsCausingAura(SPELL_AURA_MOD_DECREASE_SPEED);
return;
}
// Brittle Armor - need remove one 24575 Brittle Armor aura
case 24590:
case 24590: // Brittle Armor - need remove one 24575 Brittle Armor aura
unitTarget->RemoveSingleSpellAurasFromStack(24575);
return;
// PX-238 Winter Wondervolt TRAP
case 26275:
case 26275: // PX-238 Winter Wondervolt TRAP
{
uint32 spells[4] = { 26272, 26157, 26273, 26274 };
// check presence
for(int j = 0; j < 4; ++j)
if(unitTarget->HasAura(spells[j], EFFECT_INDEX_0))
if (unitTarget->HasAura(spells[j], EFFECT_INDEX_0))
return;
// select spell
@ -5199,12 +5195,10 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
unitTarget->CastSpell(unitTarget, iTmpSpellId, true);
return;
}
// Mercurial Shield - need remove one 26464 Mercurial Shield aura
case 26465:
case 26465: // Mercurial Shield - need remove one 26464 Mercurial Shield aura
unitTarget->RemoveSingleSpellAurasFromStack(26464);
return;
// Orb teleport spells
case 25140:
case 25140: // Orb teleport spells
case 25143:
case 25650:
case 25652:
@ -5213,7 +5207,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
case 35376:
case 35727:
{
if(!unitTarget)
if (!unitTarget)
return;
uint32 spellid;
@ -5234,9 +5228,8 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
unitTarget->CastSpell(unitTarget,spellid,false);
return;
}
// Shadow Flame (All script effects, not just end ones to prevent player from dodging the last triggered spell)
case 22539:
case 22972:
case 22539: // Shadow Flame (All script effects, not just end ones to
case 22972: // prevent player from dodging the last triggered spell)
case 22975:
case 22976:
case 22977:
@ -5249,21 +5242,20 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
case 22984:
case 22985:
{
if(!unitTarget || !unitTarget->isAlive())
if (!unitTarget || !unitTarget->isAlive())
return;
// Onyxia Scale Cloak
if(unitTarget->GetDummyAura(22683))
if (unitTarget->GetDummyAura(22683))
return;
// Shadow Flame
m_caster->CastSpell(unitTarget, 22682, true);
return;
}
// Summon Black Qiraji Battle Tank
case 26656:
case 26656: // Summon Black Qiraji Battle Tank
{
if(!unitTarget)
if (!unitTarget)
return;
// Prevent stacking of mounts
@ -5274,10 +5266,10 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
unitTarget->CastSpell(unitTarget, 25863, false);
else
unitTarget->CastSpell(unitTarget, 26655, false);
return;
}
// Mirren's Drinking Hat
case 29830:
case 29830: // Mirren's Drinking Hat
{
uint32 item = 0;
switch ( urand(1, 6) )
@ -5292,41 +5284,40 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
case 6:
item = 23586; break; // Aerie Peak Pale Ale
}
if (item)
DoCreateItem(eff_idx,item);
break;
}
// Improved Sprint
case 30918:
case 30918: // Improved Sprint
{
if(!unitTarget)
if (!unitTarget)
return;
// Removes snares and roots.
unitTarget->RemoveAurasAtMechanicImmunity(IMMUNE_TO_ROOT_AND_SNARE_MASK,30918,true);
break;
}
// Flame Crash
case 41126:
case 41126: // Flame Crash
{
if(!unitTarget)
if (!unitTarget)
return;
unitTarget->CastSpell(unitTarget, 41131, true);
break;
}
// Force Cast - Portal Effect: Sunwell Isle
case 44876:
case 44876: // Force Cast - Portal Effect: Sunwell Isle
{
if(!unitTarget)
if (!unitTarget)
return;
unitTarget->CastSpell(unitTarget, 44870, true);
break;
}
// Goblin Weather Machine
case 46203:
case 46203: // Goblin Weather Machine
{
if(!unitTarget)
if (!unitTarget)
return;
uint32 spellId = 0;
@ -5340,18 +5331,15 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
unitTarget->CastSpell(unitTarget, spellId, true);
break;
}
//5,000 Gold
case 46642:
case 46642: //5,000 Gold
{
if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
((Player*)unitTarget)->ModifyMoney(50000000);
break;
}
// Surge Needle Teleporter
case 47097:
case 47097: // Surge Needle Teleporter
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
@ -5363,41 +5351,38 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
break;
}
// High Executor's Branding Iron
case 48603:
case 48603: // High Executor's Branding Iron
// Torture the Torturer: High Executor's Branding Iron Impact
unitTarget->CastSpell(unitTarget, 48614, true);
return;
// Emblazon Runeblade
case 51770:
case 51770: // Emblazon Runeblade
{
Unit* caster = GetAffectiveCaster();
if(!caster)
if (!caster)
return;
caster->CastSpell(caster, damage, false);
break;
}
// Death Gate
case 52751:
case 52751: // Death Gate
{
if(!unitTarget || unitTarget->getClass() != CLASS_DEATH_KNIGHT)
if (!unitTarget || unitTarget->getClass() != CLASS_DEATH_KNIGHT)
return;
// triggered spell is stored in m_spellInfo->EffectBasePoints[0]
unitTarget->CastSpell(unitTarget, damage, false);
break;
}
// Winged Steed of the Ebon Blade
case 54729:
case 54729: // Winged Steed of the Ebon Blade
{
if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
// Prevent stacking of mounts
unitTarget->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
// Triggered spell id dependent of riding skill
if(uint16 skillval = ((Player*)unitTarget)->GetSkillValue(SKILL_RIDING))
if (uint16 skillval = ((Player*)unitTarget)->GetSkillValue(SKILL_RIDING))
{
if (skillval >= 300)
unitTarget->CastSpell(unitTarget, 54727, true);
@ -5406,10 +5391,9 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
}
return;
}
// Demonic Empowerment (succubus Vanish effect)
case 54436:
case 54436: // Demonic Empowerment (succubus Vanish effect)
{
if(!unitTarget)
if (!unitTarget)
return;
unitTarget->RemoveSpellsCausingAura(SPELL_AURA_MOD_ROOT);
@ -5419,14 +5403,17 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
return;
}
case 55693: // Remove Collapsing Cave Aura
if(!unitTarget)
{
if (!unitTarget)
return;
unitTarget->RemoveAurasDueToSpell(m_spellInfo->CalculateSimpleValue(eff_idx));
break;
}
case 58418: // Portal to Orgrimmar
case 58420: // Portal to Stormwind
{
if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || eff_idx != EFFECT_INDEX_0)
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || eff_idx != EFFECT_INDEX_0)
return;
uint32 spellID = m_spellInfo->CalculateSimpleValue(EFFECT_INDEX_0);
@ -5438,6 +5425,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
return;
}
case 59317: // Teleporting
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
@ -5449,24 +5437,25 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
unitTarget->CastSpell(unitTarget, 59314, true);
return;
// random spell learn instead placeholder
} // random spell learn instead placeholder
case 60893: // Northrend Alchemy Research
case 61177: // Northrend Inscription Research
case 61288: // Minor Inscription Research
case 61756: // Northrend Inscription Research (FAST QA VERSION)
case 64323: // Book of Glyph Mastery
{
if(m_caster->GetTypeId() != TYPEID_PLAYER)
if (m_caster->GetTypeId() != TYPEID_PLAYER)
return;
// 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);
return;
}
case 69377: //Fortitude
{
if(!unitTarget)
if (!unitTarget)
return;
m_caster->CastSpell(unitTarget, 72590, true);
@ -5474,7 +5463,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
}
case 69378: //Blessing of Forgotten Kings
{
if(!unitTarget)
if (!unitTarget)
return;
m_caster->CastSpell(unitTarget, 72586, true);
@ -5482,7 +5471,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
}
case 69381: //Gift of the Wild
{
if(!unitTarget)
if (!unitTarget)
return;
m_caster->CastSpell(unitTarget, 72588, true);
@ -5495,8 +5484,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
{
switch(m_spellInfo->Id)
{
// Healthstone creating spells
case 6201:
case 6201: // Healthstone creating spells
case 6202:
case 5699:
case 11729:
@ -5505,26 +5493,28 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
case 47871:
case 47878:
{
if(!unitTarget)
if (!unitTarget)
return;
uint32 itemtype;
uint32 rank = 0;
Unit::AuraList const& mDummyAuras = unitTarget->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
{
if((*i)->GetId() == 18692)
if ((*i)->GetId() == 18692)
{
rank = 1;
break;
}
else if((*i)->GetId() == 18693)
else if ((*i)->GetId() == 18693)
{
rank = 2;
break;
}
}
static uint32 const itypes[8][3] = {
static uint32 const itypes[8][3] =
{
{ 5512, 19004, 19005}, // Minor Healthstone
{ 5511, 19006, 19007}, // Lesser Healthstone
{ 5509, 19008, 19009}, // Healthstone
@ -5559,11 +5549,11 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
DoCreateItem( eff_idx, itemtype );
return;
}
// Demonic Empowerment
case 47193:
case 47193: // Demonic Empowerment
{
if(!unitTarget)
if (!unitTarget)
return;
uint32 entry = unitTarget->GetEntry();
uint32 spellID;
switch(entry)
@ -5579,8 +5569,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
unitTarget->CastSpell(unitTarget,spellID,true);
return;
}
// Everlasting Affliction
case 47422:
case 47422: // Everlasting Affliction
{
// Need refresh caster corruption auras on target
Unit::AuraMap& suAuras = unitTarget->GetAuras();
@ -5594,12 +5583,12 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
}
return;
}
// Guarded by The Light (Paladin spell with SPELLFAMILY_WARLOCK)
case 63521:
case 63521: // Guarded by The Light (Paladin spell with SPELLFAMILY_WARLOCK)
{
// Divine Plea, refresh on target (3 aura slots)
if (Aura* aura = unitTarget->GetAura(54428, EFFECT_INDEX_0))
aura->RefreshAura();
return;
}
}
@ -5609,11 +5598,11 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
{
switch(m_spellInfo->Id)
{
// Pain and Suffering
case 47948:
case 47948: // Pain and Suffering
{
if (!unitTarget)
return;
// Refresh Shadow Word: Pain on target
Unit::AuraMap& auras = unitTarget->GetAuras();
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)
{
// Chimera Shot
case 53209:
case 53209: // Chimera Shot
{
if(!unitTarget)
if (!unitTarget)
return;
uint32 spellId = 0;
int32 basePoint = 0;
Unit* target = unitTarget;
@ -5652,10 +5641,12 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
Aura *aura = (*i).second;
if (aura->GetCasterGUID() != m_caster->GetGUID())
continue;
// Search only Serpent Sting, Viper Sting, Scorpid Sting auras
uint64 familyFlag = aura->GetSpellProto()->SpellFamilyFlags;
if (!(familyFlag & UI64LIT(0x000000800000C000)))
continue;
// Refresh aura duration
aura->RefreshAura();
@ -5666,6 +5657,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
basePoint = aura->GetModifier()->m_amount * 5 * 40 / 100;
spellId = 53353; // Chimera Shot - Serpent
}
// 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)
{
@ -5688,6 +5680,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
spellId = 53358; // Chimera Shot - Viper
target = m_caster;
}
// Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute.
if (familyFlag & UI64LIT(0x0000000000008000))
spellId = 53359; // Chimera Shot - Scorpid
@ -5698,8 +5691,10 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
// spellId = 53366; // 53366 Chimera Shot - Wyvern
//}
}
if (spellId)
m_caster->CastCustomSpell(target, spellId, &basePoint, 0, 0, false);
return;
}
case 53412: // Invigoration (pet triggered script, master targeted)
@ -5722,8 +5717,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
}
return;
}
// Master's Call
case 53271:
case 53271: // Master's Call
{
if (!unitTarget)
return;
@ -5742,8 +5736,9 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
// Judgement (seal trigger)
if (m_spellInfo->Category == SPELLCATEGORY_JUDGEMENT)
{
if(!unitTarget || !unitTarget->isAlive())
if (!unitTarget || !unitTarget->isAlive())
return;
uint32 spellId1 = 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);
return;
}
// offensive seals have aura dummy in 2 effect
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)
@ -5771,6 +5767,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
continue;
break;
}
// if there were no offensive seals than there is seal with proc trigger aura
if (!spellId2)
{
@ -5783,10 +5780,13 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
break;
}
}
if (spellId1)
m_caster->CastSpell(unitTarget, spellId1, true);
if (spellId2)
m_caster->CastSpell(unitTarget, spellId2, true);
return;
}
}
@ -5794,21 +5794,21 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
{
switch(m_spellInfo->Id)
{
// Dreaming Glory
case 28698:
case 28698: // Dreaming Glory
{
if(!unitTarget)
if (!unitTarget)
return;
unitTarget->CastSpell(unitTarget, 28694, true);
break;
}
// Netherbloom
case 28702:
case 28702: // Netherbloom
{
if(!unitTarget)
if (!unitTarget)
return;
// 25% chance of casting a random buff
if(roll_chance_i(75))
if (roll_chance_i(75))
return;
// triggered spells are 28703 to 28707
@ -5820,18 +5820,19 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
for(uint8 i = 0; i < 5; ++i)
if (unitTarget->HasAura(spellid + i, EFFECT_INDEX_0))
return;
unitTarget->CastSpell(unitTarget, spellid+urand(0, 4), true);
break;
}
// Nightmare Vine
case 28720:
case 28720: // Nightmare Vine
{
if(!unitTarget)
if (!unitTarget)
return;
// 25% chance of casting Nightmare Pollen
if(roll_chance_i(75))
if (roll_chance_i(75))
return;
unitTarget->CastSpell(unitTarget, 28721, true);
break;
}
@ -5842,26 +5843,25 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
{
switch(m_spellInfo->Id)
{
// Pestilence
case 50842:
case 50842: // Pestilence
{
if(!unitTarget)
if (!unitTarget)
return;
Unit* mainTarget = m_targets.getUnitTarget();
if(!mainTarget)
if (!mainTarget)
return;
// do only refresh diseases on main target if caster has Glyph of Disease
if(mainTarget == unitTarget && !m_caster->HasAura(63334))
if (mainTarget == unitTarget && !m_caster->HasAura(63334))
return;
// Blood Plague
if(mainTarget->HasAura(55078))
if (mainTarget->HasAura(55078))
m_caster->CastSpell(unitTarget, 55078, true);
// Frost Fever
if(mainTarget->HasAura(55095))
if (mainTarget->HasAura(55095))
m_caster->CastSpell(unitTarget, 55095, true);
break;
@ -5872,7 +5872,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
}
// normal DB scripted effect
if(!unitTarget)
if (!unitTarget)
return;
sLog.outDebug("Spell ScriptStart spellid %u in EffectScriptEffect ", m_spellInfo->Id);

View file

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