[10178] Clean up some comments and align/indent as done for similar spell code.

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-07-11 11:32:33 +02:00
parent b0c0b464ce
commit 081b98ff04
2 changed files with 61 additions and 79 deletions

View file

@ -1040,7 +1040,7 @@ void Aura::TriggerSpell()
const uint64& casterGUID = GetCasterGUID();
Unit* triggerTarget = GetTriggerTarget();
if(!casterGUID || !triggerTarget)
if (!casterGUID || !triggerTarget)
return;
// generic casting code with custom spells and target/caster customs
@ -1082,8 +1082,9 @@ void Aura::TriggerSpell()
}
// // Polymorphic Ray
// case 6965: break;
// Thaumaturgy Channel
case 9712: trigger_spell_id = 21029; break;
case 9712: // Thaumaturgy Channel
trigger_spell_id = 21029;
break;
// // Egan's Blaster
// case 17368: break;
// // Haunted
@ -1098,16 +1099,14 @@ void Aura::TriggerSpell()
// case 21866: break;
// // Celebras Waiting
// case 21916: break;
// Brood Affliction: Bronze
case 23170:
case 23170: // Brood Affliction: Bronze
{
target->CastSpell(target, 23171, true, NULL, this);
return;
}
// // Mark of Frost
// case 23184: break;
// Restoration
case 23493:
case 23493: // Restoration
{
int32 heal = triggerTarget->GetMaxHealth() / 10;
triggerTarget->DealHeal(triggerTarget, heal, auraSpellInfo);
@ -1133,8 +1132,7 @@ void Aura::TriggerSpell()
// case 24780: break;
// // Cannon Prep
// case 24832: break;
// Shadow Bolt Whirl
case 24834:
case 24834: // Shadow Bolt Whirl
{
uint32 spellForTick[8] = { 24820, 24821, 24822, 24823, 24835, 24836, 24837, 24838 };
uint32 tick = GetAuraTicks();
@ -1157,8 +1155,7 @@ void Aura::TriggerSpell()
// case 25041: break;
// // Agro Drones
// case 25152: break;
// Consume
case 25371:
case 25371: // Consume
{
int32 bpDamage = triggerTarget->GetMaxHealth()*10/100;
triggerTarget->CastCustomSpell(triggerTarget, 25373, &bpDamage, NULL, NULL, true, NULL, this, casterGUID);
@ -1184,8 +1181,7 @@ void Aura::TriggerSpell()
// case 27746: break;
// // Steam Tank Passive
// case 27747: break;
// Frost Blast
case 27808:
case 27808: // Frost Blast
{
int32 bpDamage = triggerTarget->GetMaxHealth()*26/100;
triggerTarget->CastCustomSpell(triggerTarget, 29879, &bpDamage, NULL, NULL, true, NULL, this, casterGUID);
@ -1211,9 +1207,9 @@ void Aura::TriggerSpell()
// case 28522: break;
// // Silithyst
// case 29519: break;
// Inoculate Nestlewood Owlkin
case 29528:
if(triggerTarget->GetTypeId() != TYPEID_UNIT)// prevent error reports in case ignored player target
case 29528: // Inoculate Nestlewood Owlkin
// prevent error reports in case ignored player target
if (triggerTarget->GetTypeId() != TYPEID_UNIT)
return;
break;
// // Overload
@ -1226,8 +1222,9 @@ void Aura::TriggerSpell()
// case 29794: break;
// // Guardian of Icecrown Passive
// case 29897: break;
// Feed Captured Animal
case 29917: trigger_spell_id = 29916; break;
case 29917: // Feed Captured Animal
trigger_spell_id = 29916;
break;
// // Flame Wreath
// case 29946: break;
// // Flame Wreath
@ -1236,14 +1233,13 @@ void Aura::TriggerSpell()
// case 30025: break;
// // Nether Beam - Serenity
// case 30401: break;
// Extract Gas
case 30427:
case 30427: // Extract Gas
{
Unit* caster = GetCaster();
if (!caster)
return;
// move loot to player inventory and despawn target
if(caster->GetTypeId() ==TYPEID_PLAYER &&
if (caster->GetTypeId() ==TYPEID_PLAYER &&
triggerTarget->GetTypeId() == TYPEID_UNIT &&
((Creature*)triggerTarget)->GetCreatureInfo()->type == CREATURE_TYPE_GAS_CLOUD)
{
@ -1259,8 +1255,9 @@ void Aura::TriggerSpell()
}
return;
}
// Quake
case 30576: trigger_spell_id = 30571; break;
case 30576: // Quake
trigger_spell_id = 30571;
break;
// // Burning Maul
// case 30598: break;
// // Regeneration
@ -1274,15 +1271,13 @@ void Aura::TriggerSpell()
// case 31320: break;
// // Corrupt Medivh
// case 31326: break;
// Doom
case 31347:
case 31347: // Doom
{
target->CastSpell(target,31350,true);
target->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return;
}
// Spellcloth
case 31373:
case 31373: // Spellcloth
{
// Summon Elemental after create item
triggerTarget->SummonCreature(17870, 0, 0, 0, triggerTarget->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 0);
@ -1290,8 +1285,7 @@ void Aura::TriggerSpell()
}
// // Bloodmyst Tesla
// case 31611: break;
// Doomfire
case 31944:
case 31944: // Doomfire
{
int32 damage = m_modifier.m_amount * ((GetAuraDuration() + m_modifier.periodictime) / GetAuraMaxDuration());
triggerTarget->CastCustomSpell(triggerTarget, 31969, &damage, NULL, NULL, true, NULL, this, casterGUID);
@ -1307,8 +1301,7 @@ void Aura::TriggerSpell()
// case 33563: break;
// // Murmur's Touch
// case 33711: break;
// Flame Quills
case 34229:
case 34229: // Flame Quills
{
// cast 24 spells 34269-34289, 34314-34316
for(uint32 spell_id = 34269; spell_id != 34290; ++spell_id)
@ -1369,8 +1362,9 @@ void Aura::TriggerSpell()
// case 36785: break;
// // Cannon Charging (self)
// case 36860: break;
// Remote Toy
case 37027: trigger_spell_id = 37029; break;
case 37027: // Remote Toy
trigger_spell_id = 37029;
break;
// // Mark of Death
// case 37125: break;
// // Arcane Flurry
@ -1393,16 +1387,14 @@ void Aura::TriggerSpell()
// case 37815: break;
// // Corrupt Medivh
// case 37853: break;
// Eye of Grillok
case 38495:
case 38495: // Eye of Grillok
{
target->CastSpell(target, 38530, true);
return;
}
// Absorb Eye of Grillok (Zezzak's Shard)
case 38554:
case 38554: // Absorb Eye of Grillok (Zezzak's Shard)
{
if(target->GetTypeId() != TYPEID_UNIT)
if (target->GetTypeId() != TYPEID_UNIT)
return;
if (Unit* caster = GetCaster())
@ -1444,8 +1436,9 @@ void Aura::TriggerSpell()
// case 39634: break;
// // Shadow Inferno
// case 39645: break;
// Tear of Azzinoth Summon Channel - it's not really supposed to do anything,and this only prevents the console spam
case 39857: trigger_spell_id = 39856; break;
case 39857: // Tear of Azzinoth Summon Channel - it's not really supposed to do anything,and this only prevents the console spam
trigger_spell_id = 39856;
break;
// // Soulgrinder Ritual Visual (Smashed)
// case 39974: break;
// // Simon Game Pre-game timer
@ -1486,8 +1479,9 @@ void Aura::TriggerSpell()
// case 45050: break;
// // Earthquake
// case 46240: break;
// Personalized Weather
case 46736: trigger_spell_id = 46737; break;
case 46736: // Personalized Weather
trigger_spell_id = 46737;
break;
// // Stay Submerged
// case 46981: break;
// // Dragonblight Ram
@ -1503,9 +1497,8 @@ void Aura::TriggerSpell()
{
switch(auraId)
{
// Invisibility
case 66:
// Here need periodic triger reducing threat spell (or do it manually)
case 66: // Invisibility
// Here need periodic trigger reducing threat spell (or do it manually)
return;
default:
break;
@ -1536,14 +1529,13 @@ void Aura::TriggerSpell()
// default:
// break;
// }
// break;
// }
// break;
// }
case SPELLFAMILY_HUNTER:
{
switch (auraId)
{
// Sniper training
case 53302:
case 53302: // Sniper training
case 53303:
case 53304:
if (triggerTarget->GetTypeId() != TYPEID_PLAYER)
@ -1585,12 +1577,10 @@ void Aura::TriggerSpell()
{
switch(auraId)
{
// Cat Form
// trigger_spell_id not set and unknown effect triggered in this case, ignoring for while
case 768:
case 768: // Cat Form
// trigger_spell_id not set and unknown effect triggered in this case, ignoring for while
return;
// Frenzied Regeneration
case 22842:
case 22842: // Frenzied Regeneration
case 22895:
case 22896:
case 26999:
@ -1598,7 +1588,7 @@ void Aura::TriggerSpell()
int32 LifePerRage = GetModifier()->m_amount;
int32 lRage = target->GetPower(POWER_RAGE);
if(lRage > 100) // rage stored as rage*10
if (lRage > 100) // rage stored as rage*10
lRage = 100;
target->ModifyPower(POWER_RAGE, -lRage);
int32 FRTriggerBasePoints = int32(lRage*LifePerRage/10);
@ -1650,25 +1640,23 @@ void Aura::TriggerSpell()
{
switch(auraId)
{
// Lightning Shield (The Earthshatterer set trigger after cast Lighting Shield)
case 28820:
case 28820: // Lightning Shield (The Earthshatterer set trigger after cast Lighting Shield)
{
// Need remove self if Lightning Shield not active
Unit::SpellAuraHolderMap const& auras = triggerTarget->GetSpellAuraHolderMap();
for(Unit::SpellAuraHolderMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
SpellEntry const* spell = itr->second->GetSpellProto();
if( spell->SpellFamilyName == SPELLFAMILY_SHAMAN &&
if (spell->SpellFamilyName == SPELLFAMILY_SHAMAN &&
(spell->SpellFamilyFlags & UI64LIT(0x0000000000000400)))
return;
}
triggerTarget->RemoveAurasDueToSpell(28820);
return;
}
// Totemic Mastery (Skyshatter Regalia (Shaman Tier 6) - bonus)
case 38443:
case 38443: // Totemic Mastery (Skyshatter Regalia (Shaman Tier 6) - bonus)
{
if(triggerTarget->IsAllTotemSlotsUsed())
if (triggerTarget->IsAllTotemSlotsUsed())
triggerTarget->CastSpell(triggerTarget, 38437, true, NULL, this);
else
triggerTarget->RemoveAurasDueToSpell(38437);
@ -1706,8 +1694,7 @@ void Aura::TriggerSpell()
break;
}
// Curse of Idiocy
case 1010:
case 1010: // Curse of Idiocy
{
// TODO: spell casted by result in correct way mostly
// BUT:
@ -1716,7 +1703,7 @@ void Aura::TriggerSpell()
// 2) maybe aura must be replace by new with accumulative stat mods instead stacking
// prevent cast by triggered auras
if(casterGUID == triggerTarget->GetGUID())
if (casterGUID == triggerTarget->GetGUID())
return;
// stop triggering after each affected stats lost > 90
@ -1737,35 +1724,30 @@ void Aura::TriggerSpell()
}
}
if(intelectLoss <= -90 && spiritLoss <= -90)
if (intelectLoss <= -90 && spiritLoss <= -90)
return;
break;
}
// Mana Tide
case 16191:
case 16191: // Mana Tide
{
triggerTarget->CastCustomSpell(triggerTarget, trigger_spell_id, &m_modifier.m_amount, NULL, NULL, true, NULL, this);
return;
}
// Ground Slam
case 33525:
case 33525: // Ground Slam
triggerTarget->CastSpell(triggerTarget, trigger_spell_id, true, NULL, this, casterGUID);
return;
// Rod of Purification - for quest 10839 (Veil Skith: Darkstone of Terokk)
case 38736:
case 38736: // Rod of Purification - for quest 10839 (Veil Skith: Darkstone of Terokk)
{
if(Unit* caster = GetCaster())
if (Unit* caster = GetCaster())
caster->CastSpell(triggerTarget, trigger_spell_id, true, NULL, this);
return;
}
// Beacon of Light
case 53563:
case 53563: // Beacon of Light
// original caster must be target (beacon)
target->CastSpell(target, trigger_spell_id, true, NULL, this, target->GetGUID());
return;
// Rapid Recuperation (triggered energize have baspioints == 0)
case 56654:
case 56654: // Rapid Recuperation (triggered energize have baspioints == 0)
case 58882:
{
int32 mana = target->GetMaxPower(POWER_MANA) * m_modifier.m_amount / 100;
@ -1776,13 +1758,13 @@ void Aura::TriggerSpell()
}
// All ok cast by default case
if(triggeredSpellInfo)
if (triggeredSpellInfo)
triggerTarget->CastSpell(triggerTarget, triggeredSpellInfo, true, NULL, this, casterGUID);
else
{
if (Unit* caster = GetCaster())
{
if(triggerTarget->GetTypeId() != TYPEID_UNIT || !Script->EffectDummyCreature(caster, GetId(), GetEffIndex(), (Creature*)triggerTarget))
if (triggerTarget->GetTypeId() != TYPEID_UNIT || !Script->EffectDummyCreature(caster, GetId(), GetEffIndex(), (Creature*)triggerTarget))
sLog.outError("Aura::TriggerSpell: Spell %u have 0 in EffectTriggered[%d], not handled custom case?",GetId(),GetEffIndex());
}
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10177"
#define REVISION_NR "10178"
#endif // __REVISION_NR_H__