mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[9424] Some code/comments cleanup in EffectScriptEffect
Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
6c44c6f5a7
commit
8bb13412e5
2 changed files with 114 additions and 114 deletions
|
|
@ -5144,8 +5144,7 @@ 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)
|
||||
return;
|
||||
|
|
@ -5160,16 +5159,15 @@ 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)
|
||||
return;
|
||||
|
||||
unitTarget->HandleEmoteCommand(EMOTE_STATE_DANCE);
|
||||
return;
|
||||
}
|
||||
// Escape artist
|
||||
case 20589:
|
||||
case 20589: // Escape artist
|
||||
{
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
|
@ -5178,12 +5176,10 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
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 };
|
||||
|
||||
|
|
@ -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:
|
||||
|
|
@ -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:
|
||||
|
|
@ -5260,8 +5253,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
m_caster->CastSpell(unitTarget, 22682, true);
|
||||
return;
|
||||
}
|
||||
// Summon Black Qiraji Battle Tank
|
||||
case 26656:
|
||||
case 26656: // Summon Black Qiraji Battle Tank
|
||||
{
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
|
@ -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,21 +5284,22 @@ 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)
|
||||
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)
|
||||
return;
|
||||
|
|
@ -5314,8 +5307,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
unitTarget->CastSpell(unitTarget, 41131, true);
|
||||
break;
|
||||
}
|
||||
// Force Cast - Portal Effect: Sunwell Isle
|
||||
case 44876:
|
||||
case 44876: // Force Cast - Portal Effect: Sunwell Isle
|
||||
{
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
|
@ -5323,8 +5315,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
unitTarget->CastSpell(unitTarget, 44870, true);
|
||||
break;
|
||||
}
|
||||
// Goblin Weather Machine
|
||||
case 46203:
|
||||
case 46203: // Goblin Weather Machine
|
||||
{
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
|
@ -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)
|
||||
return;
|
||||
|
||||
((Player*)unitTarget)->ModifyMoney(50000000);
|
||||
|
||||
break;
|
||||
}
|
||||
// Surge Needle Teleporter
|
||||
case 47097:
|
||||
case 47097: // Surge Needle Teleporter
|
||||
{
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
|
@ -5363,13 +5351,11 @@ 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)
|
||||
|
|
@ -5378,17 +5364,16 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
caster->CastSpell(caster, damage, false);
|
||||
break;
|
||||
}
|
||||
// Death Gate
|
||||
case 52751:
|
||||
case 52751: // Death Gate
|
||||
{
|
||||
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)
|
||||
return;
|
||||
|
|
@ -5406,8 +5391,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
}
|
||||
return;
|
||||
}
|
||||
// Demonic Empowerment (succubus Vanish effect)
|
||||
case 54436:
|
||||
case 54436: // Demonic Empowerment (succubus Vanish effect)
|
||||
{
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
|
@ -5419,10 +5403,13 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
return;
|
||||
}
|
||||
case 55693: // Remove Collapsing Cave Aura
|
||||
{
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
unitTarget->RemoveAurasDueToSpell(m_spellInfo->CalculateSimpleValue(eff_idx));
|
||||
break;
|
||||
}
|
||||
case 58418: // Portal to Orgrimmar
|
||||
case 58420: // Portal to Stormwind
|
||||
{
|
||||
|
|
@ -5438,6 +5425,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
return;
|
||||
}
|
||||
case 59317: // Teleporting
|
||||
{
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
|
|
@ -5449,7 +5437,7 @@ 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
|
||||
|
|
@ -5462,6 +5450,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
// learn random explicit discovery recipe (if any)
|
||||
if (uint32 discoveredSpell = GetExplicitDiscoverySpell(m_spellInfo->Id, (Player*)m_caster))
|
||||
((Player*)m_caster)->learnSpell(discoveredSpell, false);
|
||||
|
||||
return;
|
||||
}
|
||||
case 69377: //Fortitude
|
||||
|
|
@ -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:
|
||||
|
|
@ -5507,6 +5495,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
{
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
uint32 itemtype;
|
||||
uint32 rank = 0;
|
||||
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
|
||||
{ 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)
|
||||
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)
|
||||
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;
|
||||
|
|
@ -5744,6 +5738,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
{
|
||||
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,19 +5794,19 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
{
|
||||
switch(m_spellInfo->Id)
|
||||
{
|
||||
// Dreaming Glory
|
||||
case 28698:
|
||||
case 28698: // Dreaming Glory
|
||||
{
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
unitTarget->CastSpell(unitTarget, 28694, true);
|
||||
break;
|
||||
}
|
||||
// Netherbloom
|
||||
case 28702:
|
||||
case 28702: // Netherbloom
|
||||
{
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
// 25% chance of casting a random buff
|
||||
if (roll_chance_i(75))
|
||||
return;
|
||||
|
|
@ -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)
|
||||
return;
|
||||
|
||||
// 25% chance of casting Nightmare Pollen
|
||||
if (roll_chance_i(75))
|
||||
return;
|
||||
|
||||
unitTarget->CastSpell(unitTarget, 28721, true);
|
||||
break;
|
||||
}
|
||||
|
|
@ -5842,8 +5843,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
{
|
||||
switch(m_spellInfo->Id)
|
||||
{
|
||||
// Pestilence
|
||||
case 50842:
|
||||
case 50842: // Pestilence
|
||||
{
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9423"
|
||||
#define REVISION_NR "9424"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue