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