diff --git a/sql/mangos_spell_check.sql b/sql/mangos_spell_check.sql index a1a93cb43..1585270f7 100644 --- a/sql/mangos_spell_check.sql +++ b/sql/mangos_spell_check.sql @@ -16,7 +16,7 @@ /* re-adding before command use. So need just adding new line to file. */ /* Current table fill progress state: */ -/* SpellEffect.cpp from start until end of Spell::EffectPowerBurn */ +/* SpellEffect.cpp from start until end of Spell::EffectEnchantItemPrismatic */ DROP TABLE IF EXISTS spell_check; CREATE TABLE `spell_check` ( @@ -41,6 +41,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (1454, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'), (1455, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'), (1456, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'), +(9512, -1, -1, -1, -1, -1, -1, 30, -1,-1,'Restore Energy', 'Spell::EffectEnergize'), (4073, -1, -1, -1, -1, -1, -1, -1, -1,-1,'Mechanical Dragonling', 'Spell::EffectDummy'), (5938, 8, -1, -1, -1, -1, -1, 3, -1,-1,'Shiv', 'Spell::EffectDummy'), (5940, -1, -1, -1, -1, -1, -1, -1, -1,-1,'Shiv', 'Spell::EffectDummy'), @@ -58,7 +59,6 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (8220, -1, -1, -1, -1, -1, -1, -1, -1,-1,'Flip Out', 'Spell::EffectDummy'), (8221, -1, -1, -1, -1, -1, -1, -1, -1,-1,'Yaaarrrr', 'Spell::EffectDummy'), (8222, -1, -1, -1, -1, -1, -1, -1, -1,-1,'Yaaarrrr', 'Spell::EffectDummy'), -(8326, -1, -1, -1, -1, -1, -1, 6, -1,-1,'Ghost', 'Spell::EffectApplyAura'), (8593, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Symbol of life', 'Spell::EffectDummy'), (10399,11,0x0000000000400000,0x00000000, -1, -1, -1, 3, -1,-1,'Rockbiter Weapon', 'Spell::EffectDummy'), (11687, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'), @@ -93,13 +93,13 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (18790,-1, -1, -1, -1, -1, -1, -1, -1,-1,'', 'Spell::EffectInstaKill'), (18791,-1, -1, -1, -1, -1, -1, -1, -1,-1,'', 'Spell::EffectInstaKill'), (18792,-1, -1, -1, -1, -1, -1, -1, -1,-1,'', 'Spell::EffectInstaKill'), +(19658,-1, -1, -1, -1, -1, -1, 10, -1,-1,'Devour Magic Effect', 'Spell::EffectDispel'), (19804,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Arcanite Dragonling', 'Spell::EffectDummy'), (20187,10, -1, -1, -1, -1, -1, 3, -1,-1,'Judgement of Righteousness', 'Spell::EffectDummy'), (20253, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Intercept', 'Spell::EffectSchoolDMG'), (20473,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'), (20577, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Cannibalize', 'Spell::EffectDummy'), (20578,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Cannibalize', 'Spell::EffectDummy'), -(20584,-1, -1, -1, -1, -1, -1, 6, -1,-1,'Ghost', 'Spell::EffectApplyAura'), (20647,-1, -1, -1, -1, -1, -1, 2, -1, 0,'Execute', 'Spell::EffectDummy'), (20929,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'), (20930,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'), @@ -128,7 +128,15 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (23885,-1, -1, -1, -1, -1, -1, 6, 42, 0,'Bloodthirst', 'Spell::EffectDummy'), (23989, 9, -1, -1, -1, -1, -1, 3, -1,-1,'Readiness', 'Spell::EffectDummy'), (24340, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor', 'Spell::EffectSchoolDMG'), +(24532,-1, -1, -1, -1, -1, -1, 30, -1,-1,'Burst of Energy', 'Spell::EffectEnergize'), +(24571,-1, -1, -1, -1, -1, -1, 30, -1,-1,'Blood Fury', 'Spell::EffectEnergize'), (24575,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Brittle Armor', 'Spell::EffectTriggerSpell'), +(24950,-1, -1, -1, -1, -1, -1, 24, -1,-1,'Create Warsong Mark of Honor (Loser)','Spell::DoCreateItem'), +(24951,-1, -1, -1, -1, -1, -1, 24, -1,-1,'Create Warsong Mark of Honor (WInner)','Spell::DoCreateItem'), +(24952,-1, -1, -1, -1, -1, -1, 24, -1,-1,'Arathi Basin Mark of Honor (Loser)', 'Spell::DoCreateItem'), +(24953,-1, -1, -1, -1, -1, -1, 24, -1,-1,'Arathi Basin Mark of Honor (Winner)','Spell::DoCreateItem'), +(24954,-1, -1, -1, -1, -1, -1, 24, -1,-1,'Alterac Valley Mark of Honor (Loser)','Spell::DoCreateItem'), +(24955,-1, -1, -1, -1, -1, -1, 24, -1,-1,'Alterac Valley Mark of Honor (Winner)','Spell::DoCreateItem'), (25599, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Thundercrash', 'Spell::EffectSchoolDMG'), (25858,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Reindeer', 'Spell::EffectDummy'), (25859,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Reindeer', 'Spell::EffectDummy'), @@ -174,6 +182,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (31790,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Righteous Defense', 'Spell::EffectTriggerSpell'), (31803,-1, -1, -1, -1, -1, -1, 6, 3,-1,'Holy Vengeance', 'Spell::EffectSchoolDMG'), (31818,-1, -1, -1, -1, -1, -1, 30, -1, 0,'Life Tap', 'Spell::EffectDummy'), +(31930,-1, -1, -1, -1, -1, -1, 30, -1,-1,'Judgements of the Wise', 'Spell::EffectEnergize'), (32409,-1, -1, -1, -1, -1, -1, 6, 3,-1,'Shadow Word: Death', 'Spell::EffectSchoolDMG'), (32553,-1, -1, -1, -1, -1, -1, 30, -1, 0,'Life Tap', 'Spell::EffectDummy'), (32813,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Squirrel Form', 'Spell::EffectDummy'), @@ -231,7 +240,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (39610,11, -1, -1, -1, -1, -1, 3, -1,-1,'Mana Tide Totem effect', 'Spell::EffectDummy'), (40810, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Saber Lash', 'Spell::EffectSchoolDMG'), (41276, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor', 'Spell::EffectSchoolDMG'), -(41637,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Prayer of Mending', 'Spell::EffectApplyAura'), +(41637,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Prayer of Mending', 'Spell::cast'), (42384, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Brutal Swipe', 'Spell::EffectSchoolDMG'), (43267, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Saber Lash', 'Spell::EffectSchoolDMG'), (43268, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Saber Lash', 'Spell::EffectSchoolDMG'), @@ -246,8 +255,11 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (44997, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Converting Sentry', 'Spell::EffectDummy'), (45009,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Converted Sentry Credit', 'Spell::EffectDummy'), (45030, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Impale Emissary', 'Spell::EffectDummy'), +(45062,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Holy Energy', 'Spell::EffectHeal'), +(45064,-1, -1, -1, -1, -1, -1, 10, -1,-1,'Vessel of the Naaru', 'Spell::EffectHeal'), (45088,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Emissary of Hate Credit', 'Spell::EffectDummy'), (45150, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor Slash', 'Spell::EffectSchoolDMG'), +(45470,-1, -1, -1, -1, -1, -1, 10, -1, 0,'Intercept', 'Spell::EffectDummy'), (64422, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor Slash', 'Spell::EffectSchoolDMG'), (64688, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor Slash', 'Spell::EffectSchoolDMG'), (45182,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Cheat Death', 'Spell::EffectDummy'), @@ -298,6 +310,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (53341, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Rune of Cinderglacier', 'Spell::EffectDummy'), (53343, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Rune of Razorice', 'Spell::EffectDummy'), (54586,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Runeforging Credit', 'Spell::EffectDummy'), +(54824,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Swiftmend', 'Spell::EffectHeal'), (54861,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Nitro Boosts', 'Spell::EffectDummy'), (55004, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Nitro Boosts', 'Spell::EffectDummy'), (55441,11, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Mana Tide', 'Spell::EffectDummy'), @@ -314,6 +327,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (61290, 5,0x0001000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shadowflame', 'Spell::EffectSchoolDMG'), (61291,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Shadowflame', 'Spell::EffectSchoolDMG'), (61491, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Intercept', 'Spell::EffectSchoolDMG'), +(63375,-1, -1, -1, -1, -1, -1, 30, -1,-1,'Improved Stormstrike', 'Spell::EffectEnergize'), /* sorted by spell names */ /*id fm familyMaskA fmMaskB icon vis cat eff aur ef name code */ @@ -328,6 +342,8 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas ( 0, 9,0x0008000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Counterattack', 'Spell::EffectSchoolDMG'), ( 0, 8,0x0000000000010000,0x00000000, -1, -1, -1, -1, 3,-1,'Deadly poison', 'Spell::EffectSchoolDMG'), ( 0,15,0x0000000000002000,0x00000000, -1, -1, -1, 3, -1,-1,'Death Coil', 'Spell::EffectDummy'), +( 0,15,0x0000000000000010,0x00000000, -1, -1, -1, 3, -1,-1,'Death Strike', 'Spell::EffectDummy'), +( 0, 5, -1, -1, -1, -1, 12, 38, -1,-1,'Devour Magic', 'Spell::EffectDispel'), ( 0, 8,0x0000000800000000,0x00000000, -1, -1, -1, 2, -1,-1,'Envenom', 'Spell::EffectSchoolDMG'), ( 0, 8,0x0000000000020000,0x00000000, -1, -1, -1, 2, -1,-1,'Eviscerate', 'Spell::EffectSchoolDMG'), (0, 4,0x0000000020000000,0x00000000, -1, -1, -1, 3, -1,-1,'Execute', 'Spell::EffectDummy'), @@ -356,8 +372,10 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas ( 0, 7,0x0000044000000000,0x00000000, -1, -1, -1, -1, -1,-1,'Mangle (Cat) and Mangle (Bear)', 'Unit::HandleDummyAuraProc'), ( 0, 9,0x0000000000000002,0x00000000, -1, 342, -1, 2, -1,-1,'Mongoose Bite', 'Spell::EffectSchoolDMG'), (0, 6,0x0080000000000000,0x00000000, -1, -1, -1, 3, -1,-1,'Penance', 'Spell::EffectDummy'), -( 0, 6,0x0000002000000000,0x00000000, -1, -1, -1, 6, -1,-1,'Prayer of Mending', 'Spell::EffectApplyAura'), +( 0, 6,0x0000002000000000,0x00000000, -1, -1, -1, 6, -1,-1,'Prayer of Mending', 'Spell::cast'), ( 0, 8,0x0000024000000860,0x00000000, -1, -1, -1, -1, -1,-1,'Preparation (affected spells)', 'Spell::EffectDummy'), +( 0, 7,0x0000000000000040,0x00000000, -1, -1, -1, -1, 8,-1,'Regrowth', 'Spell::EffectHeal'), +( 0, 7,0x0000000000000010,0x00000000, -1, -1, -1, -1, 8,-1,'Rejuvenation', 'Spell::EffectHeal'), ( 0, 7,0x0000000000001000,0x00000000, -1, -1, -1, 2, -1,-1,'Rake', 'Spell::EffectSchoolDMG'), /* used in */ ( 0, 7,0x0000000000001000,0x00000000, -1, -1, -1, 80, -1, 2,'Rake', 'Spell::EffectSchoolDMG'), /* exactly selected */ ( 0, 7,0x0000000000001000,0x00000000, -1, -1, -1, -1, 3,-1,'Rake', 'Aura::HandlePeriodicDamage'), /* used in */ diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index d5d82c579..b323738f3 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -670,7 +670,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx) void Spell::EffectDummy(uint32 i) { - if(!unitTarget && !gameObjTarget && !itemTarget) + if (!unitTarget && !gameObjTarget && !itemTarget) return; // selection by spell family @@ -682,7 +682,7 @@ void Spell::EffectDummy(uint32 i) { case 8063: // Deviate Fish { - if(m_caster->GetTypeId() != TYPEID_PLAYER) + if (m_caster->GetTypeId() != TYPEID_PLAYER) return; uint32 spell_id = 0; @@ -699,7 +699,7 @@ void Spell::EffectDummy(uint32 i) } case 8213: // Savory Deviate Delight { - if(m_caster->GetTypeId() != TYPEID_PLAYER) + if (m_caster->GetTypeId() != TYPEID_PLAYER) return; uint32 spell_id = 0; @@ -716,7 +716,7 @@ void Spell::EffectDummy(uint32 i) case 8593: // Symbol of life (restore creature to life) case 31225: // Shimmering Vessel (restore creature to life) { - if(!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) + if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) return; ((Creature*)unitTarget)->setDeathState(JUST_ALIVED); return; @@ -725,7 +725,7 @@ void Spell::EffectDummy(uint32 i) case 12850: // (now good common check for this spells) case 12868: { - if(!unitTarget) + if (!unitTarget) return; float damage; @@ -748,7 +748,7 @@ void Spell::EffectDummy(uint32 i) // get remaining damage of old Deep Wound aura Aura* deepWound = unitTarget->GetAura(12721, 0); - if(deepWound) + if (deepWound) { int32 remainingTicks = deepWound->GetAuraDuration() / deepWound->GetModifier()->periodictime; damage += remainingTicks * deepWound->GetModifier()->m_amount; @@ -761,16 +761,16 @@ void Spell::EffectDummy(uint32 i) } case 13120: // net-o-matic { - if(!unitTarget) + if (!unitTarget) return; uint32 spell_id = 0; uint32 roll = urand(0, 99); - if(roll < 2) // 2% for 30 sec self root (off-like chance unknown) + if (roll < 2) // 2% for 30 sec self root (off-like chance unknown) spell_id = 16566; - else if(roll < 4) // 2% for 20 sec root, charge to target (off-like chance unknown) + else if (roll < 4) // 2% for 20 sec root, charge to target (off-like chance unknown) spell_id = 13119; else // normal root spell_id = 13099; @@ -781,7 +781,7 @@ void Spell::EffectDummy(uint32 i) case 13567: // Dummy Trigger { // can be used for different aura triggering, so select by aura - if(!m_triggeredByAuraSpell || !unitTarget) + if (!m_triggeredByAuraSpell || !unitTarget) return; switch(m_triggeredByAuraSpell->Id) @@ -798,7 +798,7 @@ void Spell::EffectDummy(uint32 i) case 15998: // Capture Worg Pup case 29435: // Capture Female Kaliri Hatchling { - if(!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) + if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) return; Creature* creatureTarget = (Creature*)unitTarget; @@ -808,7 +808,7 @@ void Spell::EffectDummy(uint32 i) } case 16589: // Noggenfogger Elixir { - if(m_caster->GetTypeId() != TYPEID_PLAYER) + if (m_caster->GetTypeId() != TYPEID_PLAYER) return; uint32 spell_id = 0; @@ -824,10 +824,10 @@ void Spell::EffectDummy(uint32 i) } case 17251: // Spirit Healer Res { - if(!unitTarget || !m_originalCaster) + if (!unitTarget || !m_originalCaster) return; - if(m_originalCaster->GetTypeId() == TYPEID_PLAYER) + if (m_originalCaster->GetTypeId() == TYPEID_PLAYER) { WorldPacket data(SMSG_SPIRIT_HEALER_CONFIRM, 8); data << uint64(unitTarget->GetGUID()); @@ -837,7 +837,7 @@ void Spell::EffectDummy(uint32 i) } case 17271: // Test Fetid Skull { - if(!itemTarget && m_caster->GetTypeId()!=TYPEID_PLAYER) + if (!itemTarget && m_caster->GetTypeId()!=TYPEID_PLAYER) return; uint32 spell_id = roll_chance_i(50) @@ -853,11 +853,11 @@ void Spell::EffectDummy(uint32 i) return; case 23019: // Crystal Prison Dummy DND { - if(!unitTarget || !unitTarget->isAlive() || unitTarget->GetTypeId() != TYPEID_UNIT || ((Creature*)unitTarget)->isPet()) + if (!unitTarget || !unitTarget->isAlive() || unitTarget->GetTypeId() != TYPEID_UNIT || ((Creature*)unitTarget)->isPet()) return; Creature* creatureTarget = (Creature*)unitTarget; - if(creatureTarget->isPet()) + if (creatureTarget->isPet()) return; GameObject* pGameObj = new GameObject; @@ -865,7 +865,7 @@ void Spell::EffectDummy(uint32 i) Map *map = creatureTarget->GetMap(); // create before death for get proper coordinates - if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 179644, map, m_caster->GetPhaseMask(), + if (!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 179644, map, m_caster->GetPhaseMask(), creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(), creatureTarget->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY) ) { @@ -890,34 +890,38 @@ void Spell::EffectDummy(uint32 i) return; } case 23074: // Arcanite Dragonling - if (!m_CastItem) return; + if (!m_CastItem) + return; m_caster->CastSpell(m_caster, 19804, true, m_CastItem); return; case 23075: // Mithril Mechanical Dragonling - if (!m_CastItem) return; + if (!m_CastItem) + return; m_caster->CastSpell(m_caster, 12749, true, m_CastItem); return; case 23076: // Mechanical Dragonling - if (!m_CastItem) return; + if (!m_CastItem) + return; m_caster->CastSpell(m_caster, 4073, true, m_CastItem); return; case 23133: // Gnomish Battle Chicken - if (!m_CastItem) return; + if (!m_CastItem) + return; m_caster->CastSpell(m_caster, 13166, true, m_CastItem); return; case 23448: // Transporter Arrival - Ultrasafe Transporter: Gadgetzan - backfires { int32 r = irand(0, 119); - if ( r < 20 ) // Transporter Malfunction - 1/6 polymorph + if (r < 20) // Transporter Malfunction - 1/6 polymorph m_caster->CastSpell(m_caster, 23444, true); - else if ( r < 100 ) // Evil Twin - 4/6 evil twin + else if (r < 100) // Evil Twin - 4/6 evil twin m_caster->CastSpell(m_caster, 23445, true); else // Transporter Malfunction - 1/6 miss the target m_caster->CastSpell(m_caster, 36902, true); return; } case 23453: // Gnomish Transporter - Ultrasafe Transporter: Gadgetzan - if ( roll_chance_i(50) ) // Gadgetzan Transporter - success + if (roll_chance_i(50)) // Gadgetzan Transporter - success m_caster->CastSpell(m_caster, 23441, true); else // Gadgetzan Transporter Failure - failure m_caster->CastSpell(m_caster, 23446, true); @@ -970,7 +974,7 @@ void Spell::EffectDummy(uint32 i) } case 29200: // Purify Helboar Meat { - if( m_caster->GetTypeId() != TYPEID_PLAYER ) + if (m_caster->GetTypeId() != TYPEID_PLAYER) return; uint32 spell_id = roll_chance_i(50) @@ -985,22 +989,24 @@ void Spell::EffectDummy(uint32 i) m_caster->CastSpell(unitTarget,32835,true); return; case 30458: // Nigh Invulnerability - if (!m_CastItem) return; - if(roll_chance_i(86)) // Nigh-Invulnerability - success + if (!m_CastItem) + return; + if (roll_chance_i(86)) // Nigh-Invulnerability - success m_caster->CastSpell(m_caster, 30456, true, m_CastItem); else // Complete Vulnerability - backfire in 14% casts m_caster->CastSpell(m_caster, 30457, true, m_CastItem); return; case 30507: // Poultryizer - if (!m_CastItem) return; - if(roll_chance_i(80)) // Poultryized! - success + if(!m_CastItem) + return; + if (roll_chance_i(80)) // Poultryized! - success m_caster->CastSpell(unitTarget, 30501, true, m_CastItem); else // Poultryized! - backfire 20% m_caster->CastSpell(unitTarget, 30504, true, m_CastItem); return; case 33060: // Make a Wish { - if(m_caster->GetTypeId()!=TYPEID_PLAYER) + if (m_caster->GetTypeId()!=TYPEID_PLAYER) return; uint32 spell_id = 0; @@ -1032,7 +1038,7 @@ void Spell::EffectDummy(uint32 i) } case 37674: // Chaos Blast { - if(!unitTarget) + if (!unitTarget) return; int32 basepoints0 = 100; @@ -1085,7 +1091,7 @@ void Spell::EffectDummy(uint32 i) */ case 44875: // Complete Raptor Capture { - if(!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) + if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) return; Creature* creatureTarget = (Creature*)unitTarget; @@ -1098,7 +1104,7 @@ void Spell::EffectDummy(uint32 i) } case 34665: //Administer Antidote { - if(!unitTarget || m_caster->GetTypeId() != TYPEID_PLAYER ) + if (!unitTarget || m_caster->GetTypeId() != TYPEID_PLAYER ) return; // Spell has scriptable target but for sure. if (unitTarget->GetTypeId() != TYPEID_UNIT) @@ -1134,21 +1140,22 @@ void Spell::EffectDummy(uint32 i) return; } case 55004: // Nitro Boosts - if(!m_CastItem) return; - if(roll_chance_i(95)) // Nitro Boosts - success + if (!m_CastItem) + return; + if (roll_chance_i(95)) // Nitro Boosts - success m_caster->CastSpell(m_caster, 54861, true, m_CastItem); else // Knocked Up - backfire 5% m_caster->CastSpell(m_caster, 46014, true, m_CastItem); return; case 50243: // Teach Language { - if(m_caster->GetTypeId() != TYPEID_PLAYER) + if (m_caster->GetTypeId() != TYPEID_PLAYER) return; // spell has a 1/3 chance to trigger one of the below - if(roll_chance_i(66)) + if (roll_chance_i(66)) return; - if(((Player*)m_caster)->GetTeam() == ALLIANCE) + if (((Player*)m_caster)->GetTeam() == ALLIANCE) { // 1000001 - gnomish binary m_caster->CastSpell(m_caster, 50242, true); @@ -1163,10 +1170,10 @@ void Spell::EffectDummy(uint32 i) } case 51582: //Rocket Boots Engaged (Rocket Boots Xtreme and Rocket Boots Xtreme Lite) { - if(m_caster->GetTypeId() != TYPEID_PLAYER) + if (m_caster->GetTypeId() != TYPEID_PLAYER) return; - if(BattleGround* bg = ((Player*)m_caster)->GetBattleGround()) + if (BattleGround* bg = ((Player*)m_caster)->GetBattleGround()) bg->EventPlayerDroppedFlag((Player*)m_caster); m_caster->CastSpell(m_caster, 30452, true, NULL); @@ -1174,7 +1181,7 @@ void Spell::EffectDummy(uint32 i) } case 51592: // Pickup Primordial Hatchling { - if(!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) + if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) return; Creature* creatureTarget = (Creature*)unitTarget; @@ -1218,7 +1225,7 @@ void Spell::EffectDummy(uint32 i) return; // implemented in EffectScript[0] case 59640: // Underbelly Elixir { - if(m_caster->GetTypeId() != TYPEID_PLAYER) + if (m_caster->GetTypeId() != TYPEID_PLAYER) return; uint32 spell_id = 0; @@ -1263,7 +1270,7 @@ void Spell::EffectDummy(uint32 i) { case 11958: // Cold Snap { - if(m_caster->GetTypeId()!=TYPEID_PLAYER) + if (m_caster->GetTypeId()!=TYPEID_PLAYER) return; // immediately finishes the cooldown on Frost spells @@ -1272,9 +1279,9 @@ void Spell::EffectDummy(uint32 i) { SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first); - if( spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && + if (spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && (GetSpellSchoolMask(spellInfo) & SPELL_SCHOOL_MASK_FROST) && - spellInfo->Id != 11958 && GetSpellRecoveryTime(spellInfo) > 0 ) + spellInfo->Id != 11958 && GetSpellRecoveryTime(spellInfo) > 0) { ((Player*)m_caster)->RemoveSpellCooldown((itr++)->first, true); } @@ -1285,7 +1292,7 @@ void Spell::EffectDummy(uint32 i) } case 32826: // Polymorph Cast Visual { - if ( unitTarget && unitTarget->GetTypeId() == TYPEID_UNIT ) + if (unitTarget && unitTarget->GetTypeId() == TYPEID_UNIT) { //Polymorph Cast Visual Rank 1 const uint32 spell_list[6] = { @@ -1304,14 +1311,14 @@ void Spell::EffectDummy(uint32 i) break; case SPELLFAMILY_WARRIOR: // Charge - if((m_spellInfo->SpellFamilyFlags & UI64LIT(0x1)) && m_spellInfo->SpellVisual[0] == 867) + if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x1)) && m_spellInfo->SpellVisual[0] == 867) { int32 chargeBasePoints0 = damage; m_caster->CastCustomSpell(m_caster, 34846, &chargeBasePoints0, NULL, NULL, true); return; } // Execute - if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x20000000)) + if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x20000000)) { if(!unitTarget) return; @@ -1328,7 +1335,7 @@ void Spell::EffectDummy(uint32 i) return; } // Slam - if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000200000)) + if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000200000)) { if(!unitTarget) return; @@ -1337,7 +1344,7 @@ void Spell::EffectDummy(uint32 i) return; } // Concussion Blow - if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000004000000)) + if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000004000000)) { m_damage+= uint32(damage * m_caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100); return; @@ -1347,7 +1354,7 @@ void Spell::EffectDummy(uint32 i) // Warrior's Wrath case 21977: { - if(!unitTarget) + if (!unitTarget) return; m_caster->CastSpell(unitTarget, 21887, true);// spell mod return; @@ -1389,7 +1396,7 @@ void Spell::EffectDummy(uint32 i) } // Think its not need (also need remove Life Tap from SpellDamageBonus or add new value) // damage = m_caster->SpellDamageBonus(m_caster, m_spellInfo,uint32(damage > 0 ? damage : 0), SPELL_DIRECT_DAMAGE); - if(unitTarget && (int32(unitTarget->GetHealth()) > damage)) + if (unitTarget && (int32(unitTarget->GetHealth()) > damage)) { // Shouldn't Appear in Combat Log unitTarget->ModifyHealth(-damage); @@ -1412,7 +1419,7 @@ void Spell::EffectDummy(uint32 i) if((*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_WARLOCK && (*itr)->GetSpellProto()->SpellIconID == 1982) manaFeedVal+= (*itr)->GetModifier()->m_amount; } - if(manaFeedVal > 0) + if (manaFeedVal > 0) { manaFeedVal = manaFeedVal * mana / 100; m_caster->CastCustomSpell(m_caster, 32553, &manaFeedVal, NULL, NULL, true, NULL); @@ -1462,7 +1469,7 @@ void Spell::EffectDummy(uint32 i) } //Any effect which causes you to lose control of your character will supress the starfall effect. - if(m_caster->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED)) + if (m_caster->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED)) return; switch(m_spellInfo->Id) @@ -1482,31 +1489,31 @@ void Spell::EffectDummy(uint32 i) { case 5938: // Shiv { - if(m_caster->GetTypeId() != TYPEID_PLAYER) + if (m_caster->GetTypeId() != TYPEID_PLAYER) return; Player *pCaster = ((Player*)m_caster); Item *item = pCaster->GetWeaponForAttack(OFF_ATTACK); - if(!item) + if (!item) return; // all poison enchantments is temporary uint32 enchant_id = item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT); - if(!enchant_id) + if (!enchant_id) return; SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); - if(!pEnchant) + if (!pEnchant) return; for (int s=0;s<3;s++) { - if(pEnchant->type[s]!=ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) + if (pEnchant->type[s]!=ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) continue; SpellEntry const* combatEntry = sSpellStore.LookupEntry(pEnchant->spellid[s]); - if(!combatEntry || combatEntry->Dispel != DISPEL_POISON) + if (!combatEntry || combatEntry->Dispel != DISPEL_POISON) continue; m_caster->CastSpell(unitTarget, combatEntry, true, item); @@ -1517,7 +1524,7 @@ void Spell::EffectDummy(uint32 i) } case 14185: // Preparation { - if(m_caster->GetTypeId()!=TYPEID_PLAYER) + if (m_caster->GetTypeId()!=TYPEID_PLAYER) return; //immediately finishes the cooldown on certain Rogue abilities @@ -1542,9 +1549,9 @@ void Spell::EffectDummy(uint32 i) break; case SPELLFAMILY_HUNTER: // Steady Shot - if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x100000000)) + if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x100000000)) { - if( !unitTarget || !unitTarget->isAlive()) + if (!unitTarget || !unitTarget->isAlive()) return; bool found = false; @@ -1553,14 +1560,14 @@ void Spell::EffectDummy(uint32 i) Unit::AuraList const& decSpeedList = unitTarget->GetAurasByType(SPELL_AURA_MOD_DECREASE_SPEED); for(Unit::AuraList::const_iterator iter = decSpeedList.begin(); iter != decSpeedList.end(); ++iter) { - if((*iter)->GetSpellProto()->SpellIconID==15 && (*iter)->GetSpellProto()->Dispel==0) + if ((*iter)->GetSpellProto()->SpellIconID==15 && (*iter)->GetSpellProto()->Dispel==0) { found = true; break; } } - if(found) + if (found) m_damage+= damage; return; } @@ -1569,7 +1576,7 @@ void Spell::EffectDummy(uint32 i) { case 23989: // Readiness talent { - if(m_caster->GetTypeId()!=TYPEID_PLAYER) + if (m_caster->GetTypeId()!=TYPEID_PLAYER) return; //immediately finishes the cooldown for hunter abilities @@ -1603,7 +1610,7 @@ void Spell::EffectDummy(uint32 i) { case 156: // Holy Shock { - if(!unitTarget) + if (!unitTarget) return; int hurt = 0; @@ -1623,7 +1630,7 @@ void Spell::EffectDummy(uint32 i) return; } - if(m_caster->IsFriendlyTo(unitTarget)) + if (m_caster->IsFriendlyTo(unitTarget)) m_caster->CastSpell(unitTarget, heal, true, 0); else m_caster->CastSpell(unitTarget, hurt, true, 0); @@ -1632,15 +1639,15 @@ void Spell::EffectDummy(uint32 i) } case 561: // Judgement of command { - if(!unitTarget) + if (!unitTarget) return; uint32 spell_id = m_currentBasePoints[i]+1; SpellEntry const* spell_proto = sSpellStore.LookupEntry(spell_id); - if(!spell_proto) + if (!spell_proto) return; - if( !unitTarget->hasUnitState(UNIT_STAT_STUNNED) && m_caster->GetTypeId()==TYPEID_PLAYER) + if (!unitTarget->hasUnitState(UNIT_STAT_STUNNED) && m_caster->GetTypeId()==TYPEID_PLAYER) { // decreased damage (/2) for non-stunned target. SpellModifier *mod = new SpellModifier; @@ -1680,7 +1687,7 @@ void Spell::EffectDummy(uint32 i) // non-standard cast requirement check if (!unitTarget || unitTarget->getAttackers().empty()) { - if(m_caster->GetTypeId()==TYPEID_PLAYER) + if (m_caster->GetTypeId()==TYPEID_PLAYER) ((Player*)m_caster)->RemoveSpellCooldown(m_spellInfo->Id,true); SendCastResult(SPELL_FAILED_TARGET_AFFECTING_COMBAT); return; @@ -1699,7 +1706,7 @@ void Spell::EffectDummy(uint32 i) uint32 count=0; for(Unit::AttackerSet::const_iterator aItr = attackers.begin(); aItr != attackers.end() && count < 3; ++aItr) { - if(!roll_chance_f(chance)) + if (!roll_chance_f(chance)) continue; ++count; AddUnitTarget((*aItr), 1); @@ -1710,7 +1717,7 @@ void Spell::EffectDummy(uint32 i) } case 37877: // Blessing of Faith { - if(!unitTarget) + if (!unitTarget) return; uint32 spell_id = 0; @@ -1746,22 +1753,22 @@ void Spell::EffectDummy(uint32 i) return; } - SpellEntry const *spellInfo = sSpellStore.LookupEntry( spell_id ); + SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id); - if(!spellInfo) + if (!spellInfo) { sLog.outError("WORLD: unknown spell id %i", spell_id); return; } - if(m_caster->GetTypeId() != TYPEID_PLAYER) + if (m_caster->GetTypeId() != TYPEID_PLAYER) return; for(int j = BASE_ATTACK; j <= OFF_ATTACK; ++j) { - if(Item* item = ((Player*)m_caster)->GetWeaponForAttack(WeaponAttackType(j))) + if (Item* item = ((Player*)m_caster)->GetWeaponForAttack(WeaponAttackType(j))) { - if(item->IsFitToSpellRequirements(m_spellInfo)) + if (item->IsFitToSpellRequirements(m_spellInfo)) { Spell *spell = new Spell(m_caster, spellInfo, true); @@ -1779,31 +1786,31 @@ void Spell::EffectDummy(uint32 i) return; } // Cleansing Totem - if((m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000004000000)) && m_spellInfo->SpellIconID==1673) + if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000004000000)) && m_spellInfo->SpellIconID==1673) { m_caster->CastSpell(unitTarget, 52025, true); return; } // Healing Stream Totem - if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000002000)) + if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000002000)) { m_caster->CastCustomSpell(unitTarget, 52042, &damage, 0, 0, true, 0, 0, m_originalCasterGUID); return; } // Mana Spring Totem - if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000004000)) + if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000004000)) { - if(unitTarget->getPowerType()!=POWER_MANA) + if (unitTarget->getPowerType()!=POWER_MANA) return; m_caster->CastCustomSpell(unitTarget, 52032, &damage, 0, 0, true, 0, 0, m_originalCasterGUID); return; } - if(m_spellInfo->Id == 39610) // Mana Tide Totem effect + if (m_spellInfo->Id == 39610) // Mana Tide Totem effect { - if(!unitTarget || unitTarget->getPowerType() != POWER_MANA) + if (!unitTarget || unitTarget->getPowerType() != POWER_MANA) return; // Glyph of Mana Tide - if(Unit *owner = m_caster->GetOwner()) + if (Unit *owner = m_caster->GetOwner()) if (Aura *dummy = owner->GetDummyAura(55441)) damage+=dummy->GetModifier()->m_amount; // Regenerate 6% of Total Mana Every 3 secs @@ -1823,7 +1830,7 @@ void Spell::EffectDummy(uint32 i) Unit::AuraList const& auraDummy = m_caster->GetAurasByType(SPELL_AURA_DUMMY); for(Unit::AuraList::const_iterator itr = auraDummy.begin(); itr != auraDummy.end(); ++itr) { - if( (*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_SHAMAN && + if ((*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_SHAMAN && ((*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000200000)) && (*itr)->GetCastItemGUID() == item->GetGUID()) { @@ -1839,9 +1846,9 @@ void Spell::EffectDummy(uint32 i) // Death Coil if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x002000)) { - if(m_caster->IsFriendlyTo(unitTarget)) + if (m_caster->IsFriendlyTo(unitTarget)) { - if(unitTarget->GetCreatureType() != CREATURE_TYPE_UNDEAD) + if (unitTarget->GetCreatureType() != CREATURE_TYPE_UNDEAD) return; int32 bp = damage * 1.5f; @@ -1867,13 +1874,13 @@ void Spell::EffectDummy(uint32 i) Unit::AuraMap const& auras = unitTarget->GetAuras(); for(Unit::AuraMap::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr) { - if(itr->second->GetSpellProto()->Dispel == DISPEL_DISEASE && + if (itr->second->GetSpellProto()->Dispel == DISPEL_DISEASE && itr->second->GetCasterGUID() == m_caster->GetGUID() && IsSpellLastAuraEffect(itr->second->GetSpellProto(), itr->second->GetEffIndex())) { ++count; // max. 15% - if(count == 3) + if (count == 3) break; } } @@ -1886,7 +1893,7 @@ void Spell::EffectDummy(uint32 i) } // pet auras - if(PetAura const* petSpell = spellmgr.GetPetAura(m_spellInfo->Id, i)) + if (PetAura const* petSpell = spellmgr.GetPetAura(m_spellInfo->Id, i)) { m_caster->AddPetAura(petSpell); return; @@ -1894,11 +1901,11 @@ void Spell::EffectDummy(uint32 i) // Script based implementation. Must be used only for not good for implementation in core spell effects // So called only for not proccessed cases - if(gameObjTarget) + if (gameObjTarget) Script->EffectDummyGameObj(m_caster, m_spellInfo->Id, i, gameObjTarget); - else if(unitTarget && unitTarget->GetTypeId()==TYPEID_UNIT) + else if (unitTarget && unitTarget->GetTypeId()==TYPEID_UNIT) Script->EffectDummyCreature(m_caster, m_spellInfo->Id, i, (Creature*)unitTarget); - else if(itemTarget) + else if (itemTarget) Script->EffectDummyItem(m_caster, m_spellInfo->Id, i, itemTarget); } @@ -2476,22 +2483,22 @@ void Spell::EffectSendEvent(uint32 EffectIndex) void Spell::EffectPowerBurn(uint32 i) { - if(m_spellInfo->EffectMiscValue[i] < 0 || m_spellInfo->EffectMiscValue[i] >= MAX_POWERS) + if (m_spellInfo->EffectMiscValue[i] < 0 || m_spellInfo->EffectMiscValue[i] >= MAX_POWERS) return; Powers powertype = Powers(m_spellInfo->EffectMiscValue[i]); - if(!unitTarget) + if (!unitTarget) return; - if(!unitTarget->isAlive()) + if (!unitTarget->isAlive()) return; - if(unitTarget->getPowerType()!=powertype) + if (unitTarget->getPowerType()!=powertype) return; - if(damage < 0) + if (damage < 0) return; // burn x% of target's mana, up to maximum of 2x% of caster's mana (Mana Burn) - if(m_spellInfo->ManaCostPercentage) + if (m_spellInfo->ManaCostPercentage) { uint32 maxdamage = m_caster->GetMaxPower(powertype) * damage * 2 / 100; damage = unitTarget->GetMaxPower(powertype) * damage / 100; @@ -2502,7 +2509,7 @@ void Spell::EffectPowerBurn(uint32 i) // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4) uint32 power = damage; - if ( powertype == POWER_MANA && unitTarget->GetTypeId() == TYPEID_PLAYER ) + if (powertype == POWER_MANA && unitTarget->GetTypeId() == TYPEID_PLAYER) power -= ((Player*)unitTarget)->GetSpellCritDamageReduction(power); int32 new_damage = (curPower < power) ? curPower : power; @@ -2510,7 +2517,7 @@ void Spell::EffectPowerBurn(uint32 i) unitTarget->ModifyPower(powertype, -new_damage); float multiplier = m_spellInfo->EffectMultipleValue[i]; - if(Player *modOwner = m_caster->GetSpellModOwner()) + if (Player *modOwner = m_caster->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_MULTIPLE_VALUE, multiplier); new_damage = int32(new_damage * multiplier); @@ -2519,7 +2526,7 @@ void Spell::EffectPowerBurn(uint32 i) void Spell::EffectHeal( uint32 /*i*/ ) { - if( unitTarget && unitTarget->isAlive() && damage >= 0) + if (unitTarget && unitTarget->isAlive() && damage >= 0) { // Try to get original caster Unit *caster = m_originalCasterGUID ? m_originalCaster : m_caster; @@ -2537,7 +2544,7 @@ void Spell::EffectHeal( uint32 /*i*/ ) int damageAmount = 0; Unit::AuraList const& mDummyAuras = m_caster->GetAurasByType(SPELL_AURA_DUMMY); for(Unit::AuraList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i) - if((*i)->GetId() == 45062) + if ((*i)->GetId() == 45062) damageAmount+=(*i)->GetModifier()->m_amount; if (damageAmount) m_caster->RemoveAurasDueToSpell(45062); @@ -2556,12 +2563,12 @@ void Spell::EffectHeal( uint32 /*i*/ ) // Regrowth or Rejuvenation 0x40 | 0x10 ((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000050))) { - if(!targetAura || (*i)->GetAuraDuration() < targetAura->GetAuraDuration()) + if (!targetAura || (*i)->GetAuraDuration() < targetAura->GetAuraDuration()) targetAura = *i; } } - if(!targetAura) + if (!targetAura) { sLog.outError("Target (GUID: %u TypeId: %u) has aurastate AURA_STATE_SWIFTMEND but no matching aura.", unitTarget->GetGUIDLow(), unitTarget->GetTypeId()); return; @@ -2578,7 +2585,7 @@ void Spell::EffectHeal( uint32 /*i*/ ) int32 tickcount = GetSpellDuration(targetAura->GetSpellProto()) / targetAura->GetSpellProto()->EffectAmplitude[idx]; // Glyph of Swiftmend - if(!caster->HasAura(54824)) + if (!caster->HasAura(54824)) unitTarget->RemoveAurasDueToSpell(targetAura->GetId()); addhealth += tickheal * tickcount; @@ -2592,7 +2599,7 @@ void Spell::EffectHeal( uint32 /*i*/ ) void Spell::EffectHealPct( uint32 /*i*/ ) { - if( unitTarget && unitTarget->isAlive() && damage >= 0) + if (unitTarget && unitTarget->isAlive() && damage >= 0) { // Try to get original caster Unit *caster = m_originalCasterGUID ? m_originalCaster : m_caster; @@ -2602,7 +2609,7 @@ void Spell::EffectHealPct( uint32 /*i*/ ) return; uint32 addhealth = unitTarget->GetMaxHealth() * damage / 100; - if(Player* modOwner = m_caster->GetSpellModOwner()) + if (Player* modOwner = m_caster->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DAMAGE, addhealth, this); int32 gain = caster->DealHeal(unitTarget, addhealth, m_spellInfo); @@ -2613,7 +2620,7 @@ void Spell::EffectHealPct( uint32 /*i*/ ) void Spell::EffectHealMechanical( uint32 /*i*/ ) { // Mechanic creature type should be correctly checked by targetCreatureType field - if( unitTarget && unitTarget->isAlive() && damage >= 0) + if (unitTarget && unitTarget->isAlive() && damage >= 0) { // Try to get original caster Unit *caster = m_originalCasterGUID ? m_originalCaster : m_caster; @@ -2629,34 +2636,32 @@ void Spell::EffectHealMechanical( uint32 /*i*/ ) void Spell::EffectHealthLeech(uint32 i) { - if(!unitTarget) + if (!unitTarget) return; - if(!unitTarget->isAlive()) + if (!unitTarget->isAlive()) return; - if(damage < 0) + if (damage < 0) return; sLog.outDebug("HealthLeech :%i", damage); float multiplier = m_spellInfo->EffectMultipleValue[i]; - if(Player *modOwner = m_caster->GetSpellModOwner()) + if (Player *modOwner = m_caster->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_MULTIPLE_VALUE, multiplier); int32 new_damage = int32(damage*multiplier); uint32 curHealth = unitTarget->GetHealth(); new_damage = m_caster->SpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, new_damage ); - if(curHealth < new_damage) + if (curHealth < new_damage) new_damage = curHealth; - if(m_caster->isAlive()) + if (m_caster->isAlive()) { new_damage = m_caster->SpellHealingBonus(m_caster, m_spellInfo, new_damage, HEAL); m_caster->DealHeal(m_caster, uint32(new_damage), m_spellInfo); } -// m_healthLeech+=tmpvalue; -// m_damage+=new_damage; } void Spell::DoCreateItem(uint32 i, uint32 itemtype) @@ -2796,7 +2801,7 @@ void Spell::EffectCreateItem(uint32 i) void Spell::EffectCreateItem2(uint32 i) { - if(m_caster->GetTypeId()!=TYPEID_PLAYER) + if (m_caster->GetTypeId()!=TYPEID_PLAYER) return; Player* player = (Player*)m_caster; @@ -2805,9 +2810,9 @@ void Spell::EffectCreateItem2(uint32 i) DoCreateItem(i, item_id); // special case: fake item replaced by generate using spell_loot_template - if(IsLootCraftingSpell(m_spellInfo)) + if (IsLootCraftingSpell(m_spellInfo)) { - if(!player->HasItemCount(item_id, 1)) + if (!player->HasItemCount(item_id, 1)) return; // remove reagent @@ -2821,7 +2826,7 @@ void Spell::EffectCreateItem2(uint32 i) void Spell::EffectCreateRandomItem(uint32 i) { - if(m_caster->GetTypeId()!=TYPEID_PLAYER) + if (m_caster->GetTypeId()!=TYPEID_PLAYER) return; Player* player = (Player*)m_caster; @@ -2833,12 +2838,12 @@ void Spell::EffectPersistentAA(uint32 i) { float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i])); - if(Player* modOwner = m_caster->GetSpellModOwner()) + if (Player* modOwner = m_caster->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius); int32 duration = GetSpellDuration(m_spellInfo); DynamicObject* dynObj = new DynamicObject; - if(!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, i, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, duration, radius)) + if (!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, i, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, duration, radius)) { delete dynObj; return; @@ -2942,18 +2947,18 @@ void Spell::EffectEnergize(uint32 i) void Spell::EffectEnergisePct(uint32 i) { - if(!unitTarget) + if (!unitTarget) return; - if(!unitTarget->isAlive()) + if (!unitTarget->isAlive()) return; - if(m_spellInfo->EffectMiscValue[i] < 0 || m_spellInfo->EffectMiscValue[i] >= MAX_POWERS) + if (m_spellInfo->EffectMiscValue[i] < 0 || m_spellInfo->EffectMiscValue[i] >= MAX_POWERS) return; Powers power = Powers(m_spellInfo->EffectMiscValue[i]); uint32 maxPower = unitTarget->GetMaxPower(power); - if(maxPower == 0) + if (maxPower == 0) return; uint32 gain = damage * maxPower / 100; @@ -2987,7 +2992,7 @@ void Spell::SendLoot(uint64 guid, LootType loottype) case GAMEOBJECT_TYPE_SPELL_FOCUS: // triggering linked GO - if(uint32 trapEntry = gameObjTarget->GetGOInfo()->spellFocus.linkedTrapId) + if (uint32 trapEntry = gameObjTarget->GetGOInfo()->spellFocus.linkedTrapId) gameObjTarget->TriggeringLinkedGameObject(trapEntry,m_caster); return; @@ -3002,7 +3007,7 @@ void Spell::SendLoot(uint64 guid, LootType loottype) // cast goober spell if (gameObjTarget->GetGOInfo()->goober.questId) ///Quest require to be active for GO using - if(player->GetQuestStatus(gameObjTarget->GetGOInfo()->goober.questId) != QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(gameObjTarget->GetGOInfo()->goober.questId) != QUEST_STATUS_INCOMPLETE) return; gameObjTarget->AddUniqueUse(player); @@ -3015,7 +3020,7 @@ void Spell::SendLoot(uint64 guid, LootType loottype) player->CastedCreatureOrGO(gameObjTarget->GetEntry(), gameObjTarget->GetGUID(), 0); // triggering linked GO - if(uint32 trapEntry = gameObjTarget->GetGOInfo()->goober.linkedTrapId) + if (uint32 trapEntry = gameObjTarget->GetGOInfo()->goober.linkedTrapId) gameObjTarget->TriggeringLinkedGameObject(trapEntry,m_caster); return; @@ -3029,7 +3034,7 @@ void Spell::SendLoot(uint64 guid, LootType loottype) } // triggering linked GO - if(uint32 trapEntry = gameObjTarget->GetGOInfo()->chest.linkedTrapId) + if (uint32 trapEntry = gameObjTarget->GetGOInfo()->chest.linkedTrapId) gameObjTarget->TriggeringLinkedGameObject(trapEntry,m_caster); // Don't return, let loots been taken @@ -3044,7 +3049,7 @@ void Spell::SendLoot(uint64 guid, LootType loottype) void Spell::EffectOpenLock(uint32 effIndex) { - if(!m_caster || m_caster->GetTypeId() != TYPEID_PLAYER) + if (!m_caster || m_caster->GetTypeId() != TYPEID_PLAYER) { sLog.outDebug( "WORLD: Open Lock - No Player Caster!"); return; @@ -3056,19 +3061,19 @@ void Spell::EffectOpenLock(uint32 effIndex) uint64 guid = 0; // Get lockId - if(gameObjTarget) + if (gameObjTarget) { GameObjectInfo const* goInfo = gameObjTarget->GetGOInfo(); // Arathi Basin banner opening ! - if( goInfo->type == GAMEOBJECT_TYPE_BUTTON && goInfo->button.noDamageImmune || - goInfo->type == GAMEOBJECT_TYPE_GOOBER && goInfo->goober.losOK ) + if (goInfo->type == GAMEOBJECT_TYPE_BUTTON && goInfo->button.noDamageImmune || + goInfo->type == GAMEOBJECT_TYPE_GOOBER && goInfo->goober.losOK) { //CanUseBattleGroundObject() already called in CheckCast() // in battleground check - if(BattleGround *bg = player->GetBattleGround()) + if (BattleGround *bg = player->GetBattleGround()) { // check if it's correct bg - if(bg && bg->GetTypeID() == BATTLEGROUND_AB) + if (bg && bg->GetTypeID() == BATTLEGROUND_AB) bg->EventPlayerClickedOnFlag(player, gameObjTarget); return; } @@ -3077,9 +3082,9 @@ void Spell::EffectOpenLock(uint32 effIndex) { //CanUseBattleGroundObject() already called in CheckCast() // in battleground check - if(BattleGround *bg = player->GetBattleGround()) + if (BattleGround *bg = player->GetBattleGround()) { - if(bg->GetTypeID() == BATTLEGROUND_EY) + if (bg->GetTypeID() == BATTLEGROUND_EY) bg->EventPlayerClickedOnFlag(player, gameObjTarget); return; } @@ -3087,7 +3092,7 @@ void Spell::EffectOpenLock(uint32 effIndex) lockId = goInfo->GetLockId(); guid = gameObjTarget->GetGUID(); } - else if(itemTarget) + else if (itemTarget) { lockId = itemTarget->GetProto()->LockID; guid = itemTarget->GetGUID(); @@ -3103,7 +3108,7 @@ void Spell::EffectOpenLock(uint32 effIndex) int32 skillValue; SpellCastResult res = CanOpenLock(effIndex, lockId, skillId, reqSkillValue, skillValue); - if(res != SPELL_CAST_OK) + if (res != SPELL_CAST_OK) { SendCastResult(res); return; @@ -3112,19 +3117,19 @@ void Spell::EffectOpenLock(uint32 effIndex) SendLoot(guid, LOOT_SKINNING); // not allow use skill grow at item base open - if(!m_CastItem && skillId != SKILL_NONE) + if (!m_CastItem && skillId != SKILL_NONE) { // update skill if really known - if(uint32 pureSkillValue = player->GetPureSkillValue(skillId)) + if (uint32 pureSkillValue = player->GetPureSkillValue(skillId)) { - if(gameObjTarget) + if (gameObjTarget) { // Allow one skill-up until respawned - if ( !gameObjTarget->IsInSkillupList( player->GetGUIDLow() ) && - player->UpdateGatherSkill(skillId, pureSkillValue, reqSkillValue) ) - gameObjTarget->AddToSkillupList( player->GetGUIDLow() ); + if (!gameObjTarget->IsInSkillupList(player->GetGUIDLow()) && + player->UpdateGatherSkill(skillId, pureSkillValue, reqSkillValue)) + gameObjTarget->AddToSkillupList(player->GetGUIDLow()); } - else if(itemTarget) + else if (itemTarget) { // Do one skill-up player->UpdateGatherSkill(skillId, pureSkillValue, reqSkillValue); @@ -3135,51 +3140,51 @@ void Spell::EffectOpenLock(uint32 effIndex) void Spell::EffectSummonChangeItem(uint32 i) { - if(m_caster->GetTypeId() != TYPEID_PLAYER) + if (m_caster->GetTypeId() != TYPEID_PLAYER) return; Player *player = (Player*)m_caster; // applied only to using item - if(!m_CastItem) + if (!m_CastItem) return; // ... only to item in own inventory/bank/equip_slot - if(m_CastItem->GetOwnerGUID()!=player->GetGUID()) + if (m_CastItem->GetOwnerGUID()!=player->GetGUID()) return; uint32 newitemid = m_spellInfo->EffectItemType[i]; - if(!newitemid) + if (!newitemid) return; uint16 pos = m_CastItem->GetPos(); Item *pNewItem = Item::CreateItem( newitemid, 1, player); - if( !pNewItem ) + if (!pNewItem) return; for(uint8 j= PERM_ENCHANTMENT_SLOT; j<=TEMP_ENCHANTMENT_SLOT; ++j) { - if(m_CastItem->GetEnchantmentId(EnchantmentSlot(j))) + if (m_CastItem->GetEnchantmentId(EnchantmentSlot(j))) pNewItem->SetEnchantment(EnchantmentSlot(j), m_CastItem->GetEnchantmentId(EnchantmentSlot(j)), m_CastItem->GetEnchantmentDuration(EnchantmentSlot(j)), m_CastItem->GetEnchantmentCharges(EnchantmentSlot(j))); } - if(m_CastItem->GetUInt32Value(ITEM_FIELD_DURABILITY) < m_CastItem->GetUInt32Value(ITEM_FIELD_MAXDURABILITY)) + if (m_CastItem->GetUInt32Value(ITEM_FIELD_DURABILITY) < m_CastItem->GetUInt32Value(ITEM_FIELD_MAXDURABILITY)) { double loosePercent = 1 - m_CastItem->GetUInt32Value(ITEM_FIELD_DURABILITY) / double(m_CastItem->GetUInt32Value(ITEM_FIELD_MAXDURABILITY)); player->DurabilityLoss(pNewItem, loosePercent); } - if( player->IsInventoryPos( pos ) ) + if (player->IsInventoryPos(pos)) { ItemPosCountVec dest; uint8 msg = player->CanStoreItem( m_CastItem->GetBagSlot(), m_CastItem->GetSlot(), dest, pNewItem, true ); - if( msg == EQUIP_ERR_OK ) + if (msg == EQUIP_ERR_OK) { player->DestroyItem(m_CastItem->GetBagSlot(), m_CastItem->GetSlot(), true); // prevent crash at access and unexpected charges counting with item update queue corrupt - if(m_CastItem==m_targets.getItemTarget()) + if (m_CastItem==m_targets.getItemTarget()) m_targets.setItemTarget(NULL); m_CastItem = NULL; @@ -3188,16 +3193,16 @@ void Spell::EffectSummonChangeItem(uint32 i) return; } } - else if( player->IsBankPos ( pos ) ) + else if (player->IsBankPos (pos)) { ItemPosCountVec dest; uint8 msg = player->CanBankItem( m_CastItem->GetBagSlot(), m_CastItem->GetSlot(), dest, pNewItem, true ); - if( msg == EQUIP_ERR_OK ) + if (msg == EQUIP_ERR_OK) { player->DestroyItem(m_CastItem->GetBagSlot(), m_CastItem->GetSlot(), true); // prevent crash at access and unexpected charges counting with item update queue corrupt - if(m_CastItem==m_targets.getItemTarget()) + if (m_CastItem==m_targets.getItemTarget()) m_targets.setItemTarget(NULL); m_CastItem = NULL; @@ -3206,16 +3211,16 @@ void Spell::EffectSummonChangeItem(uint32 i) return; } } - else if( player->IsEquipmentPos ( pos ) ) + else if (player->IsEquipmentPos (pos)) { uint16 dest; uint8 msg = player->CanEquipItem( m_CastItem->GetSlot(), dest, pNewItem, true ); - if( msg == EQUIP_ERR_OK ) + if (msg == EQUIP_ERR_OK) { player->DestroyItem(m_CastItem->GetBagSlot(), m_CastItem->GetSlot(), true); // prevent crash at access and unexpected charges counting with item update queue corrupt - if(m_CastItem==m_targets.getItemTarget()) + if (m_CastItem==m_targets.getItemTarget()) m_targets.setItemTarget(NULL); m_CastItem = NULL; @@ -3237,12 +3242,12 @@ void Spell::EffectProficiency(uint32 /*i*/) Player *p_target = (Player*)unitTarget; uint32 subClassMask = m_spellInfo->EquippedItemSubClassMask; - if(m_spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON && !(p_target->GetWeaponProficiency() & subClassMask)) + if (m_spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON && !(p_target->GetWeaponProficiency() & subClassMask)) { p_target->AddWeaponProficiency(subClassMask); p_target->SendProficiency(ITEM_CLASS_WEAPON, p_target->GetWeaponProficiency()); } - if(m_spellInfo->EquippedItemClass == ITEM_CLASS_ARMOR && !(p_target->GetArmorProficiency() & subClassMask)) + if (m_spellInfo->EquippedItemClass == ITEM_CLASS_ARMOR && !(p_target->GetArmorProficiency() & subClassMask)) { p_target->AddArmorProficiency(subClassMask); p_target->SendProficiency(ITEM_CLASS_ARMOR, p_target->GetArmorProficiency()); @@ -3251,9 +3256,9 @@ void Spell::EffectProficiency(uint32 /*i*/) void Spell::EffectApplyAreaAura(uint32 i) { - if(!unitTarget) + if (!unitTarget) return; - if(!unitTarget->isAlive()) + if (!unitTarget->isAlive()) return; AreaAura* Aur = new AreaAura(m_spellInfo, i, &m_currentBasePoints[i], unitTarget, m_caster, m_CastItem); @@ -3313,22 +3318,22 @@ void Spell::EffectSummonType(uint32 i) void Spell::EffectSummon(uint32 i) { - if(m_caster->GetPetGUID()) + if (m_caster->GetPetGUID()) return; - if(!unitTarget) + if (!unitTarget) return; uint32 pet_entry = m_spellInfo->EffectMiscValue[i]; - if(!pet_entry) + if (!pet_entry) return; uint32 level = m_caster->getLevel(); Pet* spawnCreature = new Pet(SUMMON_PET); - if(m_caster->GetTypeId()==TYPEID_PLAYER && spawnCreature->LoadPetFromDB((Player*)m_caster,pet_entry)) + if (m_caster->GetTypeId()==TYPEID_PLAYER && spawnCreature->LoadPetFromDB((Player*)m_caster,pet_entry)) { // Summon in dest location float x, y, z; - if(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) + if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) { x = m_targets.m_destX; y = m_targets.m_destY; @@ -3338,7 +3343,7 @@ void Spell::EffectSummon(uint32 i) // set timer for unsummon int32 duration = GetSpellDuration(m_spellInfo); - if(duration > 0) + if (duration > 0) spawnCreature->SetDuration(duration); return; @@ -3346,7 +3351,7 @@ void Spell::EffectSummon(uint32 i) Map *map = m_caster->GetMap(); uint32 pet_number = objmgr.GeneratePetNumber(); - if(!spawnCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(), + if (!spawnCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map, m_caster->GetPhaseMask(), m_spellInfo->EffectMiscValue[i], pet_number)) { sLog.outErrorDb("Spell::EffectSummon: no such creature entry %u",m_spellInfo->EffectMiscValue[i]); @@ -3356,7 +3361,7 @@ void Spell::EffectSummon(uint32 i) // Summon in dest location float x, y, z; - if(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) + if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) { x = m_targets.m_destX; y = m_targets.m_destY; @@ -3367,7 +3372,7 @@ void Spell::EffectSummon(uint32 i) spawnCreature->Relocate(x, y, z, -m_caster->GetOrientation()); - if(!spawnCreature->IsPositionValid()) + if (!spawnCreature->IsPositionValid()) { sLog.outError("Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)", spawnCreature->GetGUIDLow(), spawnCreature->GetEntry(), spawnCreature->GetPositionX(), spawnCreature->GetPositionY()); @@ -3377,7 +3382,7 @@ void Spell::EffectSummon(uint32 i) // set timer for unsummon int32 duration = GetSpellDuration(m_spellInfo); - if(duration > 0) + if (duration > 0) spawnCreature->SetDuration(duration); spawnCreature->SetOwnerGUID(m_caster->GetGUID()); @@ -3411,7 +3416,7 @@ void Spell::EffectSummon(uint32 i) m_caster->SetPet(spawnCreature); - if(m_caster->GetTypeId() == TYPEID_PLAYER) + if (m_caster->GetTypeId() == TYPEID_PLAYER) { spawnCreature->GetCharmInfo()->SetReactState( REACT_DEFENSIVE ); spawnCreature->SavePetToDB(PET_SAVE_AS_CURRENT); @@ -3421,12 +3426,12 @@ void Spell::EffectSummon(uint32 i) void Spell::EffectLearnSpell(uint32 i) { - if(!unitTarget) + if (!unitTarget) return; - if(unitTarget->GetTypeId() != TYPEID_PLAYER) + if (unitTarget->GetTypeId() != TYPEID_PLAYER) { - if(m_caster->GetTypeId() == TYPEID_PLAYER) + if (m_caster->GetTypeId() == TYPEID_PLAYER) EffectLearnPetSpell(i); return; @@ -3442,7 +3447,7 @@ void Spell::EffectLearnSpell(uint32 i) void Spell::EffectDispel(uint32 i) { - if(!unitTarget) + if (!unitTarget) return; // Fill possible dispell list @@ -3467,7 +3472,7 @@ void Spell::EffectDispel(uint32 i) // do not remove positive auras if friendly target // negative auras if non-friendly target - if(positive == unitTarget->IsFriendlyTo(m_caster)) + if (positive == unitTarget->IsFriendlyTo(m_caster)) continue; } // Add aura to dispel list @@ -3599,15 +3604,15 @@ void Spell::EffectDistract(uint32 /*i*/) void Spell::EffectPickPocket(uint32 /*i*/) { - if( m_caster->GetTypeId() != TYPEID_PLAYER ) + if (m_caster->GetTypeId() != TYPEID_PLAYER) return; // victim must be creature and attackable - if( !unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT || m_caster->IsFriendlyTo(unitTarget) ) + if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT || m_caster->IsFriendlyTo(unitTarget)) return; // victim have to be alive and humanoid or undead - if( unitTarget->isAlive() && (unitTarget->GetCreatureTypeMask() &CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD) != 0) + if (unitTarget->isAlive() && (unitTarget->GetCreatureTypeMask() & CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD) != 0) { int32 chance = 10 + int32(m_caster->getLevel()) - int32(unitTarget->getLevel()); @@ -3648,19 +3653,19 @@ void Spell::EffectAddFarsight(uint32 i) void Spell::EffectSummonWild(uint32 i) { uint32 creature_entry = m_spellInfo->EffectMiscValue[i]; - if(!creature_entry) + if (!creature_entry) return; uint32 level = m_caster->getLevel(); // level of creature summoned using engineering item based at engineering skill level - if(m_caster->GetTypeId()==TYPEID_PLAYER && m_CastItem) + if (m_caster->GetTypeId()==TYPEID_PLAYER && m_CastItem) { ItemPrototype const *proto = m_CastItem->GetProto(); - if(proto && proto->RequiredSkill == SKILL_ENGINERING) + if (proto && proto->RequiredSkill == SKILL_ENGINERING) { uint16 skill202 = ((Player*)m_caster)->GetSkillValue(SKILL_ENGINERING); - if(skill202) + if (skill202) { level = skill202/5; } @@ -3708,7 +3713,7 @@ void Spell::EffectSummonWild(uint32 i) void Spell::EffectSummonGuardian(uint32 i) { uint32 pet_entry = m_spellInfo->EffectMiscValue[i]; - if(!pet_entry) + if (!pet_entry) return; // set timer for unsummon @@ -3717,7 +3722,7 @@ void Spell::EffectSummonGuardian(uint32 i) // Search old Guardian only for players (if casted spell not have duration or cooldown) // FIXME: some guardians have control spell applied and controlled by player and anyway player can't summon in this time // so this code hack in fact - if( m_caster->GetTypeId() == TYPEID_PLAYER && (duration <= 0 || GetSpellRecoveryTime(m_spellInfo) == 0) ) + if (m_caster->GetTypeId() == TYPEID_PLAYER && (duration <= 0 || GetSpellRecoveryTime(m_spellInfo) == 0)) if(m_caster->FindGuardianWithEntry(pet_entry)) return; // find old guardian, ignore summon @@ -3725,13 +3730,13 @@ void Spell::EffectSummonGuardian(uint32 i) uint32 level = m_caster->getLevel(); // level of pet summoned using engineering item based at engineering skill level - if(m_caster->GetTypeId() == TYPEID_PLAYER && m_CastItem) + if (m_caster->GetTypeId() == TYPEID_PLAYER && m_CastItem) { ItemPrototype const *proto = m_CastItem->GetProto(); - if(proto && proto->RequiredSkill == SKILL_ENGINERING) + if (proto && proto->RequiredSkill == SKILL_ENGINERING) { uint16 skill202 = ((Player*)m_caster)->GetSkillValue(SKILL_ENGINERING); - if(skill202) + if (skill202) { level = skill202 / 5; } @@ -3753,7 +3758,7 @@ void Spell::EffectSummonGuardian(uint32 i) Map *map = m_caster->GetMap(); uint32 pet_number = objmgr.GeneratePetNumber(); - if(!spawnCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map,m_caster->GetPhaseMask(), + if (!spawnCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map,m_caster->GetPhaseMask(), m_spellInfo->EffectMiscValue[i], pet_number)) { sLog.outError("no such creature entry %u", m_spellInfo->EffectMiscValue[i]); @@ -3782,7 +3787,7 @@ void Spell::EffectSummonGuardian(uint32 i) spawnCreature->Relocate(px, py, pz, m_caster->GetOrientation()); - if(!spawnCreature->IsPositionValid()) + if (!spawnCreature->IsPositionValid()) { sLog.outError("Pet (guidlow %d, entry %d) not created base at creature. Suggested coordinates isn't valid (X: %f Y: %f)", spawnCreature->GetGUIDLow(), spawnCreature->GetEntry(), spawnCreature->GetPositionX(), spawnCreature->GetPositionY()); @@ -3790,7 +3795,7 @@ void Spell::EffectSummonGuardian(uint32 i) return; } - if(duration > 0) + if (duration > 0) spawnCreature->SetDuration(duration); spawnCreature->SetOwnerGUID(m_caster->GetGUID()); @@ -3816,10 +3821,10 @@ void Spell::EffectSummonGuardian(uint32 i) void Spell::EffectTeleUnitsFaceCaster(uint32 i) { - if(!unitTarget) + if (!unitTarget) return; - if(unitTarget->isInFlight()) + if (unitTarget->isInFlight()) return; float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i])); @@ -3832,10 +3837,10 @@ void Spell::EffectTeleUnitsFaceCaster(uint32 i) void Spell::EffectLearnSkill(uint32 i) { - if(unitTarget->GetTypeId() != TYPEID_PLAYER) + if (unitTarget->GetTypeId() != TYPEID_PLAYER) return; - if(damage < 0) + if (damage < 0) return; uint32 skillid = m_spellInfo->EffectMiscValue[i]; @@ -3845,11 +3850,11 @@ void Spell::EffectLearnSkill(uint32 i) void Spell::EffectAddHonor(uint32 /*i*/) { - if(unitTarget->GetTypeId() != TYPEID_PLAYER) + if (unitTarget->GetTypeId() != TYPEID_PLAYER) return; // not scale value for item based reward (/10 value expected) - if(m_CastItem) + if (m_CastItem) { ((Player*)unitTarget)->RewardHonor(NULL, 1, damage / 10); sLog.outError("SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %u", m_spellInfo->Id, damage/10, m_CastItem->GetEntry(),((Player*)unitTarget)->GetGUIDLow()); @@ -3857,7 +3862,7 @@ void Spell::EffectAddHonor(uint32 /*i*/) } // do not allow to add too many honor for player (50 * 21) = 1040 at level 70, or (50 * 31) = 1550 at level 80 - if( damage <= 50) + if (damage <= 50) { uint32 honor_reward = MaNGOS::Honor::hk_honor_at_level(unitTarget->getLevel(), damage); ((Player*)unitTarget)->RewardHonor(NULL, 1, honor_reward); @@ -3873,7 +3878,7 @@ void Spell::EffectAddHonor(uint32 /*i*/) void Spell::EffectTradeSkill(uint32 /*i*/) { - if(unitTarget->GetTypeId() != TYPEID_PLAYER) + if (unitTarget->GetTypeId() != TYPEID_PLAYER) return; // uint32 skillid = m_spellInfo->EffectMiscValue[i]; // uint16 skillmax = ((Player*)unitTarget)->(skillid); @@ -3882,7 +3887,7 @@ void Spell::EffectTradeSkill(uint32 /*i*/) void Spell::EffectEnchantItemPerm(uint32 effect_idx) { - if(m_caster->GetTypeId() != TYPEID_PLAYER) + if (m_caster->GetTypeId() != TYPEID_PLAYER) return; if (!itemTarget) return; @@ -3897,15 +3902,15 @@ void Spell::EffectEnchantItemPerm(uint32 effect_idx) return; SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); - if(!pEnchant) + if (!pEnchant) return; // item can be in trade slot and have owner diff. from caster Player* item_owner = itemTarget->GetOwner(); - if(!item_owner) + if (!item_owner) return; - if(item_owner!=p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE) ) + if (item_owner!=p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE) ) { sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", p_caster->GetName(),p_caster->GetSession()->GetAccountId(), @@ -3924,7 +3929,7 @@ void Spell::EffectEnchantItemPerm(uint32 effect_idx) void Spell::EffectEnchantItemPrismatic(uint32 effect_idx) { - if(m_caster->GetTypeId() != TYPEID_PLAYER) + if (m_caster->GetTypeId() != TYPEID_PLAYER) return; if (!itemTarget) return; @@ -3936,7 +3941,7 @@ void Spell::EffectEnchantItemPrismatic(uint32 effect_idx) return; SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); - if(!pEnchant) + if (!pEnchant) return; // support only enchantings with add socket in this slot @@ -3944,13 +3949,13 @@ void Spell::EffectEnchantItemPrismatic(uint32 effect_idx) bool add_socket = false; for(int i = 0; i < 3; ++i) { - if(pEnchant->type[i]==ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET) + if (pEnchant->type[i]==ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET) { add_socket = true; break; } } - if(!add_socket) + if (!add_socket) { sLog.outError("Spell::EffectEnchantItemPrismatic: attempt apply enchant spell %u with SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC (%u) but without ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET (%u), not suppoted yet.", m_spellInfo->Id,SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC,ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET); @@ -3960,10 +3965,10 @@ void Spell::EffectEnchantItemPrismatic(uint32 effect_idx) // item can be in trade slot and have owner diff. from caster Player* item_owner = itemTarget->GetOwner(); - if(!item_owner) + if (!item_owner) return; - if(item_owner!=p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE) ) + if (item_owner!=p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE) ) { sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", p_caster->GetName(),p_caster->GetSession()->GetAccountId(), @@ -3982,18 +3987,18 @@ void Spell::EffectEnchantItemPrismatic(uint32 effect_idx) void Spell::EffectEnchantItemTmp(uint32 i) { - if(m_caster->GetTypeId() != TYPEID_PLAYER) + if (m_caster->GetTypeId() != TYPEID_PLAYER) return; Player* p_caster = (Player*)m_caster; - if(!itemTarget) + if (!itemTarget) return; uint32 enchant_id = m_spellInfo->EffectMiscValue[i]; // Shaman Rockbiter Weapon - if(i==0 && m_spellInfo->Effect[1]==SPELL_EFFECT_DUMMY) + if (i==0 && m_spellInfo->Effect[1]==SPELL_EFFECT_DUMMY) { int32 enchnting_damage = m_currentBasePoints[1]+1; @@ -5188,7 +5193,7 @@ void Spell::EffectScriptEffect(uint32 effIndex) return; } // Demonic Empowerment - case 47193: + case 47193: { if(!unitTarget) return; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index e3c88796c..5155a3270 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8419" + #define REVISION_NR "8420" #endif // __REVISION_NR_H__