[9491] Restore code commenting style after 9489/9490

Adjust comment style for rest of function and some additional code style cleanup.

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-03-01 03:21:59 +01:00
parent 9ba8235649
commit 1f329d2fb3
2 changed files with 77 additions and 73 deletions

View file

@ -2240,15 +2240,16 @@ void Aura::TriggerSpellWithValue()
void Aura::HandleAuraDummy(bool apply, bool Real) void Aura::HandleAuraDummy(bool apply, bool Real)
{ {
// spells required only Real aura add/remove // spells required only Real aura add/remove
if(!Real) if (!Real)
return; return;
// AT APPLY // AT APPLY
if(apply) if (apply)
{ {
switch(m_spellProto->SpellFamilyName) switch(m_spellProto->SpellFamilyName)
{ {
case SPELLFAMILY_GENERIC: case SPELLFAMILY_GENERIC:
{
switch(GetId()) switch(GetId())
{ {
case 1515: // Tame beast case 1515: // Tame beast
@ -2269,7 +2270,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
caster->CastSpell(caster, 13138, true, NULL, this); caster->CastSpell(caster, 13138, true, NULL, this);
return; return;
case 39850: // Rocket Blast case 39850: // Rocket Blast
if(roll_chance_i(20)) // backfire stun if (roll_chance_i(20)) // backfire stun
m_target->CastSpell(m_target, 51581, true, NULL, this); m_target->CastSpell(m_target, 51581, true, NULL, this);
return; return;
case 43873: // Headless Horseman Laugh case 43873: // Headless Horseman Laugh
@ -2313,9 +2314,11 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
} }
break; break;
}
case SPELLFAMILY_WARRIOR: case SPELLFAMILY_WARRIOR:
{
// Overpower // Overpower
if(m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004)) if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004))
{ {
// Must be casting target // Must be casting target
if (!m_target->IsNonMeleeSpellCasted(false)) if (!m_target->IsNonMeleeSpellCasted(false))
@ -2329,7 +2332,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
for(Unit::AuraList::const_iterator itr = modifierAuras.begin(); itr != modifierAuras.end(); ++itr) for(Unit::AuraList::const_iterator itr = modifierAuras.begin(); itr != modifierAuras.end(); ++itr)
{ {
// Unrelenting Assault // Unrelenting Assault
if((*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_WARRIOR && (*itr)->GetSpellProto()->SpellIconID == 2775) if ((*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_WARRIOR && (*itr)->GetSpellProto()->SpellIconID == 2775)
{ {
switch ((*itr)->GetSpellProto()->Id) switch ((*itr)->GetSpellProto()->Id)
{ {
@ -2348,7 +2351,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
} }
break; break;
}
case SPELLFAMILY_SHAMAN: case SPELLFAMILY_SHAMAN:
{
// Tidal Force // Tidal Force
if (GetId() == 55198) if (GetId() == 55198)
{ {
@ -2356,6 +2361,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
SpellEntry const* buffEntry = sSpellStore.LookupEntry(55166); SpellEntry const* buffEntry = sSpellStore.LookupEntry(55166);
if (!buffEntry) if (!buffEntry)
return; return;
for(uint32 k = 0; k < buffEntry->StackAmount; ++k) for(uint32 k = 0; k < buffEntry->StackAmount; ++k)
m_target->CastSpell(m_target, buffEntry, true, NULL, this); m_target->CastSpell(m_target, buffEntry, true, NULL, this);
} }
@ -2363,18 +2369,19 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
else if ((GetSpellProto()->SpellFamilyFlags & UI64LIT(0x40000000000))) else if ((GetSpellProto()->SpellFamilyFlags & UI64LIT(0x40000000000)))
{ {
// prevent double apply bonuses // prevent double apply bonuses
if(m_target->GetTypeId() != TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading()) if (m_target->GetTypeId() != TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading())
if (Unit* caster = GetCaster()) if (Unit* caster = GetCaster())
m_modifier.m_amount = caster->SpellHealingBonus(m_target, GetSpellProto(), m_modifier.m_amount, SPELL_DIRECT_DAMAGE); m_modifier.m_amount = caster->SpellHealingBonus(m_target, GetSpellProto(), m_modifier.m_amount, SPELL_DIRECT_DAMAGE);
return; return;
} }
break; break;
}
} }
} }
// AT REMOVE // AT REMOVE
else else
{ {
if( m_target->GetTypeId() == TYPEID_PLAYER && if (m_target->GetTypeId() == TYPEID_PLAYER &&
(GetSpellProto()->Effect[EFFECT_INDEX_0] == 72 || GetSpellProto()->Effect[EFFECT_INDEX_0] == 6 && (GetSpellProto()->Effect[EFFECT_INDEX_0] == 72 || GetSpellProto()->Effect[EFFECT_INDEX_0] == 6 &&
(GetSpellProto()->EffectApplyAuraName[EFFECT_INDEX_0] == 1 || GetSpellProto()->EffectApplyAuraName[EFFECT_INDEX_0] == 128))) (GetSpellProto()->EffectApplyAuraName[EFFECT_INDEX_0] == 1 || GetSpellProto()->EffectApplyAuraName[EFFECT_INDEX_0] == 128)))
{ {
@ -2414,8 +2421,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
case 30105: finalSpelId = 30104; break; case 30105: finalSpelId = 30104; break;
} }
if(finalSpelId) if (finalSpelId)
caster->CastSpell(m_target, finalSpelId, true, NULL, this); caster->CastSpell(m_target, finalSpelId, true, NULL, this);
return; return;
} }
@ -2476,17 +2484,18 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
// when removing aura from one target due to casting Living Bomb at other. // when removing aura from one target due to casting Living Bomb at other.
if (m_duration == 0 || m_removeMode == AURA_REMOVE_BY_DISPEL) if (m_duration == 0 || m_removeMode == AURA_REMOVE_BY_DISPEL)
m_target->CastSpell(m_target,m_modifier.m_amount,true,NULL,this); m_target->CastSpell(m_target,m_modifier.m_amount,true,NULL,this);
return; return;
} }
if (m_removeMode == AURA_REMOVE_BY_DEATH) if (m_removeMode == AURA_REMOVE_BY_DEATH)
{ {
// Stop caster Arcane Missle chanelling on death // Stop caster Arcane Missle chanelling on death
if (m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE && if (m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE && (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000800)))
(m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000800)))
{ {
if (Unit* caster = GetCaster()) if (Unit* caster = GetCaster())
caster->InterruptSpell(CURRENT_CHANNELED_SPELL); caster->InterruptSpell(CURRENT_CHANNELED_SPELL);
return; return;
} }
} }
@ -2500,12 +2509,10 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
{ {
switch(GetId()) switch(GetId())
{ {
// Recently Bandaged case 11196: // Recently Bandaged
case 11196:
m_target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, GetMiscValue(), apply); m_target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, GetMiscValue(), apply);
return; return;
// Unstable Power case 24658: // Unstable Power
case 24658:
{ {
uint32 spellId = 24659; uint32 spellId = 24659;
if (apply) if (apply)
@ -2517,13 +2524,13 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
for (uint32 i = 0; i < spell->StackAmount; ++i) for (uint32 i = 0; i < spell->StackAmount; ++i)
caster->CastSpell(m_target, spellId, true, NULL, NULL, GetCasterGUID()); caster->CastSpell(m_target, spellId, true, NULL, NULL, GetCasterGUID());
return; return;
} }
m_target->RemoveAurasDueToSpell(spellId); m_target->RemoveAurasDueToSpell(spellId);
return; return;
} }
// Restless Strength case 24661: // Restless Strength
case 24661:
{ {
uint32 spellId = 24662; uint32 spellId = 24662;
if (apply) if (apply)
@ -2532,30 +2539,32 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
Unit* caster = GetCaster(); Unit* caster = GetCaster();
if (!spell || !caster) if (!spell || !caster)
return; return;
for (uint32 i=0; i < spell->StackAmount; ++i) for (uint32 i=0; i < spell->StackAmount; ++i)
caster->CastSpell(m_target, spell->Id, true, NULL, NULL, GetCasterGUID()); caster->CastSpell(m_target, spell->Id, true, NULL, NULL, GetCasterGUID());
return; return;
} }
m_target->RemoveAurasDueToSpell(spellId); m_target->RemoveAurasDueToSpell(spellId);
return; return;
} }
case 29266: // Permanent Feign Death case 29266: // Permanent Feign Death
case 31261: // Permanent Feign Death (Root) case 31261: // Permanent Feign Death (Root)
case 37493: // Feign Death case 37493: // Feign Death
case 51329: // Feign Death case 51329: // Feign Death
case 52593: // Bloated Abomination Feign Death case 52593: // Bloated Abomination Feign Death
case 55795: // Falling Dragon Feign Death case 55795: // Falling Dragon Feign Death
case 57626: // Feign Death case 57626: // Feign Death
case 57685: // Permanent Feign Death case 57685: // Permanent Feign Death
case 58768: // Permanent Feign Death (Freeze Jumpend) case 58768: // Permanent Feign Death (Freeze Jumpend)
case 58806: // Permanent Feign Death (Drowned Anim) case 58806: // Permanent Feign Death (Drowned Anim)
case 58951: // Permanent Feign Death case 58951: // Permanent Feign Death
case 64461: // Permanent Feign Death (No Anim) (Root) case 64461: // Permanent Feign Death (No Anim) (Root)
case 65985: // Permanent Feign Death (Root Silence Pacify) case 65985: // Permanent Feign Death (Root Silence Pacify)
case 70592: // Permanent Feign Death case 70592: // Permanent Feign Death
case 70628: // Permanent Feign Death case 70628: // Permanent Feign Death
case 70630: // Frozen Aftermath - Feign Death case 70630: // Frozen Aftermath - Feign Death
case 71598: // Feign Death case 71598: // Feign Death
{ {
// Unclear what the difference really is between them. // Unclear what the difference really is between them.
// Some has effect1 that makes the difference, however not all. // Some has effect1 that makes the difference, however not all.
@ -2566,9 +2575,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
} }
case 35356: // Spawn Feign Death case 35356: // Spawn Feign Death
case 35357: // Spawn Feign Death case 35357: // Spawn Feign Death
case 42557: // Feign Death case 42557: // Feign Death
{ {
if (m_target->GetTypeId() == TYPEID_UNIT) if (m_target->GetTypeId() == TYPEID_UNIT)
{ {
@ -2592,8 +2601,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
} }
return; return;
} }
//Summon Fire Elemental case 40133: //Summon Fire Elemental
case 40133:
{ {
Unit* caster = GetCaster(); Unit* caster = GetCaster();
if (!caster) if (!caster)
@ -2602,15 +2610,14 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
Unit *owner = caster->GetOwner(); Unit *owner = caster->GetOwner();
if (owner && owner->GetTypeId() == TYPEID_PLAYER) if (owner && owner->GetTypeId() == TYPEID_PLAYER)
{ {
if(apply) if (apply)
owner->CastSpell(owner, 8985, true); owner->CastSpell(owner, 8985, true);
else else
((Player*)owner)->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true); ((Player*)owner)->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
} }
return; return;
} }
//Summon Earth Elemental case 40132: //Summon Earth Elemental
case 40132 :
{ {
Unit* caster = GetCaster(); Unit* caster = GetCaster();
if (!caster) if (!caster)
@ -2619,17 +2626,16 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
Unit *owner = caster->GetOwner(); Unit *owner = caster->GetOwner();
if (owner && owner->GetTypeId() == TYPEID_PLAYER) if (owner && owner->GetTypeId() == TYPEID_PLAYER)
{ {
if(apply) if (apply)
owner->CastSpell(owner, 19704, true); owner->CastSpell(owner, 19704, true);
else else
((Player*)owner)->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true); ((Player*)owner)->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
} }
return; return;
} }
//Dragonmaw Illusion case 40214: //Dragonmaw Illusion
case 40214 :
{ {
if(apply) if (apply)
{ {
m_target->CastSpell(m_target, 40216, true); m_target->CastSpell(m_target, 40216, true);
m_target->CastSpell(m_target, 42016, true); m_target->CastSpell(m_target, 42016, true);
@ -2641,24 +2647,22 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
} }
return; return;
} }
// LK Intro VO (1) case 58204: // LK Intro VO (1)
case 58204: if (m_target->GetTypeId() == TYPEID_PLAYER)
if(m_target->GetTypeId() == TYPEID_PLAYER)
{ {
// Play part 1 // Play part 1
if(apply) if (apply)
m_target->PlayDirectSound(14970, (Player *)m_target); m_target->PlayDirectSound(14970, (Player *)m_target);
// continue in 58205 // continue in 58205
else else
m_target->CastSpell(m_target, 58205, true); m_target->CastSpell(m_target, 58205, true);
} }
return; return;
// LK Intro VO (2) case 58205: // LK Intro VO (2)
case 58205: if (m_target->GetTypeId() == TYPEID_PLAYER)
if(m_target->GetTypeId() == TYPEID_PLAYER)
{ {
// Play part 2 // Play part 2
if(apply) if (apply)
m_target->PlayDirectSound(14971, (Player *)m_target); m_target->PlayDirectSound(14971, (Player *)m_target);
// Play part 3 // Play part 3
else else
@ -2698,9 +2702,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
case SPELLFAMILY_PRIEST: case SPELLFAMILY_PRIEST:
{ {
// Pain and Suffering // Pain and Suffering
if( m_spellProto->SpellIconID == 2874 && m_target->GetTypeId()==TYPEID_PLAYER ) if (m_spellProto->SpellIconID == 2874 && m_target->GetTypeId()==TYPEID_PLAYER)
{ {
if(apply) if (apply)
{ {
// Reduce backfire damage (dot damage) from Shadow Word: Death // Reduce backfire damage (dot damage) from Shadow Word: Death
// aura have wrong effectclassmask, so use hardcoded value // aura have wrong effectclassmask, so use hardcoded value
@ -2721,7 +2725,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
if (m_target->GetTypeId() != TYPEID_PLAYER) if (m_target->GetTypeId() != TYPEID_PLAYER)
return; return;
if(apply) if (apply)
// dummy not have proper effectclassmask // dummy not have proper effectclassmask
m_spellmod = new SpellModifier(SPELLMOD_DOT,SPELLMOD_FLAT,m_modifier.m_amount/7,GetId(),UI64LIT(0x001000000000)); m_spellmod = new SpellModifier(SPELLMOD_DOT,SPELLMOD_FLAT,m_modifier.m_amount/7,GetId(),UI64LIT(0x001000000000));
@ -2730,9 +2734,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
} }
case 52610: // Savage Roar case 52610: // Savage Roar
{ {
if(apply) if (apply)
{ {
if(m_target->m_form != FORM_CAT) if (m_target->m_form != FORM_CAT)
return; return;
m_target->CastSpell(m_target, 62071, true); m_target->CastSpell(m_target, 62071, true);
@ -2760,28 +2764,28 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
// Lifebloom // Lifebloom
if (GetSpellProto()->SpellFamilyFlags & UI64LIT(0x1000000000)) if (GetSpellProto()->SpellFamilyFlags & UI64LIT(0x1000000000))
{ {
if ( apply ) if (apply)
{ {
if (Unit* caster = GetCaster()) if (Unit* caster = GetCaster())
// prevent double apply bonuses // prevent double apply bonuses
if(m_target->GetTypeId()!=TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading()) if (m_target->GetTypeId() != TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading())
m_modifier.m_amount = caster->SpellHealingBonus(m_target, GetSpellProto(), m_modifier.m_amount, SPELL_DIRECT_DAMAGE); m_modifier.m_amount = caster->SpellHealingBonus(m_target, GetSpellProto(), m_modifier.m_amount, SPELL_DIRECT_DAMAGE);
} }
else else
{ {
// Final heal only on dispelled or duration end // Final heal only on dispelled or duration end
if ( !(GetAuraDuration() <= 0 || m_removeMode == AURA_REMOVE_BY_DISPEL) ) if (!(GetAuraDuration() <= 0 || m_removeMode == AURA_REMOVE_BY_DISPEL))
return; return;
// have a look if there is still some other Lifebloom dummy aura // have a look if there is still some other Lifebloom dummy aura
Unit::AuraList const& auras = m_target->GetAurasByType(SPELL_AURA_DUMMY); Unit::AuraList const& auras = m_target->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr) for(Unit::AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
if((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID && if ((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID &&
((*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x1000000000))) ((*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x1000000000)))
return; return;
// final heal // final heal
if(m_target->IsInWorld() && m_stackAmount > 0) if (m_target->IsInWorld() && m_stackAmount > 0)
{ {
int32 amount = m_modifier.m_amount / m_stackAmount; int32 amount = m_modifier.m_amount / m_stackAmount;
m_target->CastCustomSpell(m_target, 33778, &amount, NULL, NULL, true, NULL, this, GetCasterGUID()); m_target->CastCustomSpell(m_target, 33778, &amount, NULL, NULL, true, NULL, this, GetCasterGUID());
@ -2797,14 +2801,14 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
} }
// Predatory Strikes // Predatory Strikes
if(m_target->GetTypeId()==TYPEID_PLAYER && GetSpellProto()->SpellIconID == 1563) if (m_target->GetTypeId()==TYPEID_PLAYER && GetSpellProto()->SpellIconID == 1563)
{ {
((Player*)m_target)->UpdateAttackPowerAndDamage(); ((Player*)m_target)->UpdateAttackPowerAndDamage();
return; return;
} }
// Improved Moonkin Form // Improved Moonkin Form
if(GetSpellProto()->SpellIconID == 2855) if (GetSpellProto()->SpellIconID == 2855)
{ {
uint32 spell_id; uint32 spell_id;
switch(GetId()) switch(GetId())
@ -2817,9 +2821,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return; return;
} }
if(apply) if (apply)
{ {
if(m_target->m_form != FORM_MOONKIN) if (m_target->m_form != FORM_MOONKIN)
return; return;
m_target->CastSpell(m_target, spell_id, true); m_target->CastSpell(m_target, spell_id, true);
@ -2851,9 +2855,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
} }
// pet auras // pet auras
if(PetAura const* petSpell = sSpellMgr.GetPetAura(GetId(), m_effIndex)) if (PetAura const* petSpell = sSpellMgr.GetPetAura(GetId(), m_effIndex))
{ {
if(apply) if (apply)
m_target->AddPetAura(petSpell); m_target->AddPetAura(petSpell);
else else
m_target->RemovePetAura(petSpell); m_target->RemovePetAura(petSpell);
@ -2863,7 +2867,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
if (GetEffIndex() == EFFECT_INDEX_0 && m_target->GetTypeId() == TYPEID_PLAYER) if (GetEffIndex() == EFFECT_INDEX_0 && m_target->GetTypeId() == TYPEID_PLAYER)
{ {
SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAuraMapBounds(GetId()); SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAuraMapBounds(GetId());
if(saBounds.first != saBounds.second) if (saBounds.first != saBounds.second)
{ {
uint32 zone, area; uint32 zone, area;
m_target->GetZoneAndAreaId(zone, area); m_target->GetZoneAndAreaId(zone, area);
@ -2871,10 +2875,10 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
for(SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) for(SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
{ {
// some auras remove at aura remove // some auras remove at aura remove
if(!itr->second->IsFitToRequirements((Player*)m_target, zone, area)) if (!itr->second->IsFitToRequirements((Player*)m_target, zone, area))
m_target->RemoveAurasDueToSpell(itr->second->spellId); m_target->RemoveAurasDueToSpell(itr->second->spellId);
// some auras applied at aura apply // some auras applied at aura apply
else if(itr->second->autocast) else if (itr->second->autocast)
{ {
if (!m_target->HasAura(itr->second->spellId, EFFECT_INDEX_0)) if (!m_target->HasAura(itr->second->spellId, EFFECT_INDEX_0))
m_target->CastSpell(m_target, itr->second->spellId, true); m_target->CastSpell(m_target, itr->second->spellId, true);

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 "9490" #define REVISION_NR "9491"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__