[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)
{
// spells required only Real aura add/remove
if(!Real)
if (!Real)
return;
// AT APPLY
if(apply)
if (apply)
{
switch(m_spellProto->SpellFamilyName)
{
case SPELLFAMILY_GENERIC:
{
switch(GetId())
{
case 1515: // Tame beast
@ -2269,7 +2270,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
caster->CastSpell(caster, 13138, true, NULL, this);
return;
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);
return;
case 43873: // Headless Horseman Laugh
@ -2313,9 +2314,11 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return;
}
break;
}
case SPELLFAMILY_WARRIOR:
{
// Overpower
if(m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004))
if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004))
{
// Must be casting target
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)
{
// 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)
{
@ -2348,7 +2351,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return;
}
break;
}
case SPELLFAMILY_SHAMAN:
{
// Tidal Force
if (GetId() == 55198)
{
@ -2356,6 +2361,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
SpellEntry const* buffEntry = sSpellStore.LookupEntry(55166);
if (!buffEntry)
return;
for(uint32 k = 0; k < buffEntry->StackAmount; ++k)
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)))
{
// 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())
m_modifier.m_amount = caster->SpellHealingBonus(m_target, GetSpellProto(), m_modifier.m_amount, SPELL_DIRECT_DAMAGE);
return;
}
break;
}
}
}
// AT REMOVE
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()->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;
}
if(finalSpelId)
if (finalSpelId)
caster->CastSpell(m_target, finalSpelId, true, NULL, this);
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.
if (m_duration == 0 || m_removeMode == AURA_REMOVE_BY_DISPEL)
m_target->CastSpell(m_target,m_modifier.m_amount,true,NULL,this);
return;
}
if (m_removeMode == AURA_REMOVE_BY_DEATH)
{
// Stop caster Arcane Missle chanelling on death
if (m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE &&
(m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000800)))
if (m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE && (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000800)))
{
if (Unit* caster = GetCaster())
caster->InterruptSpell(CURRENT_CHANNELED_SPELL);
return;
}
}
@ -2500,12 +2509,10 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
{
switch(GetId())
{
// Recently Bandaged
case 11196:
case 11196: // Recently Bandaged
m_target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, GetMiscValue(), apply);
return;
// Unstable Power
case 24658:
case 24658: // Unstable Power
{
uint32 spellId = 24659;
if (apply)
@ -2517,13 +2524,13 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
for (uint32 i = 0; i < spell->StackAmount; ++i)
caster->CastSpell(m_target, spellId, true, NULL, NULL, GetCasterGUID());
return;
}
m_target->RemoveAurasDueToSpell(spellId);
return;
}
// Restless Strength
case 24661:
case 24661: // Restless Strength
{
uint32 spellId = 24662;
if (apply)
@ -2532,30 +2539,32 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
Unit* caster = GetCaster();
if (!spell || !caster)
return;
for (uint32 i=0; i < spell->StackAmount; ++i)
caster->CastSpell(m_target, spell->Id, true, NULL, NULL, GetCasterGUID());
return;
}
m_target->RemoveAurasDueToSpell(spellId);
return;
}
case 29266: // Permanent Feign Death
case 31261: // Permanent Feign Death (Root)
case 37493: // Feign Death
case 51329: // Feign Death
case 52593: // Bloated Abomination Feign Death
case 55795: // Falling Dragon Feign Death
case 57626: // Feign Death
case 57685: // Permanent Feign Death
case 58768: // Permanent Feign Death (Freeze Jumpend)
case 58806: // Permanent Feign Death (Drowned Anim)
case 58951: // Permanent Feign Death
case 64461: // Permanent Feign Death (No Anim) (Root)
case 65985: // Permanent Feign Death (Root Silence Pacify)
case 70592: // Permanent Feign Death
case 70628: // Permanent Feign Death
case 70630: // Frozen Aftermath - Feign Death
case 71598: // Feign Death
case 29266: // Permanent Feign Death
case 31261: // Permanent Feign Death (Root)
case 37493: // Feign Death
case 51329: // Feign Death
case 52593: // Bloated Abomination Feign Death
case 55795: // Falling Dragon Feign Death
case 57626: // Feign Death
case 57685: // Permanent Feign Death
case 58768: // Permanent Feign Death (Freeze Jumpend)
case 58806: // Permanent Feign Death (Drowned Anim)
case 58951: // Permanent Feign Death
case 64461: // Permanent Feign Death (No Anim) (Root)
case 65985: // Permanent Feign Death (Root Silence Pacify)
case 70592: // Permanent Feign Death
case 70628: // Permanent Feign Death
case 70630: // Frozen Aftermath - Feign Death
case 71598: // Feign Death
{
// Unclear what the difference really is between them.
// Some has effect1 that makes the difference, however not all.
@ -2566,9 +2575,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return;
}
case 35356: // Spawn Feign Death
case 35357: // Spawn Feign Death
case 42557: // Feign Death
case 35356: // Spawn Feign Death
case 35357: // Spawn Feign Death
case 42557: // Feign Death
{
if (m_target->GetTypeId() == TYPEID_UNIT)
{
@ -2592,8 +2601,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
}
return;
}
//Summon Fire Elemental
case 40133:
case 40133: //Summon Fire Elemental
{
Unit* caster = GetCaster();
if (!caster)
@ -2602,15 +2610,14 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
Unit *owner = caster->GetOwner();
if (owner && owner->GetTypeId() == TYPEID_PLAYER)
{
if(apply)
if (apply)
owner->CastSpell(owner, 8985, true);
else
((Player*)owner)->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
}
return;
}
//Summon Earth Elemental
case 40132 :
case 40132: //Summon Earth Elemental
{
Unit* caster = GetCaster();
if (!caster)
@ -2619,17 +2626,16 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
Unit *owner = caster->GetOwner();
if (owner && owner->GetTypeId() == TYPEID_PLAYER)
{
if(apply)
if (apply)
owner->CastSpell(owner, 19704, true);
else
((Player*)owner)->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
}
return;
}
//Dragonmaw Illusion
case 40214 :
case 40214: //Dragonmaw Illusion
{
if(apply)
if (apply)
{
m_target->CastSpell(m_target, 40216, true);
m_target->CastSpell(m_target, 42016, true);
@ -2641,24 +2647,22 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
}
return;
}
// LK Intro VO (1)
case 58204:
if(m_target->GetTypeId() == TYPEID_PLAYER)
case 58204: // LK Intro VO (1)
if (m_target->GetTypeId() == TYPEID_PLAYER)
{
// Play part 1
if(apply)
if (apply)
m_target->PlayDirectSound(14970, (Player *)m_target);
// continue in 58205
else
m_target->CastSpell(m_target, 58205, true);
}
return;
// LK Intro VO (2)
case 58205:
if(m_target->GetTypeId() == TYPEID_PLAYER)
case 58205: // LK Intro VO (2)
if (m_target->GetTypeId() == TYPEID_PLAYER)
{
// Play part 2
if(apply)
if (apply)
m_target->PlayDirectSound(14971, (Player *)m_target);
// Play part 3
else
@ -2698,9 +2702,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
case SPELLFAMILY_PRIEST:
{
// 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
// 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)
return;
if(apply)
if (apply)
// dummy not have proper effectclassmask
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
{
if(apply)
if (apply)
{
if(m_target->m_form != FORM_CAT)
if (m_target->m_form != FORM_CAT)
return;
m_target->CastSpell(m_target, 62071, true);
@ -2760,28 +2764,28 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
// Lifebloom
if (GetSpellProto()->SpellFamilyFlags & UI64LIT(0x1000000000))
{
if ( apply )
if (apply)
{
if (Unit* caster = GetCaster())
// 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);
}
else
{
// 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;
// have a look if there is still some other Lifebloom dummy aura
Unit::AuraList const& auras = m_target->GetAurasByType(SPELL_AURA_DUMMY);
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)))
return;
// final heal
if(m_target->IsInWorld() && m_stackAmount > 0)
if (m_target->IsInWorld() && m_stackAmount > 0)
{
int32 amount = m_modifier.m_amount / m_stackAmount;
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
if(m_target->GetTypeId()==TYPEID_PLAYER && GetSpellProto()->SpellIconID == 1563)
if (m_target->GetTypeId()==TYPEID_PLAYER && GetSpellProto()->SpellIconID == 1563)
{
((Player*)m_target)->UpdateAttackPowerAndDamage();
return;
}
// Improved Moonkin Form
if(GetSpellProto()->SpellIconID == 2855)
if (GetSpellProto()->SpellIconID == 2855)
{
uint32 spell_id;
switch(GetId())
@ -2817,9 +2821,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return;
}
if(apply)
if (apply)
{
if(m_target->m_form != FORM_MOONKIN)
if (m_target->m_form != FORM_MOONKIN)
return;
m_target->CastSpell(m_target, spell_id, true);
@ -2851,9 +2855,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
}
// 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);
else
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)
{
SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAuraMapBounds(GetId());
if(saBounds.first != saBounds.second)
if (saBounds.first != saBounds.second)
{
uint32 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)
{
// 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);
// 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))
m_target->CastSpell(m_target, itr->second->spellId, true);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9490"
#define REVISION_NR "9491"
#endif // __REVISION_NR_H__