From 2fcd4c381c4b44082fd24afb6e6d11fc242636dc Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Fri, 11 Jan 2013 23:36:23 +0100 Subject: DB/Conditions: Convert shadowstep spell script in conditions --- src/server/scripts/Spells/spell_rogue.cpp | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'src/server/scripts/Spells') diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 01a4225cc00..1a2738afdbb 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -348,35 +348,6 @@ class spell_rog_prey_on_the_weak : public SpellScriptLoader } }; -// 36554 - Shadowstep -class spell_rog_shadowstep : public SpellScriptLoader -{ - public: - spell_rog_shadowstep() : SpellScriptLoader("spell_rog_shadowstep") { } - - class spell_rog_shadowstep_SpellScript : public SpellScript - { - PrepareSpellScript(spell_rog_shadowstep_SpellScript); - - SpellCastResult CheckCast() - { - if (GetCaster()->HasUnitState(UNIT_STATE_ROOT)) - return SPELL_FAILED_ROOTED; - return SPELL_CAST_OK; - } - - void Register() - { - OnCheckCast += SpellCheckCastFn(spell_rog_shadowstep_SpellScript::CheckCast); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_rog_shadowstep_SpellScript(); - } -}; - // 5938 - Shiv class spell_rog_shiv : public SpellScriptLoader { @@ -425,6 +396,5 @@ void AddSC_rogue_spell_scripts() new spell_rog_nerves_of_steel(); new spell_rog_preparation(); new spell_rog_prey_on_the_weak(); - new spell_rog_shadowstep(); new spell_rog_shiv(); } -- cgit v1.2.3 From 95f8068a6f18a64b69e746da4b351d3e1bdac08e Mon Sep 17 00:00:00 2001 From: joschiwald Date: Sat, 12 Jan 2013 02:16:30 +0100 Subject: Misc: Reorder more scripts in some script files and some cosmetic stuff --- src/server/scripts/Spells/spell_druid.cpp | 76 ++-- src/server/scripts/Spells/spell_mage.cpp | 276 +++++++------- src/server/scripts/Spells/spell_paladin.cpp | 539 ++++++++++++++-------------- src/server/scripts/Spells/spell_priest.cpp | 2 - src/server/scripts/Spells/spell_warrior.cpp | 502 +++++++++++++------------- 5 files changed, 700 insertions(+), 695 deletions(-) (limited to 'src/server/scripts/Spells') diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index a0307f994c9..6dd453597de 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -29,18 +29,19 @@ enum DruidSpells { - DRUID_INCREASED_MOONFIRE_DURATION = 38414, - DRUID_NATURES_SPLENDOR = 57865, - DRUID_LIFEBLOOM_FINAL_HEAL = 33778, - DRUID_LIFEBLOOM_ENERGIZE = 64372, - DRUID_SURVIVAL_INSTINCTS = 50322, - DRUID_SAVAGE_ROAR = 62071, - SPELL_DRUID_ITEM_T8_BALANCE_RELIC = 64950, - SPELL_KING_OF_THE_JUNGLE = 48492, - SPELL_TIGER_S_FURY_ENERGIZE = 51178, - SPELL_ENRAGE_MOD_DAMAGE = 51185, + SPELL_DRUID_ENRAGE_MOD_DAMAGE = 51185, + SPELL_DRUID_INCREASED_MOONFIRE_DURATION = 38414, + SPELL_DRUID_KING_OF_THE_JUNGLE = 48492, + SPELL_DRUID_LIFEBLOOM_ENERGIZE = 64372, + SPELL_DRUID_LIFEBLOOM_FINAL_HEAL = 33778, + SPELL_DRUID_NATURES_SPLENDOR = 57865, + SPELL_DRUID_SURVIVAL_INSTINCTS = 50322, + SPELL_DRUID_SAVAGE_ROAR = 62071, + SPELL_DRUID_TIGER_S_FURY_ENERGIZE = 51178, + SPELL_DRUID_ITEM_T8_BALANCE_RELIC = 64950, }; +// -5229 - Enrage class spell_dru_enrage : public SpellScriptLoader { public: @@ -52,8 +53,8 @@ class spell_dru_enrage : public SpellScriptLoader void OnHit() { - if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_KING_OF_THE_JUNGLE, EFFECT_0)) - GetHitUnit()->CastCustomSpell(SPELL_ENRAGE_MOD_DAMAGE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetHitUnit(), true); + if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_DRUID_KING_OF_THE_JUNGLE, EFFECT_0)) + GetHitUnit()->CastCustomSpell(SPELL_DRUID_ENRAGE_MOD_DAMAGE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetHitUnit(), true); } void Register() @@ -68,7 +69,7 @@ class spell_dru_enrage : public SpellScriptLoader } }; -// 54846 Glyph of Starfire +// 54846 - Glyph of Starfire class spell_dru_glyph_of_starfire : public SpellScriptLoader { public: @@ -78,9 +79,9 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader { PrepareSpellScript(spell_dru_glyph_of_starfire_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(DRUID_INCREASED_MOONFIRE_DURATION) || !sSpellMgr->GetSpellInfo(DRUID_NATURES_SPLENDOR)) + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_INCREASED_MOONFIRE_DURATION) || !sSpellMgr->GetSpellInfo(SPELL_DRUID_NATURES_SPLENDOR)) return false; return true; } @@ -95,9 +96,9 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader uint32 countMin = aura->GetMaxDuration(); uint32 countMax = aura->GetSpellInfo()->GetMaxDuration() + 9000; - if (caster->HasAura(DRUID_INCREASED_MOONFIRE_DURATION)) + if (caster->HasAura(SPELL_DRUID_INCREASED_MOONFIRE_DURATION)) countMax += 3000; - if (caster->HasAura(DRUID_NATURES_SPLENDOR)) + if (caster->HasAura(SPELL_DRUID_NATURES_SPLENDOR)) countMax += 3000; if (countMin < countMax) @@ -120,6 +121,7 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader } }; +// -5570 - Insect Swarm class spell_dru_insect_swarm : public SpellScriptLoader { public: @@ -148,6 +150,7 @@ class spell_dru_insect_swarm : public SpellScriptLoader } }; +// -33763 - Lifebloom class spell_dru_lifebloom : public SpellScriptLoader { public: @@ -159,9 +162,9 @@ class spell_dru_lifebloom : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(DRUID_LIFEBLOOM_FINAL_HEAL)) + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_LIFEBLOOM_FINAL_HEAL)) return false; - if (!sSpellMgr->GetSpellInfo(DRUID_LIFEBLOOM_ENERGIZE)) + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_LIFEBLOOM_ENERGIZE)) return false; return true; } @@ -180,15 +183,15 @@ class spell_dru_lifebloom : public SpellScriptLoader healAmount = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, HEAL, stack); healAmount = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, stack); - GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); + GetTarget()->CastCustomSpell(GetTarget(), SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); // restore mana int32 returnMana = CalculatePct(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2; - caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); + caster->CastCustomSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); return; } - GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); + GetTarget()->CastCustomSpell(GetTarget(), SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); } void HandleDispel(DispelInfo* dispelInfo) @@ -203,15 +206,15 @@ class spell_dru_lifebloom : public SpellScriptLoader { healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges()); healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges()); - target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID()); + target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID()); // restore mana int32 returnMana = CalculatePct(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * dispelInfo->GetRemovedCharges() / 2; - caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID()); + caster->CastCustomSpell(caster, SPELL_DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID()); return; } - target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID()); + target->CastCustomSpell(target, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID()); } } } @@ -273,6 +276,7 @@ class spell_dru_moonkin_form_passive : public SpellScriptLoader } }; +// -16972 - Predatory Strikes class spell_dru_predatory_strikes : public SpellScriptLoader { public: @@ -388,6 +392,7 @@ class spell_dru_savage_defense : public SpellScriptLoader } }; +// 52610 - Savage Roar class spell_dru_savage_roar : public SpellScriptLoader { public: @@ -418,7 +423,7 @@ class spell_dru_savage_roar : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(DRUID_SAVAGE_ROAR)) + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_SAVAGE_ROAR)) return false; return true; } @@ -426,12 +431,12 @@ class spell_dru_savage_roar : public SpellScriptLoader void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { Unit* target = GetTarget(); - target->CastSpell(target, DRUID_SAVAGE_ROAR, true, NULL, aurEff, GetCasterGUID()); + target->CastSpell(target, SPELL_DRUID_SAVAGE_ROAR, true, NULL, aurEff, GetCasterGUID()); } void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - GetTarget()->RemoveAurasDueToSpell(DRUID_SAVAGE_ROAR); + GetTarget()->RemoveAurasDueToSpell(SPELL_DRUID_SAVAGE_ROAR); } void Register() @@ -452,6 +457,7 @@ class spell_dru_savage_roar : public SpellScriptLoader } }; +// -50294 - Starfall (AOE) class spell_dru_starfall_aoe : public SpellScriptLoader { public: @@ -478,6 +484,7 @@ class spell_dru_starfall_aoe : public SpellScriptLoader } }; +// -50286 - Starfall (Dummy) class spell_dru_starfall_dummy : public SpellScriptLoader { public: @@ -523,6 +530,7 @@ class spell_dru_starfall_dummy : public SpellScriptLoader } }; +// 61336 - Survival Instincts class spell_dru_survival_instincts : public SpellScriptLoader { public: @@ -553,7 +561,7 @@ class spell_dru_survival_instincts : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(DRUID_SURVIVAL_INSTINCTS)) + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_SURVIVAL_INSTINCTS)) return false; return true; } @@ -562,12 +570,12 @@ class spell_dru_survival_instincts : public SpellScriptLoader { Unit* target = GetTarget(); int32 bp0 = target->CountPctFromMaxHealth(aurEff->GetAmount()); - target->CastCustomSpell(target, DRUID_SURVIVAL_INSTINCTS, &bp0, NULL, NULL, true); + target->CastCustomSpell(target, SPELL_DRUID_SURVIVAL_INSTINCTS, &bp0, NULL, NULL, true); } void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - GetTarget()->RemoveAurasDueToSpell(DRUID_SURVIVAL_INSTINCTS); + GetTarget()->RemoveAurasDueToSpell(SPELL_DRUID_SURVIVAL_INSTINCTS); } void Register() @@ -622,6 +630,7 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader } }; +// -5217 - Tiger's Fury class spell_dru_tiger_s_fury : public SpellScriptLoader { public: @@ -633,8 +642,8 @@ class spell_dru_tiger_s_fury : public SpellScriptLoader void OnHit() { - if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_KING_OF_THE_JUNGLE, EFFECT_1)) - GetHitUnit()->CastCustomSpell(SPELL_TIGER_S_FURY_ENERGIZE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetHitUnit(), true); + if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_DRUID_KING_OF_THE_JUNGLE, EFFECT_1)) + GetHitUnit()->CastCustomSpell(SPELL_DRUID_TIGER_S_FURY_ENERGIZE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetHitUnit(), true); } void Register() @@ -649,6 +658,7 @@ class spell_dru_tiger_s_fury : public SpellScriptLoader } }; +// 70691 - Item T10 Restoration 4P Bonus class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader { public: diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index cf10cfdab5c..61f0579190f 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -29,6 +29,10 @@ enum MageSpells { SPELL_MAGE_COLD_SNAP = 11958, + SPELL_MAGE_FROST_WARDING_R1 = 28332, + SPELL_MAGE_FROST_WARDING_TRIGGERED = 57776, + SPELL_MAGE_INCANTERS_ABSORBTION_R1 = 44394, + SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED = 44413, SPELL_MAGE_SQUIRREL_FORM = 32813, SPELL_MAGE_GIRAFFE_FORM = 32816, SPELL_MAGE_SERPENT_FORM = 32817, @@ -41,6 +45,7 @@ enum MageSpells SPELL_MAGE_GLYPH_OF_BLAST_WAVE = 62126, }; +// -11113 - Blast Wave class spell_mage_blast_wave : public SpellScriptLoader { public: @@ -50,7 +55,7 @@ class spell_mage_blast_wave : public SpellScriptLoader { PrepareSpellScript(spell_mage_blast_wave_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_GLYPH_OF_BLAST_WAVE)) return false; @@ -75,6 +80,7 @@ class spell_mage_blast_wave : public SpellScriptLoader } }; +// 11958 - Cold Snap class spell_mage_cold_snap : public SpellScriptLoader { public: @@ -91,7 +97,6 @@ class spell_mage_cold_snap : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { - Player* caster = GetCaster()->ToPlayer(); // immediately finishes the cooldown on Frost spells const SpellCooldowns& cm = caster->GetSpellCooldownMap(); @@ -112,7 +117,6 @@ class spell_mage_cold_snap : public SpellScriptLoader void Register() { - // add dummy effect spell handler to Cold Snap OnEffectHit += SpellEffectFn(spell_mage_cold_snap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; @@ -123,102 +127,7 @@ class spell_mage_cold_snap : public SpellScriptLoader } }; -enum SilvermoonPolymorph -{ - NPC_AUROSALIA = 18744, -}; - -// TODO: move out of here and rename - not a mage spell -class spell_mage_polymorph_cast_visual : public SpellScriptLoader -{ - public: - spell_mage_polymorph_cast_visual() : SpellScriptLoader("spell_mage_polymorph_visual") { } - - class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript - { - PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript); - - static const uint32 PolymorhForms[6]; - - bool Validate(SpellInfo const* /*spellEntry*/) - { - // check if spell ids exist in dbc - for (uint32 i = 0; i < 6; i++) - if (!sSpellMgr->GetSpellInfo(PolymorhForms[i])) - return false; - return true; - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - if (Unit* target = GetCaster()->FindNearestCreature(NPC_AUROSALIA, 30.0f)) - if (target->GetTypeId() == TYPEID_UNIT) - target->CastSpell(target, PolymorhForms[urand(0, 5)], true); - } - - void Register() - { - // add dummy effect spell handler to Polymorph visual - OnEffectHitTarget += SpellEffectFn(spell_mage_polymorph_cast_visual_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_mage_polymorph_cast_visual_SpellScript(); - } -}; - -const uint32 spell_mage_polymorph_cast_visual::spell_mage_polymorph_cast_visual_SpellScript::PolymorhForms[6] = -{ - SPELL_MAGE_SQUIRREL_FORM, - SPELL_MAGE_GIRAFFE_FORM, - SPELL_MAGE_SERPENT_FORM, - SPELL_MAGE_DRAGONHAWK_FORM, - SPELL_MAGE_WORGEN_FORM, - SPELL_MAGE_SHEEP_FORM -}; - -class spell_mage_summon_water_elemental : public SpellScriptLoader -{ - public: - spell_mage_summon_water_elemental() : SpellScriptLoader("spell_mage_summon_water_elemental") { } - - class spell_mage_summon_water_elemental_SpellScript : public SpellScript - { - PrepareSpellScript(spell_mage_summon_water_elemental_SpellScript); - - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT)) - return false; - return true; - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - // Glyph of Eternal Water - if (caster->HasAura(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER)) - caster->CastSpell(caster, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT, true); - else - caster->CastSpell(caster, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY, true); - } - - void Register() - { - // add dummy effect spell handler to Summon Water Elemental - OnEffectHit += SpellEffectFn(spell_mage_summon_water_elemental_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_mage_summon_water_elemental_SpellScript(); - } -}; - -// Frost Warding +// -543, -6143 - Frost Warding class spell_mage_frost_warding_trigger : public SpellScriptLoader { public: @@ -228,13 +137,7 @@ class spell_mage_frost_warding_trigger : public SpellScriptLoader { PrepareAuraScript(spell_mage_frost_warding_trigger_AuraScript); - enum Spells - { - SPELL_MAGE_FROST_WARDING_TRIGGERED = 57776, - SPELL_MAGE_FROST_WARDING_R1 = 28332, - }; - - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_TRIGGERED) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_R1)) return false; @@ -274,13 +177,8 @@ class spell_mage_frost_warding_trigger : public SpellScriptLoader class spell_mage_incanters_absorbtion_base_AuraScript : public AuraScript { public: - enum Spells - { - SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED = 44413, - SPELL_MAGE_INCANTERS_ABSORBTION_R1 = 44394, - }; - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { return sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED) && sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_R1); @@ -298,50 +196,51 @@ class spell_mage_incanters_absorbtion_base_AuraScript : public AuraScript } }; -// Incanter's Absorption +// -543, -6143, -11426 - Incanter's Absorption class spell_mage_incanters_absorbtion_absorb : public SpellScriptLoader { -public: - spell_mage_incanters_absorbtion_absorb() : SpellScriptLoader("spell_mage_incanters_absorbtion_absorb") { } + public: + spell_mage_incanters_absorbtion_absorb() : SpellScriptLoader("spell_mage_incanters_absorbtion_absorb") { } + + class spell_mage_incanters_absorbtion_absorb_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript + { + PrepareAuraScript(spell_mage_incanters_absorbtion_absorb_AuraScript); - class spell_mage_incanters_absorbtion_absorb_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript - { - PrepareAuraScript(spell_mage_incanters_absorbtion_absorb_AuraScript); + void Register() + { + AfterEffectAbsorb += AuraEffectAbsorbFn(spell_mage_incanters_absorbtion_absorb_AuraScript::Trigger, EFFECT_0); + } + }; - void Register() + AuraScript* GetAuraScript() const { - AfterEffectAbsorb += AuraEffectAbsorbFn(spell_mage_incanters_absorbtion_absorb_AuraScript::Trigger, EFFECT_0); + return new spell_mage_incanters_absorbtion_absorb_AuraScript(); } - }; - - AuraScript* GetAuraScript() const - { - return new spell_mage_incanters_absorbtion_absorb_AuraScript(); - } }; -// Incanter's Absorption +// -1463 - Incanter's Absorption class spell_mage_incanters_absorbtion_manashield : public SpellScriptLoader { -public: - spell_mage_incanters_absorbtion_manashield() : SpellScriptLoader("spell_mage_incanters_absorbtion_manashield") { } + public: + spell_mage_incanters_absorbtion_manashield() : SpellScriptLoader("spell_mage_incanters_absorbtion_manashield") { } - class spell_mage_incanters_absorbtion_manashield_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript - { - PrepareAuraScript(spell_mage_incanters_absorbtion_manashield_AuraScript); + class spell_mage_incanters_absorbtion_manashield_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript + { + PrepareAuraScript(spell_mage_incanters_absorbtion_manashield_AuraScript); - void Register() + void Register() + { + AfterEffectManaShield += AuraEffectManaShieldFn(spell_mage_incanters_absorbtion_manashield_AuraScript::Trigger, EFFECT_0); + } + }; + + AuraScript* GetAuraScript() const { - AfterEffectManaShield += AuraEffectManaShieldFn(spell_mage_incanters_absorbtion_manashield_AuraScript::Trigger, EFFECT_0); + return new spell_mage_incanters_absorbtion_manashield_AuraScript(); } - }; - - AuraScript* GetAuraScript() const - { - return new spell_mage_incanters_absorbtion_manashield_AuraScript(); - } }; +// -44457 - Living Bomb class spell_mage_living_bomb : public SpellScriptLoader { public: @@ -380,6 +279,101 @@ class spell_mage_living_bomb : public SpellScriptLoader } }; +enum SilvermoonPolymorph +{ + NPC_AUROSALIA = 18744, +}; + +// TODO: move out of here and rename - not a mage spell +// 32826 - Polymorph (Visual) +class spell_mage_polymorph_cast_visual : public SpellScriptLoader +{ + public: + spell_mage_polymorph_cast_visual() : SpellScriptLoader("spell_mage_polymorph_visual") { } + + class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript); + + static const uint32 PolymorhForms[6]; + + bool Validate(SpellInfo const* /*spellInfo*/) + { + // check if spell ids exist in dbc + for (uint32 i = 0; i < 6; ++i) + if (!sSpellMgr->GetSpellInfo(PolymorhForms[i])) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetCaster()->FindNearestCreature(NPC_AUROSALIA, 30.0f)) + if (target->GetTypeId() == TYPEID_UNIT) + target->CastSpell(target, PolymorhForms[urand(0, 5)], true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_mage_polymorph_cast_visual_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_mage_polymorph_cast_visual_SpellScript(); + } +}; + +const uint32 spell_mage_polymorph_cast_visual::spell_mage_polymorph_cast_visual_SpellScript::PolymorhForms[6] = +{ + SPELL_MAGE_SQUIRREL_FORM, + SPELL_MAGE_GIRAFFE_FORM, + SPELL_MAGE_SERPENT_FORM, + SPELL_MAGE_DRAGONHAWK_FORM, + SPELL_MAGE_WORGEN_FORM, + SPELL_MAGE_SHEEP_FORM +}; + +// 31687 - Summon Water Elemental +class spell_mage_summon_water_elemental : public SpellScriptLoader +{ + public: + spell_mage_summon_water_elemental() : SpellScriptLoader("spell_mage_summon_water_elemental") { } + + class spell_mage_summon_water_elemental_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mage_summon_water_elemental_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + // Glyph of Eternal Water + if (caster->HasAura(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER)) + caster->CastSpell(caster, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT, true); + else + caster->CastSpell(caster, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY, true); + } + + void Register() + { + OnEffectHit += SpellEffectFn(spell_mage_summon_water_elemental_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_mage_summon_water_elemental_SpellScript(); + } +}; + void AddSC_mage_spell_scripts() { new spell_mage_blast_wave(); @@ -387,7 +381,7 @@ void AddSC_mage_spell_scripts() new spell_mage_frost_warding_trigger(); new spell_mage_incanters_absorbtion_absorb(); new spell_mage_incanters_absorbtion_manashield(); + new spell_mage_living_bomb(); new spell_mage_polymorph_cast_visual(); new spell_mage_summon_water_elemental(); - new spell_mage_living_bomb(); } diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 07d903c9587..d3fc86302e1 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -29,28 +29,28 @@ enum PaladinSpells { - PALADIN_SPELL_DIVINE_PLEA = 54428, - PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF = 67480, + SPELL_PALADIN_DIVINE_PLEA = 54428, + SPELL_PALADIN_BLESSING_OF_SANCTUARY_BUFF = 67480, - PALADIN_SPELL_HOLY_SHOCK_R1 = 20473, - PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE = 25912, - PALADIN_SPELL_HOLY_SHOCK_R1_HEALING = 25914, + SPELL_PALADIN_HOLY_SHOCK_R1 = 20473, + SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE = 25912, + SPELL_PALADIN_HOLY_SHOCK_R1_HEALING = 25914, - SPELL_BLESSING_OF_LOWER_CITY_DRUID = 37878, - SPELL_BLESSING_OF_LOWER_CITY_PALADIN = 37879, - SPELL_BLESSING_OF_LOWER_CITY_PRIEST = 37880, - SPELL_BLESSING_OF_LOWER_CITY_SHAMAN = 37881, + SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID = 37878, + SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PALADIN = 37879, + SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PRIEST = 37880, + SPELL_PALADIN_BLESSING_OF_LOWER_CITY_SHAMAN = 37881, - SPELL_DIVINE_STORM = 53385, - SPELL_DIVINE_STORM_DUMMY = 54171, - SPELL_DIVINE_STORM_HEAL = 54172, + SPELL_PALADIN_DIVINE_STORM = 53385, + SPELL_PALADIN_DIVINE_STORM_DUMMY = 54171, + SPELL_PALADIN_DIVINE_STORM_HEAL = 54172, - SPELL_FORBEARANCE = 25771, - SPELL_AVENGING_WRATH_MARKER = 61987, - SPELL_IMMUNE_SHIELD_MARKER = 61988, + SPELL_PALADIN_FORBEARANCE = 25771, + SPELL_PALADIN_AVENGING_WRATH_MARKER = 61987, + SPELL_PALADIN_IMMUNE_SHIELD_MARKER = 61988, - SPELL_HAND_OF_SACRIFICE = 6940, - SPELL_DIVINE_SACRIFICE = 64205, + SPELL_PALADIN_HAND_OF_SACRIFICE = 6940, + SPELL_PALADIN_DIVINE_SACRIFICE = 64205, }; // 31850 - Ardent Defender @@ -129,6 +129,7 @@ class spell_pal_ardent_defender : public SpellScriptLoader } }; +// 37877 - Blessing of Faith class spell_pal_blessing_of_faith : public SpellScriptLoader { public: @@ -138,9 +139,9 @@ class spell_pal_blessing_of_faith : public SpellScriptLoader { PrepareSpellScript(spell_pal_blessing_of_faith_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_DRUID) || !sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_PALADIN) || !sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_PRIEST) || !sSpellMgr->GetSpellInfo(SPELL_BLESSING_OF_LOWER_CITY_SHAMAN)) + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID) || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PALADIN) || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PRIEST) || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_LOWER_CITY_SHAMAN)) return false; return true; } @@ -152,11 +153,20 @@ class spell_pal_blessing_of_faith : public SpellScriptLoader uint32 spell_id = 0; switch (unitTarget->getClass()) { - case CLASS_DRUID: spell_id = SPELL_BLESSING_OF_LOWER_CITY_DRUID; break; - case CLASS_PALADIN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PALADIN; break; - case CLASS_PRIEST: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PRIEST; break; - case CLASS_SHAMAN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_SHAMAN; break; - default: return; // ignore for non-healing classes + case CLASS_DRUID: + spell_id = SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID; + break; + case CLASS_PALADIN: + spell_id = SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PALADIN; + break; + case CLASS_PRIEST: + spell_id = SPELL_PALADIN_BLESSING_OF_LOWER_CITY_PRIEST; + break; + case CLASS_SHAMAN: + spell_id = SPELL_PALADIN_BLESSING_OF_LOWER_CITY_SHAMAN; + break; + default: + return; // ignore for non-healing classes } Unit* caster = GetCaster(); caster->CastSpell(caster, spell_id, true); @@ -165,7 +175,6 @@ class spell_pal_blessing_of_faith : public SpellScriptLoader void Register() { - // add dummy effect spell handler to Blessing of Faith OnEffectHitTarget += SpellEffectFn(spell_pal_blessing_of_faith_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; @@ -187,9 +196,9 @@ class spell_pal_blessing_of_sanctuary : public SpellScriptLoader { PrepareAuraScript(spell_pal_blessing_of_sanctuary_AuraScript); - bool Validate(SpellInfo const* /*entry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF)) + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_SANCTUARY_BUFF)) return false; return true; } @@ -198,13 +207,13 @@ class spell_pal_blessing_of_sanctuary : public SpellScriptLoader { Unit* target = GetTarget(); if (Unit* caster = GetCaster()) - caster->CastSpell(target, PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, true); + caster->CastSpell(target, SPELL_PALADIN_BLESSING_OF_SANCTUARY_BUFF, true); } void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Unit* target = GetTarget(); - target->RemoveAura(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF, GetCasterGUID()); + target->RemoveAura(SPELL_PALADIN_BLESSING_OF_SANCTUARY_BUFF, GetCasterGUID()); } void Register() @@ -220,141 +229,63 @@ class spell_pal_blessing_of_sanctuary : public SpellScriptLoader } }; -// 63521 Guarded by The Light -class spell_pal_guarded_by_the_light : public SpellScriptLoader -{ - public: - spell_pal_guarded_by_the_light() : SpellScriptLoader("spell_pal_guarded_by_the_light") { } - - class spell_pal_guarded_by_the_light_SpellScript : public SpellScript - { - PrepareSpellScript(spell_pal_guarded_by_the_light_SpellScript); - - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_DIVINE_PLEA)) - return false; - return true; - } - - void HandleScriptEffect(SpellEffIndex /*effIndex*/) - { - // Divine Plea - if (Aura* aura = GetCaster()->GetAura(PALADIN_SPELL_DIVINE_PLEA)) - aura->RefreshDuration(); - } - - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_pal_guarded_by_the_light_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_pal_guarded_by_the_light_SpellScript(); - } -}; - -class spell_pal_holy_shock : public SpellScriptLoader +// 64205 - Divine Sacrifice +class spell_pal_divine_sacrifice : public SpellScriptLoader { public: - spell_pal_holy_shock() : SpellScriptLoader("spell_pal_holy_shock") { } + spell_pal_divine_sacrifice() : SpellScriptLoader("spell_pal_divine_sacrifice") { } - class spell_pal_holy_shock_SpellScript : public SpellScript + class spell_pal_divine_sacrifice_AuraScript : public AuraScript { - PrepareSpellScript(spell_pal_holy_shock_SpellScript); - - bool Validate(SpellInfo const* spell) - { - if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_HOLY_SHOCK_R1)) - return false; - - // can't use other spell than holy shock due to spell_ranks dependency - if (sSpellMgr->GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spell->Id)) - return false; - - uint8 rank = sSpellMgr->GetSpellRank(spell->Id); - if (!sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank, true) || !sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank, true)) - return false; + PrepareAuraScript(spell_pal_divine_sacrifice_AuraScript); - return true; - } + uint32 groupSize, minHpPct; + int32 remainingAmount; - void HandleDummy(SpellEffIndex /*effIndex*/) + bool Load() { - Unit* caster = GetCaster(); - if (Unit* unitTarget = GetHitUnit()) - { - uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); - if (caster->IsFriendlyTo(unitTarget)) - caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank), true, 0); - else - caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank), true, 0); - } - } - SpellCastResult CheckCast() - { - Unit* caster = GetCaster(); - if (Unit* target = GetExplTargetUnit()) + if (Unit* caster = GetCaster()) { - if (!caster->IsFriendlyTo(target)) + if (caster->GetTypeId() == TYPEID_PLAYER) { - if (!caster->IsValidAttackTarget(target)) - return SPELL_FAILED_BAD_TARGETS; - - if (!caster->isInFront(target)) - return SPELL_FAILED_UNIT_NOT_INFRONT; + if (caster->ToPlayer()->GetGroup()) + groupSize = caster->ToPlayer()->GetGroup()->GetMembersCount(); + else + groupSize = 1; } - } - else - return SPELL_FAILED_BAD_TARGETS; - return SPELL_CAST_OK; - } + else + return false; - void Register() - { - // add dummy effect spell handler to Holy Shock - OnCheckCast += SpellCheckCastFn(spell_pal_holy_shock_SpellScript::CheckCast); - OnEffectHitTarget += SpellEffectFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + remainingAmount = (caster->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue(caster)) * groupSize); + minHpPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(caster); + return true; + } + return false; } - }; - - SpellScript* GetSpellScript() const - { - return new spell_pal_holy_shock_SpellScript(); - } -}; -class spell_pal_judgement_of_command : public SpellScriptLoader -{ - public: - spell_pal_judgement_of_command() : SpellScriptLoader("spell_pal_judgement_of_command") { } - - class spell_pal_judgement_of_command_SpellScript : public SpellScript - { - PrepareSpellScript(spell_pal_judgement_of_command_SpellScript) - void HandleDummy(SpellEffIndex /*effIndex*/) + void Split(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & splitAmount) { - if (Unit* unitTarget = GetHitUnit()) - if (SpellInfo const* spell_proto = sSpellMgr->GetSpellInfo(GetEffectValue())) - GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL); + remainingAmount -= splitAmount; + // break when absorbed everything it could, or if the casters hp drops below 20% + if (Unit* caster = GetCaster()) + if (remainingAmount <= 0 || (caster->GetHealthPct() < minHpPct)) + caster->RemoveAura(SPELL_PALADIN_DIVINE_SACRIFICE); } void Register() { - // add dummy effect spell handler to Judgement of Command - OnEffectHitTarget += SpellEffectFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectSplit += AuraEffectSplitFn(spell_pal_divine_sacrifice_AuraScript::Split, EFFECT_0); } }; - SpellScript* GetSpellScript() const + AuraScript* GetAuraScript() const { - return new spell_pal_judgement_of_command_SpellScript(); + return new spell_pal_divine_sacrifice_AuraScript(); } }; +// 53385 - Divine Storm class spell_pal_divine_storm : public SpellScriptLoader { public: @@ -366,9 +297,9 @@ class spell_pal_divine_storm : public SpellScriptLoader uint32 healPct; - bool Validate(SpellInfo const* /* spell */) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM_DUMMY)) + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_DIVINE_STORM_DUMMY)) return false; return true; } @@ -382,7 +313,7 @@ class spell_pal_divine_storm : public SpellScriptLoader void TriggerHeal() { Unit* caster = GetCaster(); - caster->CastCustomSpell(SPELL_DIVINE_STORM_DUMMY, SPELLVALUE_BASE_POINT0, (GetHitDamage() * healPct) / 100, caster, true); + caster->CastCustomSpell(SPELL_PALADIN_DIVINE_STORM_DUMMY, SPELLVALUE_BASE_POINT0, (GetHitDamage() * healPct) / 100, caster, true); } void Register() @@ -397,6 +328,7 @@ class spell_pal_divine_storm : public SpellScriptLoader } }; +// 54171 - Divine Storm (Dummy) class spell_pal_divine_storm_dummy : public SpellScriptLoader { public: @@ -406,9 +338,9 @@ class spell_pal_divine_storm_dummy : public SpellScriptLoader { PrepareSpellScript(spell_pal_divine_storm_dummy_SpellScript); - bool Validate(SpellInfo const* /* spell */) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_DIVINE_STORM_HEAL)) + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_DIVINE_STORM_HEAL)) return false; return true; } @@ -418,13 +350,13 @@ class spell_pal_divine_storm_dummy : public SpellScriptLoader _targetCount = targetList.size(); } - void HandleDummy(SpellEffIndex /* effIndex */) + void HandleDummy(SpellEffIndex /*effIndex*/) { if (!_targetCount || ! GetHitUnit()) return; int32 heal = GetEffectValue() / _targetCount; - GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_DIVINE_STORM_HEAL, &heal, NULL, NULL, true); + GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_PALADIN_DIVINE_STORM_HEAL, &heal, NULL, NULL, true); } private: uint32 _targetCount; @@ -442,229 +374,314 @@ class spell_pal_divine_storm_dummy : public SpellScriptLoader } }; -class spell_pal_lay_on_hands : public SpellScriptLoader +// 33695 - Exorcism and Holy Wrath Damage +class spell_pal_exorcism_and_holy_wrath_damage : public SpellScriptLoader { public: - spell_pal_lay_on_hands() : SpellScriptLoader("spell_pal_lay_on_hands") { } + spell_pal_exorcism_and_holy_wrath_damage() : SpellScriptLoader("spell_pal_exorcism_and_holy_wrath_damage") { } - class spell_pal_lay_on_hands_SpellScript : public SpellScript + class spell_pal_exorcism_and_holy_wrath_damage_AuraScript : public AuraScript { - PrepareSpellScript(spell_pal_lay_on_hands_SpellScript); + PrepareAuraScript(spell_pal_exorcism_and_holy_wrath_damage_AuraScript); - bool Validate(SpellInfo const* /*spell*/) + void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod) { - if (!sSpellMgr->GetSpellInfo(SPELL_FORBEARANCE)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_AVENGING_WRATH_MARKER)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_IMMUNE_SHIELD_MARKER)) + if (!spellMod) + { + spellMod = new SpellModifier(aurEff->GetBase()); + spellMod->op = SPELLMOD_DAMAGE; + spellMod->type = SPELLMOD_FLAT; + spellMod->spellId = GetId(); + spellMod->mask[1] = 0x200002; + } + + spellMod->value = aurEff->GetAmount(); + } + + void Register() + { + DoEffectCalcSpellMod += AuraEffectCalcSpellModFn(spell_pal_exorcism_and_holy_wrath_damage_AuraScript::HandleEffectCalcSpellMod, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_pal_exorcism_and_holy_wrath_damage_AuraScript(); + } +}; + +// 63521 - Guarded by The Light +class spell_pal_guarded_by_the_light : public SpellScriptLoader +{ + public: + spell_pal_guarded_by_the_light() : SpellScriptLoader("spell_pal_guarded_by_the_light") { } + + class spell_pal_guarded_by_the_light_SpellScript : public SpellScript + { + PrepareSpellScript(spell_pal_guarded_by_the_light_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_DIVINE_PLEA)) return false; return true; } - SpellCastResult CheckCast() + void HandleScriptEffect(SpellEffIndex /*effIndex*/) { - Unit* caster = GetCaster(); - if (Unit* target = GetExplTargetUnit()) - if (caster == target) - if (target->HasAura(SPELL_FORBEARANCE) || target->HasAura(SPELL_AVENGING_WRATH_MARKER) || target->HasAura(SPELL_IMMUNE_SHIELD_MARKER)) - return SPELL_FAILED_TARGET_AURASTATE; + // Divine Plea + if (Aura* aura = GetCaster()->GetAura(SPELL_PALADIN_DIVINE_PLEA)) + aura->RefreshDuration(); + } - return SPELL_CAST_OK; + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_pal_guarded_by_the_light_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } + }; - void HandleScript() + SpellScript* GetSpellScript() const + { + return new spell_pal_guarded_by_the_light_SpellScript(); + } +}; + +// 6940 - Hand of Sacrifice +class spell_pal_hand_of_sacrifice : public SpellScriptLoader +{ + public: + spell_pal_hand_of_sacrifice() : SpellScriptLoader("spell_pal_hand_of_sacrifice") { } + + class spell_pal_hand_of_sacrifice_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_hand_of_sacrifice_AuraScript); + + int32 remainingAmount; + + bool Load() { - Unit* caster = GetCaster(); - if (caster == GetHitUnit()) + if (Unit* caster = GetCaster()) + { + remainingAmount = caster->GetMaxHealth(); + return true; + } + return false; + } + + void Split(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & splitAmount) + { + remainingAmount -= splitAmount; + + if (remainingAmount <= 0) { - caster->CastSpell(caster, SPELL_FORBEARANCE, true); - caster->CastSpell(caster, SPELL_AVENGING_WRATH_MARKER, true); - caster->CastSpell(caster, SPELL_IMMUNE_SHIELD_MARKER, true); + GetTarget()->RemoveAura(SPELL_PALADIN_HAND_OF_SACRIFICE); } } void Register() { - OnCheckCast += SpellCheckCastFn(spell_pal_lay_on_hands_SpellScript::CheckCast); - AfterHit += SpellHitFn(spell_pal_lay_on_hands_SpellScript::HandleScript); + OnEffectSplit += AuraEffectSplitFn(spell_pal_hand_of_sacrifice_AuraScript::Split, EFFECT_0); } }; - SpellScript* GetSpellScript() const + AuraScript* GetAuraScript() const { - return new spell_pal_lay_on_hands_SpellScript(); + return new spell_pal_hand_of_sacrifice_AuraScript(); } }; -class spell_pal_righteous_defense : public SpellScriptLoader +// -20473 - Holy Shock +class spell_pal_holy_shock : public SpellScriptLoader { public: - spell_pal_righteous_defense() : SpellScriptLoader("spell_pal_righteous_defense") { } + spell_pal_holy_shock() : SpellScriptLoader("spell_pal_holy_shock") { } - class spell_pal_righteous_defense_SpellScript : public SpellScript + class spell_pal_holy_shock_SpellScript : public SpellScript { - PrepareSpellScript(spell_pal_righteous_defense_SpellScript); + PrepareSpellScript(spell_pal_holy_shock_SpellScript); - SpellCastResult CheckCast() + bool Validate(SpellInfo const* spell) + { + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_HOLY_SHOCK_R1)) + return false; + + // can't use other spell than holy shock due to spell_ranks dependency + if (sSpellMgr->GetFirstSpellInChain(SPELL_PALADIN_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spell->Id)) + return false; + + uint8 rank = sSpellMgr->GetSpellRank(spell->Id); + if (!sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE, rank, true) || !sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, rank, true)) + return false; + + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); - if (caster->GetTypeId() != TYPEID_PLAYER) - return SPELL_FAILED_DONT_REPORT; + if (Unit* unitTarget = GetHitUnit()) + { + uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); + if (caster->IsFriendlyTo(unitTarget)) + caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_HEALING, rank), true, 0); + else + caster->CastSpell(unitTarget, sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE, rank), true, 0); + } + } + SpellCastResult CheckCast() + { + Unit* caster = GetCaster(); if (Unit* target = GetExplTargetUnit()) { - if (!target->IsFriendlyTo(caster) || target->getAttackers().empty()) - return SPELL_FAILED_BAD_TARGETS; + if (!caster->IsFriendlyTo(target)) + { + if (!caster->IsValidAttackTarget(target)) + return SPELL_FAILED_BAD_TARGETS; + + if (!caster->isInFront(target)) + return SPELL_FAILED_UNIT_NOT_INFRONT; + } } else return SPELL_FAILED_BAD_TARGETS; - return SPELL_CAST_OK; } void Register() { - OnCheckCast += SpellCheckCastFn(spell_pal_righteous_defense_SpellScript::CheckCast); + OnCheckCast += SpellCheckCastFn(spell_pal_holy_shock_SpellScript::CheckCast); + OnEffectHitTarget += SpellEffectFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; SpellScript* GetSpellScript() const { - return new spell_pal_righteous_defense_SpellScript(); + return new spell_pal_holy_shock_SpellScript(); } }; -class spell_pal_exorcism_and_holy_wrath_damage : public SpellScriptLoader +// 20425 - Judgement of Command +class spell_pal_judgement_of_command : public SpellScriptLoader { public: - spell_pal_exorcism_and_holy_wrath_damage() : SpellScriptLoader("spell_pal_exorcism_and_holy_wrath_damage") { } + spell_pal_judgement_of_command() : SpellScriptLoader("spell_pal_judgement_of_command") { } - class spell_pal_exorcism_and_holy_wrath_damage_AuraScript : public AuraScript + class spell_pal_judgement_of_command_SpellScript : public SpellScript { - PrepareAuraScript(spell_pal_exorcism_and_holy_wrath_damage_AuraScript); + PrepareSpellScript(spell_pal_judgement_of_command_SpellScript); - void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod) + void HandleDummy(SpellEffIndex /*effIndex*/) { - if (!spellMod) - { - spellMod = new SpellModifier(aurEff->GetBase()); - spellMod->op = SPELLMOD_DAMAGE; - spellMod->type = SPELLMOD_FLAT; - spellMod->spellId = GetId(); - spellMod->mask[1] = 0x200002; - } - - spellMod->value = aurEff->GetAmount(); + if (Unit* unitTarget = GetHitUnit()) + if (SpellInfo const* spell_proto = sSpellMgr->GetSpellInfo(GetEffectValue())) + GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL); } void Register() { - DoEffectCalcSpellMod += AuraEffectCalcSpellModFn(spell_pal_exorcism_and_holy_wrath_damage_AuraScript::HandleEffectCalcSpellMod, EFFECT_0, SPELL_AURA_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; - AuraScript* GetAuraScript() const + SpellScript* GetSpellScript() const { - return new spell_pal_exorcism_and_holy_wrath_damage_AuraScript(); + return new spell_pal_judgement_of_command_SpellScript(); } }; -class spell_pal_hand_of_sacrifice : public SpellScriptLoader +// -633 - Lay on Hands +class spell_pal_lay_on_hands : public SpellScriptLoader { public: - spell_pal_hand_of_sacrifice() : SpellScriptLoader("spell_pal_hand_of_sacrifice") { } + spell_pal_lay_on_hands() : SpellScriptLoader("spell_pal_lay_on_hands") { } - class spell_pal_hand_of_sacrifice_AuraScript : public AuraScript + class spell_pal_lay_on_hands_SpellScript : public SpellScript { - PrepareAuraScript(spell_pal_hand_of_sacrifice_AuraScript); - - int32 remainingAmount; + PrepareSpellScript(spell_pal_lay_on_hands_SpellScript); - bool Load() + bool Validate(SpellInfo const* /*spell*/) { - if (Unit* caster = GetCaster()) - { - remainingAmount = caster->GetMaxHealth(); - return true; - } - return false; + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_FORBEARANCE)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_AVENGING_WRATH_MARKER)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_IMMUNE_SHIELD_MARKER)) + return false; + return true; } - void Split(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & splitAmount) + SpellCastResult CheckCast() { - remainingAmount -= splitAmount; + Unit* caster = GetCaster(); + if (Unit* target = GetExplTargetUnit()) + if (caster == target) + if (target->HasAura(SPELL_PALADIN_FORBEARANCE) || target->HasAura(SPELL_PALADIN_AVENGING_WRATH_MARKER) || target->HasAura(SPELL_PALADIN_IMMUNE_SHIELD_MARKER)) + return SPELL_FAILED_TARGET_AURASTATE; - if (remainingAmount <= 0) + return SPELL_CAST_OK; + } + + void HandleScript() + { + Unit* caster = GetCaster(); + if (caster == GetHitUnit()) { - GetTarget()->RemoveAura(SPELL_HAND_OF_SACRIFICE); + caster->CastSpell(caster, SPELL_PALADIN_FORBEARANCE, true); + caster->CastSpell(caster, SPELL_PALADIN_AVENGING_WRATH_MARKER, true); + caster->CastSpell(caster, SPELL_PALADIN_IMMUNE_SHIELD_MARKER, true); } } void Register() { - OnEffectSplit += AuraEffectSplitFn(spell_pal_hand_of_sacrifice_AuraScript::Split, EFFECT_0); + OnCheckCast += SpellCheckCastFn(spell_pal_lay_on_hands_SpellScript::CheckCast); + AfterHit += SpellHitFn(spell_pal_lay_on_hands_SpellScript::HandleScript); } }; - AuraScript* GetAuraScript() const + SpellScript* GetSpellScript() const { - return new spell_pal_hand_of_sacrifice_AuraScript(); + return new spell_pal_lay_on_hands_SpellScript(); } }; -class spell_pal_divine_sacrifice : public SpellScriptLoader +// 31789 - Righteous Defense +class spell_pal_righteous_defense : public SpellScriptLoader { public: - spell_pal_divine_sacrifice() : SpellScriptLoader("spell_pal_divine_sacrifice") { } + spell_pal_righteous_defense() : SpellScriptLoader("spell_pal_righteous_defense") { } - class spell_pal_divine_sacrifice_AuraScript : public AuraScript + class spell_pal_righteous_defense_SpellScript : public SpellScript { - PrepareAuraScript(spell_pal_divine_sacrifice_AuraScript); - - uint32 groupSize, minHpPct; - int32 remainingAmount; + PrepareSpellScript(spell_pal_righteous_defense_SpellScript); - bool Load() + SpellCastResult CheckCast() { + Unit* caster = GetCaster(); + if (caster->GetTypeId() != TYPEID_PLAYER) + return SPELL_FAILED_DONT_REPORT; - if (Unit* caster = GetCaster()) + if (Unit* target = GetExplTargetUnit()) { - if (caster->GetTypeId() == TYPEID_PLAYER) - { - if (caster->ToPlayer()->GetGroup()) - groupSize = caster->ToPlayer()->GetGroup()->GetMembersCount(); - else - groupSize = 1; - } - else - return false; - - remainingAmount = (caster->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue(caster)) * groupSize); - minHpPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(caster); - return true; + if (!target->IsFriendlyTo(caster) || target->getAttackers().empty()) + return SPELL_FAILED_BAD_TARGETS; } - return false; - } + else + return SPELL_FAILED_BAD_TARGETS; - void Split(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & splitAmount) - { - remainingAmount -= splitAmount; - // break when absorbed everything it could, or if the casters hp drops below 20% - if (Unit* caster = GetCaster()) - if (remainingAmount <= 0 || (caster->GetHealthPct() < minHpPct)) - caster->RemoveAura(SPELL_DIVINE_SACRIFICE); + return SPELL_CAST_OK; } void Register() { - OnEffectSplit += AuraEffectSplitFn(spell_pal_divine_sacrifice_AuraScript::Split, EFFECT_0); + OnCheckCast += SpellCheckCastFn(spell_pal_righteous_defense_SpellScript::CheckCast); } }; - AuraScript* GetAuraScript() const + SpellScript* GetSpellScript() const { - return new spell_pal_divine_sacrifice_AuraScript(); + return new spell_pal_righteous_defense_SpellScript(); } }; @@ -673,14 +690,14 @@ void AddSC_paladin_spell_scripts() new spell_pal_ardent_defender(); new spell_pal_blessing_of_faith(); new spell_pal_blessing_of_sanctuary(); + new spell_pal_divine_sacrifice(); + new spell_pal_divine_storm(); + new spell_pal_divine_storm_dummy(); + new spell_pal_exorcism_and_holy_wrath_damage(); new spell_pal_guarded_by_the_light(); + new spell_pal_hand_of_sacrifice(); new spell_pal_holy_shock(); new spell_pal_judgement_of_command(); - new spell_pal_divine_storm(); - new spell_pal_divine_storm_dummy(); new spell_pal_lay_on_hands(); new spell_pal_righteous_defense(); - new spell_pal_exorcism_and_holy_wrath_damage(); - new spell_pal_hand_of_sacrifice(); - new spell_pal_divine_sacrifice(); } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 68a9337f8ea..1c416a0d28a 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -249,7 +249,6 @@ class spell_pri_penance : public SpellScriptLoader void Register() { - // add dummy effect spell handler to Penance OnEffectHitTarget += SpellEffectFn(spell_pri_penance_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); OnCheckCast += SpellCheckCastFn(spell_pri_penance_SpellScript::CheckCast); } @@ -282,7 +281,6 @@ class spell_pri_prayer_of_mending_heal : public SpellScriptLoader SetHitHeal(heal); } } - } void Register() diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 7b6ac8fed12..f84265b89de 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -28,137 +28,173 @@ enum WarriorSpells { - WARRIOR_SPELL_LAST_STAND_TRIGGERED = 12976, + SPELL_WARRIOR_BLOODTHIRST = 23885, + SPELL_WARRIOR_BLOODTHIRST_DAMAGE = 23881, + SPELL_WARRIOR_CHARGE = 34846, + SPELL_WARRIOR_DEEP_WOUNDS_RANK_1 = 12162, + SPELL_WARRIOR_DEEP_WOUNDS_RANK_2 = 12850, + SPELL_WARRIOR_DEEP_WOUNDS_RANK_3 = 12868, + SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC = 12721, + SPELL_WARRIOR_EXECUTE = 20647, + SPELL_WARRIOR_GLYPH_OF_EXECUTION = 58367, + SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF = 65156, + SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT = 64976, + SPELL_WARRIOR_LAST_STAND_TRIGGERED = 12976, + SPELL_WARRIOR_SLAM = 50783, + SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_1 = 46859, + SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_2 = 46860, + SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_1 = 64849, + SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_2 = 64850, + + SPELL_PALADIN_BLESSING_OF_SANCTUARY = 20911, + SPELL_PALADIN_GREATER_BLESSING_OF_SANCTUARY = 25899, + SPELL_PRIEST_RENEWED_HOPE = 63944, + SPELL_GEN_DAMAGE_REDUCTION_AURA = 68066, }; -class spell_warr_last_stand : public SpellScriptLoader +enum WarriorSpellIcons +{ + WARRIOR_ICON_ID_SUDDEN_DEATH = 1989, +}; + +// 23881 - Bloodthirst +class spell_warr_bloodthirst : public SpellScriptLoader { public: - spell_warr_last_stand() : SpellScriptLoader("spell_warr_last_stand") { } + spell_warr_bloodthirst() : SpellScriptLoader("spell_warr_bloodthirst") { } - class spell_warr_last_stand_SpellScript : public SpellScript + class spell_warr_bloodthirst_SpellScript : public SpellScript { - PrepareSpellScript(spell_warr_last_stand_SpellScript); + PrepareSpellScript(spell_warr_bloodthirst_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + void HandleDamage(SpellEffIndex /*effIndex*/) { - if (!sSpellMgr->GetSpellInfo(WARRIOR_SPELL_LAST_STAND_TRIGGERED)) - return false; - return true; + int32 damage = GetEffectValue(); + ApplyPct(damage, GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK)); + + if (Unit* target = GetHitUnit()) + { + damage = GetCaster()->SpellDamageBonusDone(target, GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE); + damage = target->SpellDamageBonusTaken(GetCaster(), GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE); + } + SetHitDamage(damage); } void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* caster = GetCaster()) - { - int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(30)); - caster->CastCustomSpell(caster, WARRIOR_SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL); - } + int32 damage = GetEffectValue(); + GetCaster()->CastCustomSpell(GetCaster(), SPELL_WARRIOR_BLOODTHIRST, &damage, NULL, NULL, true, NULL); } void Register() { - // add dummy effect spell handler to Last Stand - OnEffectHit += SpellEffectFn(spell_warr_last_stand_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + OnEffectHit += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); } }; SpellScript* GetSpellScript() const { - return new spell_warr_last_stand_SpellScript(); + return new spell_warr_bloodthirst_SpellScript(); } }; -class spell_warr_improved_spell_reflection : public SpellScriptLoader +// 23880 - Bloodthirst (Heal) +class spell_warr_bloodthirst_heal : public SpellScriptLoader { public: - spell_warr_improved_spell_reflection() : SpellScriptLoader("spell_warr_improved_spell_reflection") { } + spell_warr_bloodthirst_heal() : SpellScriptLoader("spell_warr_bloodthirst_heal") { } - class spell_warr_improved_spell_reflection_SpellScript : public SpellScript + class spell_warr_bloodthirst_heal_SpellScript : public SpellScript { - PrepareSpellScript(spell_warr_improved_spell_reflection_SpellScript); + PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript); - void FilterTargets(std::list& unitList) + void HandleHeal(SpellEffIndex /*effIndex*/) { - if (GetCaster()) - unitList.remove(GetCaster()); + if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARRIOR_BLOODTHIRST_DAMAGE)) + SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster()))); } void Register() { - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warr_improved_spell_reflection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY); + OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); } }; SpellScript* GetSpellScript() const { - return new spell_warr_improved_spell_reflection_SpellScript(); + return new spell_warr_bloodthirst_heal_SpellScript(); } }; -enum DamageReductionAura +// -100 - Charge +class spell_warr_charge : public SpellScriptLoader { - SPELL_BLESSING_OF_SANCTUARY = 20911, - SPELL_GREATER_BLESSING_OF_SANCTUARY = 25899, - SPELL_RENEWED_HOPE = 63944, - SPELL_DAMAGE_REDUCTION_AURA = 68066, -}; + public: + spell_warr_charge() : SpellScriptLoader("spell_warr_charge") { } -class spell_warr_vigilance : public SpellScriptLoader -{ -public: - spell_warr_vigilance() : SpellScriptLoader("spell_warr_vigilance") { } + class spell_warr_charge_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_charge_SpellScript); - class spell_warr_vigilance_AuraScript : public AuraScript - { - PrepareAuraScript(spell_warr_vigilance_AuraScript); + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_CHARGE)) + return false; + return true; + } - bool Validate(SpellInfo const* /*SpellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_DAMAGE_REDUCTION_AURA)) - return false; - return true; - } + void HandleDummy(SpellEffIndex /*effIndex*/) + { + int32 chargeBasePoints0 = GetEffectValue(); + Unit* caster = GetCaster(); + caster->CastCustomSpell(caster, SPELL_WARRIOR_CHARGE, &chargeBasePoints0, NULL, NULL, true); - void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (Unit* target = GetTarget()) - target->CastSpell(target, SPELL_DAMAGE_REDUCTION_AURA, true); - } + // Juggernaut crit bonus + if (caster->HasAura(SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT)) + caster->CastSpell(caster, SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF, true); + } - void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (Unit* target = GetTarget()) + void Register() { - if (target->HasAura(SPELL_DAMAGE_REDUCTION_AURA) && !(target->HasAura(SPELL_BLESSING_OF_SANCTUARY) || - target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY) || - target->HasAura(SPELL_RENEWED_HOPE))) - target->RemoveAurasDueToSpell(SPELL_DAMAGE_REDUCTION_AURA); + OnEffectHitTarget += SpellEffectFn(spell_warr_charge_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); } - } + }; - void Register() + SpellScript* GetSpellScript() const { - OnEffectApply += AuraEffectApplyFn(spell_warr_vigilance_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - OnEffectRemove += AuraEffectRemoveFn(spell_warr_vigilance_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + return new spell_warr_charge_SpellScript(); } - - }; - - AuraScript* GetAuraScript() const - { - return new spell_warr_vigilance_AuraScript(); - } }; -enum DeepWounds +// 12809 - Concussion Blow +class spell_warr_concussion_blow : public SpellScriptLoader { - SPELL_DEEP_WOUNDS_RANK_1 = 12162, - SPELL_DEEP_WOUNDS_RANK_2 = 12850, - SPELL_DEEP_WOUNDS_RANK_3 = 12868, - SPELL_DEEP_WOUNDS_RANK_PERIODIC = 12721, + public: + spell_warr_concussion_blow() : SpellScriptLoader("spell_warr_concussion_blow") { } + + class spell_warr_concussion_blow_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_concussion_blow_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + SetHitDamage(CalculatePct(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetEffectValue())); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warr_concussion_blow_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warr_concussion_blow_SpellScript(); + } }; +// -12162 - Deep Wounds class spell_warr_deep_wounds : public SpellScriptLoader { public: @@ -168,14 +204,14 @@ class spell_warr_deep_wounds : public SpellScriptLoader { PrepareSpellScript(spell_warr_deep_wounds_SpellScript); - bool Validate(SpellInfo const* /*SpellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_1) || !sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_2) || !sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_3)) + if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_1) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_2) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_3)) return false; return true; } - void HandleDummy(SpellEffIndex /* effIndex */) + void HandleDummy(SpellEffIndex /*effIndex*/) { int32 damage = GetEffectValue(); Unit* caster = GetCaster(); @@ -188,16 +224,16 @@ class spell_warr_deep_wounds : public SpellScriptLoader damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC); uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude; // Add remaining ticks to damage done - if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_DEEP_WOUNDS_RANK_PERIODIC, EFFECT_0, caster->GetGUID())) + if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC, EFFECT_0, caster->GetGUID())) damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber()); - damage = damage / ticks; + damage /= ticks; - caster->CastCustomSpell(target, SPELL_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true); + caster->CastCustomSpell(target, SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true); } } @@ -213,311 +249,261 @@ class spell_warr_deep_wounds : public SpellScriptLoader } }; -enum Charge -{ - SPELL_JUGGERNAUT_CRIT_BONUS_TALENT = 64976, - SPELL_JUGGERNAUT_CRIT_BONUS_BUFF = 65156, - SPELL_CHARGE = 34846, -}; - -class spell_warr_charge : public SpellScriptLoader +// -5308 - Execute +class spell_warr_execute : public SpellScriptLoader { public: - spell_warr_charge() : SpellScriptLoader("spell_warr_charge") { } + spell_warr_execute() : SpellScriptLoader("spell_warr_execute") { } - class spell_warr_charge_SpellScript : public SpellScript + class spell_warr_execute_SpellScript : public SpellScript { - PrepareSpellScript(spell_warr_charge_SpellScript); + PrepareSpellScript(spell_warr_execute_SpellScript); - bool Validate(SpellInfo const* /*SpellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_JUGGERNAUT_CRIT_BONUS_TALENT) || !sSpellMgr->GetSpellInfo(SPELL_JUGGERNAUT_CRIT_BONUS_BUFF) || !sSpellMgr->GetSpellInfo(SPELL_CHARGE)) + if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_EXECUTE) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_GLYPH_OF_EXECUTION)) return false; return true; } - void HandleDummy(SpellEffIndex /* effIndex */) + + void HandleDummy(SpellEffIndex effIndex) { - int32 chargeBasePoints0 = GetEffectValue(); Unit* caster = GetCaster(); - caster->CastCustomSpell(caster, SPELL_CHARGE, &chargeBasePoints0, NULL, NULL, true); + if (Unit* target = GetHitUnit()) + { + SpellInfo const* spellInfo = GetSpellInfo(); + int32 rageUsed = std::min(300 - spellInfo->CalcPowerCost(caster, SpellSchoolMask(spellInfo->SchoolMask)), caster->GetPower(POWER_RAGE)); + int32 newRage = std::max(0, caster->GetPower(POWER_RAGE) - rageUsed); + + // Sudden Death rage save + if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_GENERIC, WARRIOR_ICON_ID_SUDDEN_DEATH, EFFECT_0)) + { + int32 ragesave = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue() * 10; + newRage = std::max(newRage, ragesave); + } - //Juggernaut crit bonus - if (caster->HasAura(SPELL_JUGGERNAUT_CRIT_BONUS_TALENT)) - caster->CastSpell(caster, SPELL_JUGGERNAUT_CRIT_BONUS_BUFF, true); + caster->SetPower(POWER_RAGE, uint32(newRage)); + // Glyph of Execution bonus + if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_WARRIOR_GLYPH_OF_EXECUTION, EFFECT_0)) + rageUsed += aurEff->GetAmount() * 10; + + + int32 bp = GetEffectValue() + int32(rageUsed * spellInfo->Effects[effIndex].DamageMultiplier + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.2f); + caster->CastCustomSpell(target, SPELL_WARRIOR_EXECUTE, &bp, NULL, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID()); + } } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_warr_charge_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_warr_execute_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; SpellScript* GetSpellScript() const { - return new spell_warr_charge_SpellScript(); + return new spell_warr_execute_SpellScript(); } }; -enum Slam -{ - SPELL_SLAM = 50783, -}; - -class spell_warr_slam : public SpellScriptLoader +// 59725 - Improved Spell Reflection +class spell_warr_improved_spell_reflection : public SpellScriptLoader { public: - spell_warr_slam() : SpellScriptLoader("spell_warr_slam") { } + spell_warr_improved_spell_reflection() : SpellScriptLoader("spell_warr_improved_spell_reflection") { } - class spell_warr_slam_SpellScript : public SpellScript + class spell_warr_improved_spell_reflection_SpellScript : public SpellScript { - PrepareSpellScript(spell_warr_slam_SpellScript); + PrepareSpellScript(spell_warr_improved_spell_reflection_SpellScript); - bool Validate(SpellInfo const* /*SpellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_SLAM)) - return false; - return true; - } - void HandleDummy(SpellEffIndex /* effIndex */) + void FilterTargets(std::list& unitList) { - int32 bp0 = GetEffectValue(); - if (GetHitUnit()) - GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_SLAM, &bp0, NULL, NULL, true, 0); + if (GetCaster()) + unitList.remove(GetCaster()); } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_warr_slam_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warr_improved_spell_reflection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY); } }; SpellScript* GetSpellScript() const { - return new spell_warr_slam_SpellScript(); + return new spell_warr_improved_spell_reflection_SpellScript(); } }; -enum Execute -{ - SPELL_EXECUTE = 20647, - SPELL_GLYPH_OF_EXECUTION = 58367, - ICON_ID_SUDDEN_DEATH = 1989, -}; - -class spell_warr_execute : public SpellScriptLoader +// 12975 - Last Stand +class spell_warr_last_stand : public SpellScriptLoader { public: - spell_warr_execute() : SpellScriptLoader("spell_warr_execute") { } + spell_warr_last_stand() : SpellScriptLoader("spell_warr_last_stand") { } - class spell_warr_execute_SpellScript : public SpellScript + class spell_warr_last_stand_SpellScript : public SpellScript { - PrepareSpellScript(spell_warr_execute_SpellScript); + PrepareSpellScript(spell_warr_last_stand_SpellScript); - bool Validate(SpellInfo const* /*SpellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_EXECUTE) || !sSpellMgr->GetSpellInfo(SPELL_GLYPH_OF_EXECUTION)) + if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_LAST_STAND_TRIGGERED)) return false; return true; } - void HandleDummy(SpellEffIndex effIndex) + + void HandleDummy(SpellEffIndex /*effIndex*/) { - Unit* caster = GetCaster(); - if (Unit* target = GetHitUnit()) + if (Unit* caster = GetCaster()) { - SpellInfo const* spellInfo = GetSpellInfo(); - int32 rageUsed = std::min(300 - spellInfo->CalcPowerCost(caster, SpellSchoolMask(spellInfo->SchoolMask)), caster->GetPower(POWER_RAGE)); - int32 newRage = std::max(0, caster->GetPower(POWER_RAGE) - rageUsed); - - // Sudden Death rage save - if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_GENERIC, ICON_ID_SUDDEN_DEATH, EFFECT_0)) - { - int32 ragesave = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue() * 10; - newRage = std::max(newRage, ragesave); - } - - caster->SetPower(POWER_RAGE, uint32(newRage)); - // Glyph of Execution bonus - if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_GLYPH_OF_EXECUTION, EFFECT_0)) - rageUsed += aurEff->GetAmount() * 10; - - - int32 bp = GetEffectValue() + int32(rageUsed * spellInfo->Effects[effIndex].DamageMultiplier + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.2f); - caster->CastCustomSpell(target,SPELL_EXECUTE,&bp,0,0,true,0,0,GetOriginalCaster()->GetGUID()); + int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(30)); + caster->CastCustomSpell(caster, SPELL_WARRIOR_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL); } } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_warr_execute_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectHit += SpellEffectFn(spell_warr_last_stand_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; SpellScript* GetSpellScript() const { - return new spell_warr_execute_SpellScript(); + return new spell_warr_last_stand_SpellScript(); } }; -class spell_warr_concussion_blow : public SpellScriptLoader +// 7384, 7887, 11584, 11585 - Overpower +class spell_warr_overpower : public SpellScriptLoader { public: - spell_warr_concussion_blow() : SpellScriptLoader("spell_warr_concussion_blow") { } + spell_warr_overpower() : SpellScriptLoader("spell_warr_overpower") { } - class spell_warr_concussion_blow_SpellScript : public SpellScript + class spell_warr_overpower_SpellScript : public SpellScript { - PrepareSpellScript(spell_warr_concussion_blow_SpellScript); + PrepareSpellScript(spell_warr_overpower_SpellScript); - void HandleDummy(SpellEffIndex /* effIndex */) + void HandleEffect(SpellEffIndex /*effIndex*/) { - SetHitDamage(CalculatePct(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetEffectValue())); + uint32 spellId = 0; + if (GetCaster()->HasAura(SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_1)) + spellId = SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_1; + else if (GetCaster()->HasAura(SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_2)) + spellId = SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_2; + + if (!spellId) + return; + + if (Player* target = GetHitPlayer()) + if (target->HasUnitState(UNIT_STATE_CASTING)) + target->CastSpell(target, spellId, true); } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_warr_concussion_blow_SpellScript::HandleDummy, EFFECT_2, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_warr_overpower_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_ANY); } }; SpellScript* GetSpellScript() const { - return new spell_warr_concussion_blow_SpellScript(); + return new spell_warr_overpower_SpellScript(); } }; -enum Bloodthirst -{ - SPELL_BLOODTHIRST = 23885, -}; - -class spell_warr_bloodthirst : public SpellScriptLoader +// -1464 - Slam +class spell_warr_slam : public SpellScriptLoader { public: - spell_warr_bloodthirst() : SpellScriptLoader("spell_warr_bloodthirst") { } + spell_warr_slam() : SpellScriptLoader("spell_warr_slam") { } - class spell_warr_bloodthirst_SpellScript : public SpellScript + class spell_warr_slam_SpellScript : public SpellScript { - PrepareSpellScript(spell_warr_bloodthirst_SpellScript); + PrepareSpellScript(spell_warr_slam_SpellScript); - void HandleDamage(SpellEffIndex /*effIndex*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - int32 damage = GetEffectValue(); - ApplyPct(damage, GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK)); - - if (Unit* target = GetHitUnit()) - { - damage = GetCaster()->SpellDamageBonusDone(target, GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE); - damage = target->SpellDamageBonusTaken(GetCaster(), GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE); - } - SetHitDamage(damage); + if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SLAM)) + return false; + return true; } void HandleDummy(SpellEffIndex /*effIndex*/) { - int32 damage = GetEffectValue(); - GetCaster()->CastCustomSpell(GetCaster(), SPELL_BLOODTHIRST, &damage, NULL, NULL, true, NULL); + int32 bp0 = GetEffectValue(); + if (GetHitUnit()) + GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_WARRIOR_SLAM, &bp0, NULL, NULL, true, 0); } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); - OnEffectHit += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_warr_slam_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; SpellScript* GetSpellScript() const { - return new spell_warr_bloodthirst_SpellScript(); + return new spell_warr_slam_SpellScript(); } }; -enum BloodthirstHeal -{ - SPELL_BLOODTHIRST_DAMAGE = 23881, -}; - -class spell_warr_bloodthirst_heal : public SpellScriptLoader +// 50720 - Vigilance +class spell_warr_vigilance : public SpellScriptLoader { public: - spell_warr_bloodthirst_heal() : SpellScriptLoader("spell_warr_bloodthirst_heal") { } + spell_warr_vigilance() : SpellScriptLoader("spell_warr_vigilance") { } - class spell_warr_bloodthirst_heal_SpellScript : public SpellScript + class spell_warr_vigilance_AuraScript : public AuraScript { - PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript); + PrepareAuraScript(spell_warr_vigilance_AuraScript); - void HandleHeal(SpellEffIndex /*effIndex*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_BLOODTHIRST_DAMAGE)) - SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster()))); + if (!sSpellMgr->GetSpellInfo(SPELL_GEN_DAMAGE_REDUCTION_AURA)) + return false; + return true; } - void Register() + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + if (Unit* target = GetTarget()) + target->CastSpell(target, SPELL_GEN_DAMAGE_REDUCTION_AURA, true); } - }; - SpellScript* GetSpellScript() const - { - return new spell_warr_bloodthirst_heal_SpellScript(); - } -}; - -enum Overpower -{ - SPELL_UNRELENTING_ASSAULT_RANK_1 = 46859, - SPELL_UNRELENTING_ASSAULT_RANK_2 = 46860, - SPELL_UNRELENTING_ASSAULT_TRIGGER_1 = 64849, - SPELL_UNRELENTING_ASSAULT_TRIGGER_2 = 64850, -}; - -class spell_warr_overpower : public SpellScriptLoader -{ -public: - spell_warr_overpower() : SpellScriptLoader("spell_warr_overpower") { } + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* target = GetTarget()) + { + if (target->HasAura(SPELL_GEN_DAMAGE_REDUCTION_AURA) && !(target->HasAura(SPELL_PALADIN_BLESSING_OF_SANCTUARY) || + target->HasAura(SPELL_PALADIN_GREATER_BLESSING_OF_SANCTUARY) || + target->HasAura(SPELL_PRIEST_RENEWED_HOPE))) + target->RemoveAurasDueToSpell(SPELL_GEN_DAMAGE_REDUCTION_AURA); + } + } - class spell_warr_overpower_SpellScript : public SpellScript - { - PrepareSpellScript(spell_warr_overpower_SpellScript); + void Register() + { + OnEffectApply += AuraEffectApplyFn(spell_warr_vigilance_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectRemove += AuraEffectRemoveFn(spell_warr_vigilance_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } - void HandleEffect(SpellEffIndex /* effIndex */) - { - uint32 spellId = 0; - if (GetCaster()->HasAura(SPELL_UNRELENTING_ASSAULT_RANK_1)) - spellId = SPELL_UNRELENTING_ASSAULT_TRIGGER_1; - else if (GetCaster()->HasAura(SPELL_UNRELENTING_ASSAULT_RANK_2)) - spellId = SPELL_UNRELENTING_ASSAULT_TRIGGER_2; - - if (!spellId) - return; - - if (Player* target = GetHitPlayer()) - if (target->HasUnitState(UNIT_STATE_CASTING)) - target->CastSpell(target, spellId, true); - } + }; - void Register() + AuraScript* GetAuraScript() const { - OnEffectHitTarget += SpellEffectFn(spell_warr_overpower_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_ANY); + return new spell_warr_vigilance_AuraScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_warr_overpower_SpellScript(); - } }; void AddSC_warrior_spell_scripts() { - new spell_warr_last_stand(); - new spell_warr_improved_spell_reflection(); - new spell_warr_vigilance(); - new spell_warr_deep_wounds(); - new spell_warr_charge(); - new spell_warr_slam(); - new spell_warr_execute(); - new spell_warr_concussion_blow(); new spell_warr_bloodthirst(); new spell_warr_bloodthirst_heal(); + new spell_warr_charge(); + new spell_warr_concussion_blow(); + new spell_warr_deep_wounds(); + new spell_warr_execute(); + new spell_warr_improved_spell_reflection(); + new spell_warr_last_stand(); new spell_warr_overpower(); + new spell_warr_slam(); + new spell_warr_vigilance(); } -- cgit v1.2.3 From 2f1bbb2c7ae29ee9f7509395f126bd341f683046 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Sun, 13 Jan 2013 02:41:40 +0100 Subject: Misc: Reorder more scripts in some script files and some cosmetic stuff --- src/server/scripts/Spells/spell_dk.cpp | 2 +- src/server/scripts/Spells/spell_holiday.cpp | 8 +- src/server/scripts/Spells/spell_hunter.cpp | 4 - src/server/scripts/Spells/spell_rogue.cpp | 3 +- src/server/scripts/Spells/spell_shaman.cpp | 549 +++++++++++---------- src/server/scripts/Spells/spell_warlock.cpp | 714 ++++++++++++++-------------- 6 files changed, 640 insertions(+), 640 deletions(-) (limited to 'src/server/scripts/Spells') diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index afb9a625761..060db02d53c 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -172,7 +172,7 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader return true; } - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { if (!sSpellMgr->GetSpellInfo(SPELL_DK_ANTI_MAGIC_SHELL_TALENT)) return false; diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index 83532e7d72d..d883b4d7da7 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -17,6 +17,7 @@ /* * Spells used in holidays/game events that do not fit any other category. + * Ordered alphabetically using scriptname. * Scriptnames in this file should be prefixed with "spell_#holidayname_". */ @@ -133,6 +134,7 @@ class spell_hallow_end_trick : public SpellScriptLoader class spell_hallow_end_trick_SpellScript : public SpellScript { PrepareSpellScript(spell_hallow_end_trick_SpellScript); + bool Validate(SpellInfo const* /*spell*/) { if (!sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_MALE) || !sSpellMgr->GetSpellInfo(SPELL_PIRATE_COSTUME_FEMALE) || !sSpellMgr->GetSpellInfo(SPELL_NINJA_COSTUME_MALE) @@ -170,7 +172,7 @@ class spell_hallow_end_trick : public SpellScriptLoader break; } - caster->CastSpell(target, spellId, true, NULL); + caster->CastSpell(target, spellId, true); } } @@ -218,8 +220,8 @@ class spell_hallow_end_trick_or_treat : public SpellScriptLoader Unit* caster = GetCaster(); if (Player* target = GetHitPlayer()) { - caster->CastSpell(target, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true, NULL); - caster->CastSpell(target, SPELL_TRICKED_OR_TREATED, true, NULL); + caster->CastSpell(target, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true); + caster->CastSpell(target, SPELL_TRICKED_OR_TREATED, true); } } diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index b3c429d27aa..a9b21807899 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -286,7 +286,6 @@ class spell_hun_last_stand_pet : public SpellScriptLoader void Register() { - // add dummy effect spell handler to pet's Last Stand OnEffectHitTarget += SpellEffectFn(spell_hun_last_stand_pet_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; @@ -452,7 +451,6 @@ class spell_hun_pet_carrion_feeder : public SpellScriptLoader void Register() { - // add dummy effect spell handler to pet's Last Stand OnEffectHit += SpellEffectFn(spell_hun_pet_carrion_feeder_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); OnCheckCast += SpellCheckCastFn(spell_hun_pet_carrion_feeder_SpellScript::CheckIfCorpseNear); } @@ -501,7 +499,6 @@ class spell_hun_pet_heart_of_the_phoenix : public SpellScriptLoader void Register() { - // add dummy effect spell handler to pet's Last Stand OnEffectHitTarget += SpellEffectFn(spell_hun_pet_heart_of_the_phoenix_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; @@ -551,7 +548,6 @@ class spell_hun_readiness : public SpellScriptLoader void Register() { - // add dummy effect spell handler to Readiness OnEffectHitTarget += SpellEffectFn(spell_hun_readiness_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 1a2738afdbb..70b677f5aaa 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -250,7 +250,7 @@ class spell_rog_preparation : public SpellScriptLoader return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_GLYPH_OF_PREPARATION)) return false; @@ -292,7 +292,6 @@ class spell_rog_preparation : public SpellScriptLoader void Register() { - // add dummy effect spell handler to Preparation OnEffectHitTarget += SpellEffectFn(spell_rog_preparation_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index ff7c83b95a5..0d249953421 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -30,28 +30,69 @@ enum ShamanSpells { - SHAMAN_SPELL_GLYPH_OF_MANA_TIDE = 55441, - SHAMAN_SPELL_MANA_TIDE_TOTEM = 39609, - SHAMAN_SPELL_FIRE_NOVA_R1 = 1535, - SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349, - SHAMAN_SPELL_SATED = 57724, - SHAMAN_SPELL_EXHAUSTION = 57723, + SPELL_SHAMAN_ANCESTRAL_AWAKENING_PROC = 52752, + SPELL_SHAMAN_BIND_SIGHT = 6277, + SPELL_SHAMAN_CLEANSING_TOTEM_EFFECT = 52025, + SPELL_SHAMAN_EXHAUSTION = 57723, + SPELL_SHAMAN_FIRE_NOVA_R1 = 1535, + SPELL_SHAMAN_FIRE_NOVA_TRIGGERED_R1 = 8349, + SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM = 55456, + SPELL_SHAMAN_GLYPH_OF_MANA_TIDE = 55441, + SPELL_SHAMAN_LAVA_FLOWS_R1 = 51480, + SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 64694, + SPELL_SHAMAN_MANA_SPRING_TOTEM_ENERGIZE = 52032, + SPELL_SHAMAN_MANA_TIDE_TOTEM = 39609, + SPELL_SHAMAN_SATED = 57724, + SPELL_SHAMAN_STORM_EARTH_AND_FIRE = 51483, + SPELL_SHAMAN_TOTEM_EARTHBIND_EARTHGRAB = 64695, + SPELL_SHAMAN_TOTEM_EARTHBIND_TOTEM = 6474, + SPELL_SHAMAN_TOTEM_EARTHEN_POWER = 59566, + SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL = 52042 +}; - SHAMAN_SPELL_STORM_EARTH_AND_FIRE = 51483, - EARTHBIND_TOTEM_SPELL_EARTHGRAB = 64695, +enum ShamanSpellIcons +{ + SHAMAN_ICON_ID_RESTORATIVE_TOTEMS = 338, + SHAMAN_ICON_ID_SHAMAN_LAVA_FLOW = 3087 +}; - // For Earthen Power - SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM = 6474, - SHAMAN_TOTEM_SPELL_EARTHEN_POWER = 59566, +// 52759 - Ancestral Awakening (Proc) +class spell_sha_ancestral_awakening_proc : public SpellScriptLoader +{ + public: + spell_sha_ancestral_awakening_proc() : SpellScriptLoader("spell_sha_ancestral_awakening_proc") { } - SHAMAN_BIND_SIGHT = 6277, + class spell_sha_ancestral_awakening_proc_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sha_ancestral_awakening_proc_SpellScript); - ICON_ID_SHAMAN_LAVA_FLOW = 3087, - SHAMAN_LAVA_FLOWS_R1 = 51480, - SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 64694, + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ANCESTRAL_AWAKENING_PROC)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + int32 damage = GetEffectValue(); + if (GetHitUnit()) + GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_SHAMAN_ANCESTRAL_AWAKENING_PROC, &damage, NULL, NULL, true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_sha_ancestral_awakening_proc_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_sha_ancestral_awakening_proc_SpellScript(); + } }; -// 51474 - Astral shift +// 51474 - Astral Shift class spell_sha_astral_shift : public SpellScriptLoader { public: @@ -95,115 +136,136 @@ class spell_sha_astral_shift : public SpellScriptLoader } }; -// 1535 Fire Nova -class spell_sha_fire_nova : public SpellScriptLoader +// 2825 - Bloodlust +class spell_sha_bloodlust : public SpellScriptLoader { public: - spell_sha_fire_nova() : SpellScriptLoader("spell_sha_fire_nova") { } + spell_sha_bloodlust() : SpellScriptLoader("spell_sha_bloodlust") { } - class spell_sha_fire_nova_SpellScript : public SpellScript + class spell_sha_bloodlust_SpellScript : public SpellScript { - PrepareSpellScript(spell_sha_fire_nova_SpellScript); + PrepareSpellScript(spell_sha_bloodlust_SpellScript); - bool Validate(SpellInfo const* spellEntry) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_FIRE_NOVA_R1) || sSpellMgr->GetFirstSpellInChain(SHAMAN_SPELL_FIRE_NOVA_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id)) - return false; - - uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id); - if (!sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank, true)) + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_SATED)) return false; return true; } - SpellCastResult CheckFireTotem() + void RemoveInvalidTargets(std::list& targets) { - // fire totem - if (!GetCaster()->m_SummonSlot[1]) - { - SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_FIRE_TOTEM); - return SPELL_FAILED_CUSTOM_ERROR; - } + targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_SHAMAN_SATED)); + } - return SPELL_CAST_OK; + void ApplyDebuff() + { + if (Unit* target = GetHitUnit()) + target->CastSpell(target, SPELL_SHAMAN_SATED, true); } - void HandleDummy(SpellEffIndex /*effIndex*/) + void Register() { - if (Unit* caster = GetCaster()) + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID); + AfterHit += SpellHitFn(spell_sha_bloodlust_SpellScript::ApplyDebuff); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_sha_bloodlust_SpellScript(); + } +}; + +// -1064 - Chain Heal +class spell_sha_chain_heal : public SpellScriptLoader +{ + public: + spell_sha_chain_heal() : SpellScriptLoader("spell_sha_chain_heal") { } + + class spell_sha_chain_heal_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sha_chain_heal_SpellScript); + + bool Load() + { + firstHeal = true; + riptide = false; + return true; + } + + void HandleHeal(SpellEffIndex /*effIndex*/) + { + if (firstHeal) { - uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); - if (uint32 spellId = sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank)) + // Check if the target has Riptide + if (AuraEffect* aurEff = GetHitUnit()->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, 0, 0, 0x10, GetCaster()->GetGUID())) { - Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]); - if (totem && totem->isTotem()) - caster->CastSpell(totem, spellId, true); + riptide = true; + // Consume it + GetHitUnit()->RemoveAura(aurEff->GetBase()); } + firstHeal = false; } + // Riptide increases the Chain Heal effect by 25% + if (riptide) + SetHitHeal(GetHitHeal() * 1.25f); } void Register() { - OnCheckCast += SpellCheckCastFn(spell_sha_fire_nova_SpellScript::CheckFireTotem); - OnEffectHitTarget += SpellEffectFn(spell_sha_fire_nova_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_sha_chain_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); } + + bool firstHeal; + bool riptide; }; SpellScript* GetSpellScript() const { - return new spell_sha_fire_nova_SpellScript(); + return new spell_sha_chain_heal_SpellScript(); } }; -// 39610 Mana Tide Totem -class spell_sha_mana_tide_totem : public SpellScriptLoader +// 8171 - Cleansing Totem (Pulse) +class spell_sha_cleansing_totem_pulse : public SpellScriptLoader { public: - spell_sha_mana_tide_totem() : SpellScriptLoader("spell_sha_mana_tide_totem") { } + spell_sha_cleansing_totem_pulse() : SpellScriptLoader("spell_sha_cleansing_totem_pulse") { } - class spell_sha_mana_tide_totem_SpellScript : public SpellScript + class spell_sha_cleansing_totem_pulse_SpellScript : public SpellScript { - PrepareSpellScript(spell_sha_mana_tide_totem_SpellScript); + PrepareSpellScript(spell_sha_cleansing_totem_pulse_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE) || !sSpellMgr->GetSpellInfo(SHAMAN_SPELL_MANA_TIDE_TOTEM)) + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_CLEANSING_TOTEM_EFFECT)) return false; return true; } void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* caster = GetCaster()) - if (Unit* unitTarget = GetHitUnit()) - { - if (unitTarget->getPowerType() == POWER_MANA) - { - int32 effValue = GetEffectValue(); - // Glyph of Mana Tide - if (Unit* owner = caster->GetOwner()) - if (AuraEffect* dummy = owner->GetAuraEffect(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE, 0)) - effValue += dummy->GetAmount(); - // Regenerate 6% of Total Mana Every 3 secs - int32 effBasePoints0 = int32(CalculatePct(unitTarget->GetMaxPower(POWER_MANA), effValue)); - caster->CastCustomSpell(unitTarget, SHAMAN_SPELL_MANA_TIDE_TOTEM, &effBasePoints0, NULL, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID()); - } - } + int32 bp = 1; + if (GetCaster() && GetHitUnit() && GetOriginalCaster()) + GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_SHAMAN_CLEANSING_TOTEM_EFFECT, NULL, &bp, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID()); } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_sha_mana_tide_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_sha_cleansing_totem_pulse_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; SpellScript* GetSpellScript() const { - return new spell_sha_mana_tide_totem_SpellScript(); + return new spell_sha_cleansing_totem_pulse_SpellScript(); } }; -// 6474 - Earthbind Totem - Fix Talent:Earthen Power +// 6474 - Earthbind Totem - Fix Talent: Earthen Power class spell_sha_earthbind_totem : public SpellScriptLoader { public: @@ -213,9 +275,9 @@ class spell_sha_earthbind_totem : public SpellScriptLoader { PrepareAuraScript(spell_sha_earthbind_totem_AuraScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM) || !sSpellMgr->GetSpellInfo(SHAMAN_TOTEM_SPELL_EARTHEN_POWER)) + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEM_EARTHBIND_TOTEM) || !sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEM_EARTHEN_POWER)) return false; return true; } @@ -227,7 +289,7 @@ class spell_sha_earthbind_totem : public SpellScriptLoader if (Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself()) if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0)) if (roll_chance_i(aur->GetBaseAmount())) - GetTarget()->CastSpell((Unit*)NULL, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true); + GetTarget()->CastSpell((Unit*)NULL, SPELL_SHAMAN_TOTEM_EARTHEN_POWER, true); } void Apply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) @@ -238,10 +300,10 @@ class spell_sha_earthbind_totem : public SpellScriptLoader if (!owner) return; // Storm, Earth and Fire - if (AuraEffect* aurEff = owner->GetAuraEffectOfRankedSpell(SHAMAN_SPELL_STORM_EARTH_AND_FIRE, EFFECT_1)) + if (AuraEffect* aurEff = owner->GetAuraEffectOfRankedSpell(SPELL_SHAMAN_STORM_EARTH_AND_FIRE, EFFECT_1)) { if (roll_chance_i(aurEff->GetAmount())) - GetCaster()->CastSpell(GetCaster(), EARTHBIND_TOTEM_SPELL_EARTHGRAB, false); + GetCaster()->CastSpell(GetCaster(), SPELL_SHAMAN_TOTEM_EARTHBIND_EARTHGRAB, false); } } @@ -275,6 +337,7 @@ class EarthenPowerTargetSelector } }; +// 59566 - Earthen Power class spell_sha_earthen_power : public SpellScriptLoader { public: @@ -301,177 +364,112 @@ class spell_sha_earthen_power : public SpellScriptLoader } }; -class spell_sha_bloodlust : public SpellScriptLoader +// -1535 - Fire Nova +class spell_sha_fire_nova : public SpellScriptLoader { public: - spell_sha_bloodlust() : SpellScriptLoader("spell_sha_bloodlust") { } + spell_sha_fire_nova() : SpellScriptLoader("spell_sha_fire_nova") { } - class spell_sha_bloodlust_SpellScript : public SpellScript + class spell_sha_fire_nova_SpellScript : public SpellScript { - PrepareSpellScript(spell_sha_bloodlust_SpellScript); + PrepareSpellScript(spell_sha_fire_nova_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* spellInfo) { - if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_SATED)) + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_FIRE_NOVA_R1) || sSpellMgr->GetFirstSpellInChain(SPELL_SHAMAN_FIRE_NOVA_R1) != sSpellMgr->GetFirstSpellInChain(spellInfo->Id)) return false; - return true; - } - void RemoveInvalidTargets(std::list& targets) - { - targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_SATED)); - } - - void ApplyDebuff() - { - if (Unit* target = GetHitUnit()) - target->CastSpell(target, SHAMAN_SPELL_SATED, true); - } - - void Register() - { - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID); - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_bloodlust_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID); - AfterHit += SpellHitFn(spell_sha_bloodlust_SpellScript::ApplyDebuff); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_sha_bloodlust_SpellScript(); - } -}; - -class spell_sha_heroism : public SpellScriptLoader -{ - public: - spell_sha_heroism() : SpellScriptLoader("spell_sha_heroism") { } - - class spell_sha_heroism_SpellScript : public SpellScript - { - PrepareSpellScript(spell_sha_heroism_SpellScript); - - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_EXHAUSTION)) + uint8 rank = sSpellMgr->GetSpellRank(spellInfo->Id); + if (!sSpellMgr->GetSpellWithRank(SPELL_SHAMAN_FIRE_NOVA_TRIGGERED_R1, rank, true)) return false; return true; } - void RemoveInvalidTargets(std::list& targets) - { - targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_EXHAUSTION)); - } - - void ApplyDebuff() - { - if (Unit* target = GetHitUnit()) - target->CastSpell(target, SHAMAN_SPELL_EXHAUSTION, true); - } - - void Register() + SpellCastResult CheckFireTotem() { - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID); - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID); - AfterHit += SpellHitFn(spell_sha_heroism_SpellScript::ApplyDebuff); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_sha_heroism_SpellScript(); - } -}; - -enum AncestralAwakeningProc -{ - SPELL_ANCESTRAL_AWAKENING_PROC = 52752, -}; - -class spell_sha_ancestral_awakening_proc : public SpellScriptLoader -{ - public: - spell_sha_ancestral_awakening_proc() : SpellScriptLoader("spell_sha_ancestral_awakening_proc") { } - - class spell_sha_ancestral_awakening_proc_SpellScript : public SpellScript - { - PrepareSpellScript(spell_sha_ancestral_awakening_proc_SpellScript); + // fire totem + if (!GetCaster()->m_SummonSlot[1]) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_FIRE_TOTEM); + return SPELL_FAILED_CUSTOM_ERROR; + } - bool Validate(SpellInfo const* /*SpellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_ANCESTRAL_AWAKENING_PROC)) - return false; - return true; + return SPELL_CAST_OK; } - void HandleDummy(SpellEffIndex /* effIndex */) + void HandleDummy(SpellEffIndex /*effIndex*/) { - int32 damage = GetEffectValue(); - if (GetCaster() && GetHitUnit()) - GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_ANCESTRAL_AWAKENING_PROC, &damage, NULL, NULL, true); + if (Unit* caster = GetCaster()) + { + uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); + if (uint32 spellId = sSpellMgr->GetSpellWithRank(SPELL_SHAMAN_FIRE_NOVA_TRIGGERED_R1, rank)) + { + Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]); + if (totem && totem->isTotem()) + caster->CastSpell(totem, spellId, true); + } + } } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_sha_ancestral_awakening_proc_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnCheckCast += SpellCheckCastFn(spell_sha_fire_nova_SpellScript::CheckFireTotem); + OnEffectHitTarget += SpellEffectFn(spell_sha_fire_nova_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; SpellScript* GetSpellScript() const { - return new spell_sha_ancestral_awakening_proc_SpellScript(); + return new spell_sha_fire_nova_SpellScript(); } }; -enum CleansingTotemPulse -{ - SPELL_CLEANSING_TOTEM_EFFECT = 52025, -}; - -class spell_sha_cleansing_totem_pulse : public SpellScriptLoader +// -8050 - Flame Shock +class spell_sha_flame_shock : public SpellScriptLoader { public: - spell_sha_cleansing_totem_pulse() : SpellScriptLoader("spell_sha_cleansing_totem_pulse") { } + spell_sha_flame_shock() : SpellScriptLoader("spell_sha_flame_shock") { } - class spell_sha_cleansing_totem_pulse_SpellScript : public SpellScript + class spell_sha_flame_shock_AuraScript : public AuraScript { - PrepareSpellScript(spell_sha_cleansing_totem_pulse_SpellScript); + PrepareAuraScript(spell_sha_flame_shock_AuraScript); - bool Validate(SpellInfo const* /*SpellEntry*/) + bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_CLEANSING_TOTEM_EFFECT)) + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_LAVA_FLOWS_R1)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1)) return false; return true; } - void HandleDummy(SpellEffIndex /* effIndex */) + void HandleDispel(DispelInfo* /*dispelInfo*/) { - int32 bp = 1; - if (GetCaster() && GetHitUnit() && GetOriginalCaster()) - GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_CLEANSING_TOTEM_EFFECT, NULL, &bp, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID()); + if (Unit* caster = GetCaster()) + // Lava Flows + if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, SHAMAN_ICON_ID_SHAMAN_LAVA_FLOW, EFFECT_0)) + { + if (sSpellMgr->GetFirstSpellInChain(SPELL_SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId())) + return; + + uint8 rank = sSpellMgr->GetSpellRank(aurEff->GetId()); + caster->CastSpell(caster, sSpellMgr->GetSpellWithRank(SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1, rank), true); + } } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_sha_cleansing_totem_pulse_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + AfterDispel += AuraDispelFn(spell_sha_flame_shock_AuraScript::HandleDispel); } }; - SpellScript* GetSpellScript() const + AuraScript* GetAuraScript() const { - return new spell_sha_cleansing_totem_pulse_SpellScript(); + return new spell_sha_flame_shock_AuraScript(); } }; -enum HealingStreamTotem -{ - SPELL_GLYPH_OF_HEALING_STREAM_TOTEM = 55456, - ICON_ID_RESTORATIVE_TOTEMS = 338, - SPELL_HEALING_STREAM_TOTEM_HEAL = 52042, -}; - +// 52041, 52046, 52047, 52048, 52049, 52050, 58759, 58760, 58761 - Healing Stream Totem class spell_sha_healing_stream_totem : public SpellScriptLoader { public: @@ -481,14 +479,14 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader { PrepareSpellScript(spell_sha_healing_stream_totem_SpellScript); - bool Validate(SpellInfo const* /*SpellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_GLYPH_OF_HEALING_STREAM_TOTEM) || !sSpellMgr->GetSpellInfo(SPELL_HEALING_STREAM_TOTEM_HEAL)) + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM) || !sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL)) return false; return true; } - void HandleDummy(SpellEffIndex /* effIndex */) + void HandleDummy(SpellEffIndex /*effIndex*/) { int32 damage = GetEffectValue(); SpellInfo const* triggeringSpell = GetTriggeringSpell(); @@ -501,16 +499,16 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader damage = int32(owner->SpellHealingBonusDone(target, triggeringSpell, damage, HEAL)); // Restorative Totems - if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, ICON_ID_RESTORATIVE_TOTEMS, 1)) + if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, SHAMAN_ICON_ID_RESTORATIVE_TOTEMS, 1)) AddPct(damage, dummy->GetAmount()); // Glyph of Healing Stream Totem - if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_GLYPH_OF_HEALING_STREAM_TOTEM, EFFECT_0)) + if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM, EFFECT_0)) AddPct(damage, aurEff->GetAmount()); damage = int32(target->SpellHealingBonusTaken(owner, triggeringSpell, damage, HEAL)); } - caster->CastCustomSpell(target, SPELL_HEALING_STREAM_TOTEM_HEAL, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID()); + caster->CastCustomSpell(target, SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID()); } } @@ -526,49 +524,50 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader } }; -enum ManaSpringTotem -{ - SPELL_MANA_SPRING_TOTEM_ENERGIZE = 52032, -}; - -class spell_sha_mana_spring_totem : public SpellScriptLoader +// 32182 - Heroism +class spell_sha_heroism : public SpellScriptLoader { public: - spell_sha_mana_spring_totem() : SpellScriptLoader("spell_sha_mana_spring_totem") { } + spell_sha_heroism() : SpellScriptLoader("spell_sha_heroism") { } - class spell_sha_mana_spring_totem_SpellScript : public SpellScript + class spell_sha_heroism_SpellScript : public SpellScript { - PrepareSpellScript(spell_sha_mana_spring_totem_SpellScript); + PrepareSpellScript(spell_sha_heroism_SpellScript); - bool Validate(SpellInfo const* /*SpellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_MANA_SPRING_TOTEM_ENERGIZE)) + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_EXHAUSTION)) return false; return true; } - void HandleDummy(SpellEffIndex /* effIndex */) + void RemoveInvalidTargets(std::list& targets) + { + targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_SHAMAN_EXHAUSTION)); + } + + void ApplyDebuff() { - int32 damage = GetEffectValue(); if (Unit* target = GetHitUnit()) - if (Unit* caster = GetCaster()) - if (target->getPowerType() == POWER_MANA) - caster->CastCustomSpell(target, SPELL_MANA_SPRING_TOTEM_ENERGIZE, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID()); + target->CastSpell(target, SPELL_SHAMAN_EXHAUSTION, true); } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_sha_mana_spring_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID); + AfterHit += SpellHitFn(spell_sha_heroism_SpellScript::ApplyDebuff); } - }; SpellScript* GetSpellScript() const { - return new spell_sha_mana_spring_totem_SpellScript(); + return new spell_sha_heroism_SpellScript(); } }; +// 60103 - Lava Lash class spell_sha_lava_lash : public SpellScriptLoader { public: @@ -583,7 +582,7 @@ class spell_sha_lava_lash : public SpellScriptLoader return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - void HandleDummy(SpellEffIndex /* effIndex */) + void HandleDummy(SpellEffIndex /*effIndex*/) { if (Player* caster = GetCaster()->ToPlayer()) { @@ -612,100 +611,94 @@ class spell_sha_lava_lash : public SpellScriptLoader } }; -// 1064 Chain Heal -class spell_sha_chain_heal : public SpellScriptLoader +// 52031, 52033, 52034, 52035, 52036, 58778, 58779, 58780 - Mana Spring Totem +class spell_sha_mana_spring_totem : public SpellScriptLoader { public: - spell_sha_chain_heal() : SpellScriptLoader("spell_sha_chain_heal") { } + spell_sha_mana_spring_totem() : SpellScriptLoader("spell_sha_mana_spring_totem") { } - class spell_sha_chain_heal_SpellScript : public SpellScript + class spell_sha_mana_spring_totem_SpellScript : public SpellScript { - PrepareSpellScript(spell_sha_chain_heal_SpellScript); + PrepareSpellScript(spell_sha_mana_spring_totem_SpellScript); - bool Load() + bool Validate(SpellInfo const* /*spellInfo*/) { - firstHeal = true; - riptide = false; + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_MANA_SPRING_TOTEM_ENERGIZE)) + return false; return true; } - void HandleHeal(SpellEffIndex /*effIndex*/) + void HandleDummy(SpellEffIndex /*effIndex*/) { - if (firstHeal) - { - // Check if the target has Riptide - if (AuraEffect* aurEff = GetHitUnit()->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, 0, 0, 0x10, GetCaster()->GetGUID())) - { - riptide = true; - // Consume it - GetHitUnit()->RemoveAura(aurEff->GetBase()); - } - firstHeal = false; - } - // Riptide increases the Chain Heal effect by 25% - if (riptide) - SetHitHeal(GetHitHeal() * 1.25f); + int32 damage = GetEffectValue(); + if (Unit* target = GetHitUnit()) + if (Unit* caster = GetCaster()) + if (target->getPowerType() == POWER_MANA) + caster->CastCustomSpell(target, SPELL_SHAMAN_MANA_SPRING_TOTEM_ENERGIZE, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID()); } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_sha_chain_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + OnEffectHitTarget += SpellEffectFn(spell_sha_mana_spring_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } - bool firstHeal; - bool riptide; }; SpellScript* GetSpellScript() const { - return new spell_sha_chain_heal_SpellScript(); + return new spell_sha_mana_spring_totem_SpellScript(); } }; -class spell_sha_flame_shock : public SpellScriptLoader +// 39610 - Mana Tide Totem +class spell_sha_mana_tide_totem : public SpellScriptLoader { public: - spell_sha_flame_shock() : SpellScriptLoader("spell_sha_flame_shock") { } + spell_sha_mana_tide_totem() : SpellScriptLoader("spell_sha_mana_tide_totem") { } - class spell_sha_flame_shock_AuraScript : public AuraScript + class spell_sha_mana_tide_totem_SpellScript : public SpellScript { - PrepareAuraScript(spell_sha_flame_shock_AuraScript); + PrepareSpellScript(spell_sha_mana_tide_totem_SpellScript); - bool Validate(SpellInfo const* /*spell*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(SHAMAN_LAVA_FLOWS_R1)) - return false; - if (!sSpellMgr->GetSpellInfo(SHAMAN_LAVA_FLOWS_TRIGGERED_R1)) + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_GLYPH_OF_MANA_TIDE) || !sSpellMgr->GetSpellInfo(SPELL_SHAMAN_MANA_TIDE_TOTEM)) return false; return true; } - void HandleDispel(DispelInfo* /*dispelInfo*/) + void HandleDummy(SpellEffIndex /*effIndex*/) { if (Unit* caster = GetCaster()) - // Lava Flows - if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, ICON_ID_SHAMAN_LAVA_FLOW, EFFECT_0)) + if (Unit* unitTarget = GetHitUnit()) { - if (sSpellMgr->GetFirstSpellInChain(SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId())) - return; - - uint8 rank = sSpellMgr->GetSpellRank(aurEff->GetId()); - caster->CastSpell(caster, sSpellMgr->GetSpellWithRank(SHAMAN_LAVA_FLOWS_TRIGGERED_R1, rank), true); + if (unitTarget->getPowerType() == POWER_MANA) + { + int32 effValue = GetEffectValue(); + // Glyph of Mana Tide + if (Unit* owner = caster->GetOwner()) + if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_SHAMAN_GLYPH_OF_MANA_TIDE, 0)) + effValue += dummy->GetAmount(); + // Regenerate 6% of Total Mana Every 3 secs + int32 effBasePoints0 = int32(CalculatePct(unitTarget->GetMaxPower(POWER_MANA), effValue)); + caster->CastCustomSpell(unitTarget, SPELL_SHAMAN_MANA_TIDE_TOTEM, &effBasePoints0, NULL, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID()); + } } } void Register() { - AfterDispel += AuraDispelFn(spell_sha_flame_shock_AuraScript::HandleDispel); + OnEffectHitTarget += SpellEffectFn(spell_sha_mana_tide_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; - AuraScript* GetAuraScript() const + SpellScript* GetSpellScript() const { - return new spell_sha_flame_shock_AuraScript(); + return new spell_sha_mana_tide_totem_SpellScript(); } }; +// 6495 - Sentry Totem class spell_sha_sentry_totem : public SpellScriptLoader { public: @@ -717,7 +710,7 @@ class spell_sha_sentry_totem : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(SHAMAN_BIND_SIGHT)) + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_BIND_SIGHT)) return false; return true; } @@ -727,7 +720,7 @@ class spell_sha_sentry_totem : public SpellScriptLoader if (Unit* caster = GetCaster()) if (Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[4])) if (totem->isTotem()) - caster->CastSpell(totem, SHAMAN_BIND_SIGHT, true); + caster->CastSpell(totem, SPELL_SHAMAN_BIND_SIGHT, true); } void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) @@ -752,19 +745,19 @@ class spell_sha_sentry_totem : public SpellScriptLoader void AddSC_shaman_spell_scripts() { + new spell_sha_ancestral_awakening_proc(); new spell_sha_astral_shift(); - new spell_sha_fire_nova(); - new spell_sha_mana_tide_totem(); - new spell_sha_earthbind_totem(); - new spell_sha_earthen_power(); new spell_sha_bloodlust(); - new spell_sha_heroism(); - new spell_sha_ancestral_awakening_proc(); + new spell_sha_chain_heal(); new spell_sha_cleansing_totem_pulse(); + new spell_sha_earthbind_totem(); + new spell_sha_earthen_power(); + new spell_sha_fire_nova(); + new spell_sha_flame_shock(); new spell_sha_healing_stream_totem(); - new spell_sha_mana_spring_totem(); + new spell_sha_heroism(); new spell_sha_lava_lash(); - new spell_sha_chain_heal(); - new spell_sha_flame_shock(); + new spell_sha_mana_spring_totem(); + new spell_sha_mana_tide_totem(); new spell_sha_sentry_totem(); } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 2070933173b..89c69733daf 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -28,141 +28,88 @@ enum WarlockSpells { - WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS = 54435, - WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER = 54443, - WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD = 54508, - WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER = 54509, - WARLOCK_DEMONIC_EMPOWERMENT_IMP = 54444, - WARLOCK_IMPROVED_HEALTHSTONE_R1 = 18692, - WARLOCK_IMPROVED_HEALTHSTONE_R2 = 18693, - WARLOCK_DEMONIC_CIRCLE_SUMMON = 48018, - WARLOCK_DEMONIC_CIRCLE_TELEPORT = 48020, - WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388, - WARLOCK_HAUNT = 48181, - WARLOCK_HAUNT_HEAL = 48210, - WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117, - WARLOCK_CURSE_OF_DOOM_EFFECT = 18662, - WARLOCK_IMPROVED_HEALTH_FUNNEL_R1 = 18703, - WARLOCK_IMPROVED_HEALTH_FUNNEL_R2 = 18704, - WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1 = 60955, - WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2 = 60956, + SPELL_WARLOCK_CURSE_OF_DOOM_EFFECT = 18662, + SPELL_WARLOCK_DEMONIC_CIRCLE_SUMMON = 48018, + SPELL_WARLOCK_DEMONIC_CIRCLE_TELEPORT = 48020, + SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388, + SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS = 54435, + SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER = 54443, + SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD = 54508, + SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER = 54509, + SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP = 54444, + SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R1 = 18692, + SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R2 = 18693, + SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R1 = 18703, + SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R2 = 18704, + SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1 = 60955, + SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2 = 60956, + SPELL_WARLOCK_HAUNT = 48181, + SPELL_WARLOCK_HAUNT_HEAL = 48210, + SPELL_WARLOCK_LIFE_TAP_ENERGIZE = 31818, + SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2 = 32553, + SPELL_WARLOCK_SOULSHATTER = 32835, + SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117 }; -class spell_warl_banish : public SpellScriptLoader +enum WarlockSpellIcons { -public: - spell_warl_banish() : SpellScriptLoader("spell_warl_banish") { } - - class spell_warl_banish_SpellScript : public SpellScript - { - PrepareSpellScript(spell_warl_banish_SpellScript); - - bool Load() - { - _removed = false; - return true; - } - - void HandleBanish() - { - if (Unit* target = GetHitUnit()) - { - if (target->GetAuraEffect(SPELL_AURA_SCHOOL_IMMUNITY, SPELLFAMILY_WARLOCK, 0, 0x08000000, 0)) - { - //No need to remove old aura since its removed due to not stack by current Banish aura - PreventHitDefaultEffect(EFFECT_0); - PreventHitDefaultEffect(EFFECT_1); - PreventHitDefaultEffect(EFFECT_2); - _removed = true; - } - } - } - - void RemoveAura() - { - if (_removed) - PreventHitAura(); - } - - void Register() - { - BeforeHit += SpellHitFn(spell_warl_banish_SpellScript::HandleBanish); - AfterHit += SpellHitFn(spell_warl_banish_SpellScript::RemoveAura); - } - - bool _removed; - }; - - SpellScript* GetSpellScript() const - { - return new spell_warl_banish_SpellScript(); - } + WARLOCK_ICON_ID_IMPROVED_LIFE_TAP = 208, + WARLOCK_ICON_ID_MANA_FEED = 1982 }; -// 47193 Demonic Empowerment -class spell_warl_demonic_empowerment : public SpellScriptLoader +// 710, 18647 - Banish +class spell_warl_banish : public SpellScriptLoader { public: - spell_warl_demonic_empowerment() : SpellScriptLoader("spell_warl_demonic_empowerment") { } + spell_warl_banish() : SpellScriptLoader("spell_warl_banish") { } - class spell_warl_demonic_empowerment_SpellScript : public SpellScript + class spell_warl_banish_SpellScript : public SpellScript { - PrepareSpellScript(spell_warl_demonic_empowerment_SpellScript); + PrepareSpellScript(spell_warl_banish_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Load() { - if (!sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER) || !sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_IMP)) - return false; + _removed = false; return true; } - void HandleScriptEffect(SpellEffIndex /*effIndex*/) + void HandleBanish() { - if (Creature* targetCreature = GetHitCreature()) + if (Unit* target = GetHitUnit()) { - if (targetCreature->isPet()) + if (target->GetAuraEffect(SPELL_AURA_SCHOOL_IMMUNITY, SPELLFAMILY_WARLOCK, 0, 0x08000000, 0)) { - CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(targetCreature->GetEntry()); - switch (ci->family) - { - case CREATURE_FAMILY_SUCCUBUS: - targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS, true); - break; - case CREATURE_FAMILY_VOIDWALKER: - { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER); - int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0))); - targetCreature->CastCustomSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, NULL, NULL, true); - //unitTarget->CastSpell(unitTarget, 54441, true); - break; - } - case CREATURE_FAMILY_FELGUARD: - targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD, true); - break; - case CREATURE_FAMILY_FELHUNTER: - targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER, true); - break; - case CREATURE_FAMILY_IMP: - targetCreature->CastSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_IMP, true); - break; - } + // No need to remove old aura since its removed due to not stack by current Banish aura + PreventHitDefaultEffect(EFFECT_0); + PreventHitDefaultEffect(EFFECT_1); + PreventHitDefaultEffect(EFFECT_2); + _removed = true; } } } + void RemoveAura() + { + if (_removed) + PreventHitAura(); + } + void Register() { - OnEffectHitTarget += SpellEffectFn(spell_warl_demonic_empowerment_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + BeforeHit += SpellHitFn(spell_warl_banish_SpellScript::HandleBanish); + AfterHit += SpellHitFn(spell_warl_banish_SpellScript::RemoveAura); } + + bool _removed; }; SpellScript* GetSpellScript() const { - return new spell_warl_demonic_empowerment_SpellScript(); + return new spell_warl_banish_SpellScript(); } }; -// 6201 Create Healthstone (and ranks) +// 6201 - Create Healthstone (and ranks) class spell_warl_create_healthstone : public SpellScriptLoader { public: @@ -174,9 +121,9 @@ class spell_warl_create_healthstone : public SpellScriptLoader static uint32 const iTypes[8][3]; - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(WARLOCK_IMPROVED_HEALTHSTONE_R1) || !sSpellMgr->GetSpellInfo(WARLOCK_IMPROVED_HEALTHSTONE_R2)) + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R1) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R2)) return false; return true; } @@ -204,8 +151,12 @@ class spell_warl_create_healthstone : public SpellScriptLoader { switch (aurEff->GetId()) { - case WARLOCK_IMPROVED_HEALTHSTONE_R1: rank = 1; break; - case WARLOCK_IMPROVED_HEALTHSTONE_R2: rank = 2; break; + case SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R1: + rank = 1; + break; + case SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R2: + rank = 2; + break; default: sLog->outError(LOG_FILTER_SPELLS_AURAS, "Unknown rank of Improved Healthstone id: %d", aurEff->GetId()); break; @@ -241,142 +192,336 @@ uint32 const spell_warl_create_healthstone::spell_warl_create_healthstone_SpellS {36892, 36893, 36894} // Fel Healthstone }; -// 47422 Everlasting Affliction -class spell_warl_everlasting_affliction : public SpellScriptLoader +// -603 - Curse of Doom +class spell_warl_curse_of_doom : public SpellScriptLoader { public: - spell_warl_everlasting_affliction() : SpellScriptLoader("spell_warl_everlasting_affliction") { } + spell_warl_curse_of_doom() : SpellScriptLoader("spell_warl_curse_of_doom") { } - class spell_warl_everlasting_affliction_SpellScript : public SpellScript + class spell_warl_curse_of_doom_AuraScript : public AuraScript { - PrepareSpellScript(spell_warl_everlasting_affliction_SpellScript); + PrepareAuraScript(spell_warl_curse_of_doom_AuraScript); - void HandleScriptEffect(SpellEffIndex /*effIndex*/) + bool Validate(SpellInfo const* /*spell*/) { - if (Unit* unitTarget = GetHitUnit()) - // Refresh corruption on target - if (AuraEffect* aur = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x2, 0, 0, GetCaster()->GetGUID())) - aur->GetBase()->RefreshDuration(); + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_CURSE_OF_DOOM_EFFECT)) + return false; + return true; + } + + bool Load() + { + return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (!GetCaster()) + return; + + AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode(); + if (removeMode != AURA_REMOVE_BY_DEATH || !IsExpired()) + return; + + if (GetCaster()->ToPlayer()->isHonorOrXPTarget(GetTarget())) + GetCaster()->CastSpell(GetTarget(), SPELL_WARLOCK_CURSE_OF_DOOM_EFFECT, true, NULL, aurEff); } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_warl_everlasting_affliction_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + AfterEffectRemove += AuraEffectRemoveFn(spell_warl_curse_of_doom_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL); } }; - SpellScript* GetSpellScript() const + AuraScript* GetAuraScript() const { - return new spell_warl_everlasting_affliction_SpellScript(); + return new spell_warl_curse_of_doom_AuraScript(); } }; -// 18541 Ritual of Doom Effect -class spell_warl_ritual_of_doom_effect : public SpellScriptLoader +// 48018 - Demonic Circle Summon +class spell_warl_demonic_circle_summon : public SpellScriptLoader { -public: - spell_warl_ritual_of_doom_effect() : SpellScriptLoader("spell_warl_ritual_of_doom_effect") { } + public: + spell_warl_demonic_circle_summon() : SpellScriptLoader("spell_warl_demonic_circle_summon") { } + + class spell_warl_demonic_circle_summon_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_demonic_circle_summon_AuraScript); + + void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes mode) + { + // If effect is removed by expire remove the summoned demonic circle too. + if (!(mode & AURA_EFFECT_HANDLE_REAPPLY)) + GetTarget()->RemoveGameObject(GetId(), true); + + GetTarget()->RemoveAura(SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST); + } + + void HandleDummyTick(AuraEffect const* /*aurEff*/) + { + if (GameObject* circle = GetTarget()->GetGameObject(GetId())) + { + // Here we check if player is in demonic circle teleport range, if so add + // WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST; allowing him to cast the WARLOCK_DEMONIC_CIRCLE_TELEPORT. + // If not in range remove the WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST. + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_CIRCLE_TELEPORT); + + if (GetTarget()->IsWithinDist(circle, spellInfo->GetMaxRange(true))) + { + if (!GetTarget()->HasAura(SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST)) + GetTarget()->CastSpell(GetTarget(), SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST, true); + } + else + GetTarget()->RemoveAura(SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST); + } + } - class spell_warl_ritual_of_doom_effect_SpellScript : public SpellScript - { - PrepareSpellScript(spell_warl_ritual_of_doom_effect_SpellScript); + void Register() + { + OnEffectRemove += AuraEffectApplyFn(spell_warl_demonic_circle_summon_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_warl_demonic_circle_summon_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; - void HandleDummy(SpellEffIndex /*effIndex*/) + AuraScript* GetAuraScript() const { - Unit* caster = GetCaster(); - caster->CastSpell(caster, GetEffectValue(), true); + return new spell_warl_demonic_circle_summon_AuraScript(); } +}; - void Register() +// 48020 - Demonic Circle Teleport +class spell_warl_demonic_circle_teleport : public SpellScriptLoader +{ + public: + spell_warl_demonic_circle_teleport() : SpellScriptLoader("spell_warl_demonic_circle_teleport") { } + + class spell_warl_demonic_circle_teleport_AuraScript : public AuraScript { - OnEffectHit += SpellEffectFn(spell_warl_ritual_of_doom_effect_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + PrepareAuraScript(spell_warl_demonic_circle_teleport_AuraScript); - SpellScript* GetSpellScript() const - { - return new spell_warl_ritual_of_doom_effect_SpellScript(); - } + void HandleTeleport(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Player* player = GetTarget()->ToPlayer()) + { + if (GameObject* circle = player->GetGameObject(SPELL_WARLOCK_DEMONIC_CIRCLE_SUMMON)) + { + player->NearTeleportTo(circle->GetPositionX(), circle->GetPositionY(), circle->GetPositionZ(), circle->GetOrientation()); + player->RemoveMovementImpairingAuras(); + } + } + } + + void Register() + { + OnEffectApply += AuraEffectApplyFn(spell_warl_demonic_circle_teleport_AuraScript::HandleTeleport, EFFECT_0, SPELL_AURA_MECHANIC_IMMUNITY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_demonic_circle_teleport_AuraScript(); + } }; -class spell_warl_seed_of_corruption : public SpellScriptLoader +// 47193 - Demonic Empowerment +class spell_warl_demonic_empowerment : public SpellScriptLoader { public: - spell_warl_seed_of_corruption() : SpellScriptLoader("spell_warl_seed_of_corruption") { } + spell_warl_demonic_empowerment() : SpellScriptLoader("spell_warl_demonic_empowerment") { } - class spell_warl_seed_of_corruption_SpellScript : public SpellScript + class spell_warl_demonic_empowerment_SpellScript : public SpellScript { - PrepareSpellScript(spell_warl_seed_of_corruption_SpellScript); + PrepareSpellScript(spell_warl_demonic_empowerment_SpellScript); - void FilterTargets(std::list& targets) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (GetExplTargetUnit()) - targets.remove(GetExplTargetUnit()); + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP)) + return false; + return true; + } + + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + if (Creature* targetCreature = GetHitCreature()) + { + if (targetCreature->isPet()) + { + CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(targetCreature->GetEntry()); + switch (ci->family) + { + case CREATURE_FAMILY_SUCCUBUS: + targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS, true); + break; + case CREATURE_FAMILY_VOIDWALKER: + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER); + int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0))); + targetCreature->CastCustomSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, NULL, NULL, true); + //unitTarget->CastSpell(unitTarget, 54441, true); + break; + } + case CREATURE_FAMILY_FELGUARD: + targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD, true); + break; + case CREATURE_FAMILY_FELHUNTER: + targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER, true); + break; + case CREATURE_FAMILY_IMP: + targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP, true); + break; + } + } + } } void Register() { - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warl_seed_of_corruption_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + OnEffectHitTarget += SpellEffectFn(spell_warl_demonic_empowerment_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; SpellScript* GetSpellScript() const { - return new spell_warl_seed_of_corruption_SpellScript(); + return new spell_warl_demonic_empowerment_SpellScript(); } }; -enum Soulshatter +// 47422 - Everlasting Affliction +class spell_warl_everlasting_affliction : public SpellScriptLoader { - SPELL_SOULSHATTER = 32835, + public: + spell_warl_everlasting_affliction() : SpellScriptLoader("spell_warl_everlasting_affliction") { } + + class spell_warl_everlasting_affliction_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warl_everlasting_affliction_SpellScript); + + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + if (Unit* unitTarget = GetHitUnit()) + // Refresh corruption on target + if (AuraEffect* aur = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x2, 0, 0, GetCaster()->GetGUID())) + aur->GetBase()->RefreshDuration(); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warl_everlasting_affliction_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warl_everlasting_affliction_SpellScript(); + } }; -class spell_warl_soulshatter : public SpellScriptLoader +// -48181 - Haunt +class spell_warl_haunt : public SpellScriptLoader { public: - spell_warl_soulshatter() : SpellScriptLoader("spell_warl_soulshatter") { } + spell_warl_haunt() : SpellScriptLoader("spell_warl_haunt") { } - class spell_warl_soulshatter_SpellScript : public SpellScript + class spell_warl_haunt_SpellScript : public SpellScript { - PrepareSpellScript(spell_warl_soulshatter_SpellScript); + PrepareSpellScript(spell_warl_haunt_SpellScript); + + void HandleOnHit() + { + if (Aura* aura = GetHitAura()) + if (AuraEffect* aurEff = aura->GetEffect(EFFECT_1)) + aurEff->SetAmount(CalculatePct(aurEff->GetAmount(), GetHitDamage())); + } + + void Register() + { + OnHit += SpellHitFn(spell_warl_haunt_SpellScript::HandleOnHit); + } + }; + + class spell_warl_haunt_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_haunt_AuraScript); bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_SOULSHATTER)) + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_HAUNT_HEAL)) return false; return true; } - void HandleDummy(SpellEffIndex /*effIndex*/) + void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { - Unit* caster = GetCaster(); - if (Unit* target = GetHitUnit()) + if (Unit* caster = GetCaster()) { - if (target->CanHaveThreatList() && target->getThreatManager().getThreat(caster) > 0.0f) - caster->CastSpell(target, SPELL_SOULSHATTER, true); + int32 amount = aurEff->GetAmount(); + GetTarget()->CastCustomSpell(caster, SPELL_WARLOCK_HAUNT_HEAL, &amount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); } } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_warl_soulshatter_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectRemove += AuraEffectApplyFn(spell_warl_haunt_AuraScript::HandleRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); } }; SpellScript* GetSpellScript() const { - return new spell_warl_soulshatter_SpellScript(); + return new spell_warl_haunt_SpellScript(); + } + + AuraScript* GetAuraScript() const + { + return new spell_warl_haunt_AuraScript(); } }; -enum LifeTap +// -755 - Health Funnel +class spell_warl_health_funnel : public SpellScriptLoader { - SPELL_LIFE_TAP_ENERGIZE = 31818, - SPELL_LIFE_TAP_ENERGIZE_2 = 32553, - ICON_ID_IMPROVED_LIFE_TAP = 208, - ICON_ID_MANA_FEED = 1982, + public: + spell_warl_health_funnel() : SpellScriptLoader("spell_warl_health_funnel") { } + + class spell_warl_health_funnel_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_health_funnel_AuraScript); + + void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + Unit* target = GetTarget(); + if (caster->HasAura(SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R2)) + target->CastSpell(target, SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2, true); + else if (caster->HasAura(SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R1)) + target->CastSpell(target, SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1, true); + } + + void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + target->RemoveAurasDueToSpell(SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1); + target->RemoveAurasDueToSpell(SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2); + } + + void Register() + { + OnEffectRemove += AuraEffectRemoveFn(spell_warl_health_funnel_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL); + OnEffectApply += AuraEffectApplyFn(spell_warl_health_funnel_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_health_funnel_AuraScript(); + } }; +// -1454 - Life Tap class spell_warl_life_tap : public SpellScriptLoader { public: @@ -393,7 +538,7 @@ class spell_warl_life_tap : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE) || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE_2)) + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_LIFE_TAP_ENERGIZE) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2)) return false; return true; } @@ -410,20 +555,20 @@ class spell_warl_life_tap : public SpellScriptLoader target->ModifyHealth(-damage); // Improved Life Tap mod - if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, ICON_ID_IMPROVED_LIFE_TAP, 0)) + if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, WARLOCK_ICON_ID_IMPROVED_LIFE_TAP, 0)) AddPct(mana, aurEff->GetAmount()); - caster->CastCustomSpell(target, SPELL_LIFE_TAP_ENERGIZE, &mana, NULL, NULL, false); + caster->CastCustomSpell(target, SPELL_WARLOCK_LIFE_TAP_ENERGIZE, &mana, NULL, NULL, false); // Mana Feed int32 manaFeedVal = 0; - if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, ICON_ID_MANA_FEED, 0)) + if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, WARLOCK_ICON_ID_MANA_FEED, 0)) manaFeedVal = aurEff->GetAmount(); if (manaFeedVal > 0) { ApplyPct(manaFeedVal, mana); - caster->CastCustomSpell(caster, SPELL_LIFE_TAP_ENERGIZE_2, &manaFeedVal, NULL, NULL, true, NULL); + caster->CastCustomSpell(caster, SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2, &manaFeedVal, NULL, NULL, true, NULL); } } } @@ -448,149 +593,102 @@ class spell_warl_life_tap : public SpellScriptLoader } }; -class spell_warl_demonic_circle_summon : public SpellScriptLoader +// 18541 - Ritual of Doom Effect +class spell_warl_ritual_of_doom_effect : public SpellScriptLoader { public: - spell_warl_demonic_circle_summon() : SpellScriptLoader("spell_warl_demonic_circle_summon") { } + spell_warl_ritual_of_doom_effect() : SpellScriptLoader("spell_warl_ritual_of_doom_effect") { } - class spell_warl_demonic_circle_summon_AuraScript : public AuraScript + class spell_warl_ritual_of_doom_effect_SpellScript : public SpellScript { - PrepareAuraScript(spell_warl_demonic_circle_summon_AuraScript); - - void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes mode) - { - // If effect is removed by expire remove the summoned demonic circle too. - if (!(mode & AURA_EFFECT_HANDLE_REAPPLY)) - GetTarget()->RemoveGameObject(GetId(), true); + PrepareSpellScript(spell_warl_ritual_of_doom_effect_SpellScript); - GetTarget()->RemoveAura(WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST); - } - - void HandleDummyTick(AuraEffect const* /*aurEff*/) + void HandleDummy(SpellEffIndex /*effIndex*/) { - if (GameObject* circle = GetTarget()->GetGameObject(GetId())) - { - // Here we check if player is in demonic circle teleport range, if so add - // WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST; allowing him to cast the WARLOCK_DEMONIC_CIRCLE_TELEPORT. - // If not in range remove the WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST. - - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_CIRCLE_TELEPORT); - - if (GetTarget()->IsWithinDist(circle, spellInfo->GetMaxRange(true))) - { - if (!GetTarget()->HasAura(WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST)) - GetTarget()->CastSpell(GetTarget(), WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST, true); - } - else - GetTarget()->RemoveAura(WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST); - } + Unit* caster = GetCaster(); + caster->CastSpell(caster, GetEffectValue(), true); } void Register() { - OnEffectRemove += AuraEffectApplyFn(spell_warl_demonic_circle_summon_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - OnEffectPeriodic += AuraEffectPeriodicFn(spell_warl_demonic_circle_summon_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + OnEffectHit += SpellEffectFn(spell_warl_ritual_of_doom_effect_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; - AuraScript* GetAuraScript() const + SpellScript* GetSpellScript() const { - return new spell_warl_demonic_circle_summon_AuraScript(); + return new spell_warl_ritual_of_doom_effect_SpellScript(); } }; -class spell_warl_demonic_circle_teleport : public SpellScriptLoader +// -27285 - Seed of Corruption +class spell_warl_seed_of_corruption : public SpellScriptLoader { public: - spell_warl_demonic_circle_teleport() : SpellScriptLoader("spell_warl_demonic_circle_teleport") { } + spell_warl_seed_of_corruption() : SpellScriptLoader("spell_warl_seed_of_corruption") { } - class spell_warl_demonic_circle_teleport_AuraScript : public AuraScript + class spell_warl_seed_of_corruption_SpellScript : public SpellScript { - PrepareAuraScript(spell_warl_demonic_circle_teleport_AuraScript); + PrepareSpellScript(spell_warl_seed_of_corruption_SpellScript); - void HandleTeleport(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void FilterTargets(std::list& targets) { - if (Player* player = GetTarget()->ToPlayer()) - { - if (GameObject* circle = player->GetGameObject(WARLOCK_DEMONIC_CIRCLE_SUMMON)) - { - player->NearTeleportTo(circle->GetPositionX(), circle->GetPositionY(), circle->GetPositionZ(), circle->GetOrientation()); - player->RemoveMovementImpairingAuras(); - } - } + if (GetExplTargetUnit()) + targets.remove(GetExplTargetUnit()); } void Register() { - OnEffectApply += AuraEffectApplyFn(spell_warl_demonic_circle_teleport_AuraScript::HandleTeleport, EFFECT_0, SPELL_AURA_MECHANIC_IMMUNITY, AURA_EFFECT_HANDLE_REAL); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warl_seed_of_corruption_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); } }; - AuraScript* GetAuraScript() const + SpellScript* GetSpellScript() const { - return new spell_warl_demonic_circle_teleport_AuraScript(); + return new spell_warl_seed_of_corruption_SpellScript(); } }; -class spell_warl_haunt : public SpellScriptLoader +// 29858 - Soulshatter +class spell_warl_soulshatter : public SpellScriptLoader { public: - spell_warl_haunt() : SpellScriptLoader("spell_warl_haunt") { } - - class spell_warl_haunt_SpellScript : public SpellScript - { - PrepareSpellScript(spell_warl_haunt_SpellScript); - - void HandleOnHit() - { - if (Aura* aura = GetHitAura()) - if (AuraEffect* aurEff = aura->GetEffect(EFFECT_1)) - aurEff->SetAmount(CalculatePct(aurEff->GetAmount(), GetHitDamage())); - } - - void Register() - { - OnHit += SpellHitFn(spell_warl_haunt_SpellScript::HandleOnHit); - } - }; + spell_warl_soulshatter() : SpellScriptLoader("spell_warl_soulshatter") { } - class spell_warl_haunt_AuraScript : public AuraScript + class spell_warl_soulshatter_SpellScript : public SpellScript { - PrepareAuraScript(spell_warl_haunt_AuraScript); + PrepareSpellScript(spell_warl_soulshatter_SpellScript); bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(WARLOCK_HAUNT_HEAL)) + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOULSHATTER)) return false; return true; } - void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* caster = GetCaster()) + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) { - int32 amount = aurEff->GetAmount(); - GetTarget()->CastCustomSpell(caster, WARLOCK_HAUNT_HEAL, &amount, NULL, NULL, true, NULL, aurEff, GetCasterGUID()); + if (target->CanHaveThreatList() && target->getThreatManager().getThreat(caster) > 0.0f) + caster->CastSpell(target, SPELL_WARLOCK_SOULSHATTER, true); } } void Register() { - OnEffectRemove += AuraEffectApplyFn(spell_warl_haunt_AuraScript::HandleRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectHitTarget += SpellEffectFn(spell_warl_soulshatter_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; SpellScript* GetSpellScript() const { - return new spell_warl_haunt_SpellScript(); - } - - AuraScript* GetAuraScript() const - { - return new spell_warl_haunt_AuraScript(); + return new spell_warl_soulshatter_SpellScript(); } }; +// -30108 - Unstable Affliction class spell_warl_unstable_affliction : public SpellScriptLoader { public: @@ -602,7 +700,7 @@ class spell_warl_unstable_affliction : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(WARLOCK_UNSTABLE_AFFLICTION_DISPEL)) + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL)) return false; return true; } @@ -614,7 +712,7 @@ class spell_warl_unstable_affliction : public SpellScriptLoader { int32 damage = aurEff->GetAmount() * 9; // backfire damage and silence - caster->CastCustomSpell(dispelInfo->GetDispeller(), WARLOCK_UNSTABLE_AFFLICTION_DISPEL, &damage, NULL, NULL, true, NULL, aurEff); + caster->CastCustomSpell(dispelInfo->GetDispeller(), SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL, &damage, NULL, NULL, true, NULL, aurEff); } } @@ -630,108 +728,20 @@ class spell_warl_unstable_affliction : public SpellScriptLoader } }; -class spell_warl_curse_of_doom : public SpellScriptLoader -{ - public: - spell_warl_curse_of_doom() : SpellScriptLoader("spell_warl_curse_of_doom") { } - - class spell_warl_curse_of_doom_AuraScript : public AuraScript - { - PrepareAuraScript(spell_warl_curse_of_doom_AuraScript); - - bool Validate(SpellInfo const* /*spell*/) - { - if (!sSpellMgr->GetSpellInfo(WARLOCK_CURSE_OF_DOOM_EFFECT)) - return false; - return true; - } - - bool Load() - { - return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER; - } - - void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) - { - if (!GetCaster()) - return; - - AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode(); - if (removeMode != AURA_REMOVE_BY_DEATH || !IsExpired()) - return; - - if (GetCaster()->ToPlayer()->isHonorOrXPTarget(GetTarget())) - GetCaster()->CastSpell(GetTarget(), WARLOCK_CURSE_OF_DOOM_EFFECT, true, NULL, aurEff); - } - - void Register() - { - AfterEffectRemove += AuraEffectRemoveFn(spell_warl_curse_of_doom_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_warl_curse_of_doom_AuraScript(); - } -}; - -class spell_warl_health_funnel : public SpellScriptLoader -{ -public: - spell_warl_health_funnel() : SpellScriptLoader("spell_warl_health_funnel") { } - - class spell_warl_health_funnel_AuraScript : public AuraScript - { - PrepareAuraScript(spell_warl_health_funnel_AuraScript); - - void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* caster = GetCaster(); - if (!caster) - return; - - Unit* target = GetTarget(); - if (caster->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R2)) - target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2, true); - else if (caster->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R1)) - target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1, true); - } - - void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1); - target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2); - } - - void Register() - { - OnEffectRemove += AuraEffectRemoveFn(spell_warl_health_funnel_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL); - OnEffectApply += AuraEffectApplyFn(spell_warl_health_funnel_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_warl_health_funnel_AuraScript(); - } -}; - void AddSC_warlock_spell_scripts() { new spell_warl_banish(); - new spell_warl_demonic_empowerment(); new spell_warl_create_healthstone(); + new spell_warl_curse_of_doom(); + new spell_warl_demonic_circle_summon(); + new spell_warl_demonic_circle_teleport(); + new spell_warl_demonic_empowerment(); new spell_warl_everlasting_affliction(); + new spell_warl_haunt(); + new spell_warl_health_funnel(); + new spell_warl_life_tap(); new spell_warl_ritual_of_doom_effect(); new spell_warl_seed_of_corruption(); new spell_warl_soulshatter(); - new spell_warl_life_tap(); - new spell_warl_demonic_circle_summon(); - new spell_warl_demonic_circle_teleport(); - new spell_warl_haunt(); new spell_warl_unstable_affliction(); - new spell_warl_curse_of_doom(); - new spell_warl_health_funnel(); } -- cgit v1.2.3 From 0b079126221d1bf4fc2aa05a699dc3b379c77e58 Mon Sep 17 00:00:00 2001 From: Gacko Date: Sun, 13 Jan 2013 15:37:01 +0100 Subject: Fix nonpch build and warning. Move script to spell_quest.cpp --- .../2013_01_13_03_world_spell_script_names.sql | 4 ++ .../EasternKingdoms/ScarletEnclave/chapter1.cpp | 2 +- src/server/scripts/Northrend/zone_zuldrak.cpp | 45 ---------------------- src/server/scripts/Spells/spell_quest.cpp | 45 ++++++++++++++++++++++ 4 files changed, 50 insertions(+), 46 deletions(-) create mode 100644 sql/updates/world/2013_01_13_03_world_spell_script_names.sql (limited to 'src/server/scripts/Spells') diff --git a/sql/updates/world/2013_01_13_03_world_spell_script_names.sql b/sql/updates/world/2013_01_13_03_world_spell_script_names.sql new file mode 100644 index 00000000000..a776ea4a765 --- /dev/null +++ b/sql/updates/world/2013_01_13_03_world_spell_script_names.sql @@ -0,0 +1,4 @@ +-- Zul'drak Rat spell: Script assignment +DELETE FROM `spell_script_names` WHERE `spell_id`=50894; +INSERT INTO `spell_script_names`(`spell_id`,`ScriptName`) VALUE +(50894,'spell_q12527_zuldrak_rat'); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 97fe57c5434..96293c635d6 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -146,7 +146,7 @@ public: me->CastSpell(me, SPELL_DK_INITIATE_VISUAL, true); if (Player* starter = Unit::GetPlayer(*me, playerGUID)) - Talk(SAY_EVENT_ATTACK); + sCreatureTextMgr->SendChat(me, SAY_EVENT_ATTACK, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, starter); phase = PHASE_TO_ATTACK; } diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp index 1d53d229992..69e8d900435 100644 --- a/src/server/scripts/Northrend/zone_zuldrak.cpp +++ b/src/server/scripts/Northrend/zone_zuldrak.cpp @@ -21,7 +21,6 @@ #include "ScriptedEscortAI.h" #include "Player.h" #include "SpellInfo.h" -#include "SpellScript.h" /*#### ## npc_drakuru_shackles @@ -1414,49 +1413,6 @@ public: } }; -enum SpellZuldrakRat -{ - SPELL_SUMMON_GORGED_LURKING_BASILISK = 50928 -}; - -class spell_zuldrak_rat : public SpellScriptLoader -{ - public: - spell_zuldrak_rat() : SpellScriptLoader("spell_zuldrak_rat") { } - - class spell_zuldrak_rat_SpellScript : public SpellScript - { - PrepareSpellScript(spell_zuldrak_rat_SpellScript); - - bool Validate(SpellInfo const* /*spell*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_GORGED_LURKING_BASILISK)) - return false; - return true; - } - - void HandleScriptEffect(SpellEffIndex /* effIndex */) - { - if (GetHitAura() && GetHitAura()->GetStackAmount() >= GetSpellInfo()->StackAmount) - { - GetHitUnit()->CastSpell((Unit*) NULL, SPELL_SUMMON_GORGED_LURKING_BASILISK, true); - if (Creature* basilisk = GetHitUnit()->ToCreature()) - basilisk->DespawnOrUnsummon(); - } - } - - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_zuldrak_rat_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_zuldrak_rat_SpellScript(); - } -}; - void AddSC_zuldrak() { new npc_drakuru_shackles; @@ -1472,5 +1428,4 @@ void AddSC_zuldrak() new npc_elemental_lord; new npc_fiend_elemental; new go_scourge_enclosure; - new spell_zuldrak_rat(); } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 9cd94e9c7d5..49a47a17392 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -25,6 +25,7 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "SpellScript.h" +#include "SpellAuras.h" #include "Vehicle.h" #include "GridNotifiers.h" #include "GridNotifiersImpl.h" @@ -1517,6 +1518,49 @@ class spell_q11010_q11102_q11023_q11008_check_fly_mount : public SpellScriptLoad } }; +enum SpellZuldrakRat +{ + SPELL_SUMMON_GORGED_LURKING_BASILISK = 50928 +}; + +class spell_q12527_zuldrak_rat : public SpellScriptLoader +{ + public: + spell_q12527_zuldrak_rat() : SpellScriptLoader("spell_q12527_zuldrak_rat") { } + + class spell_q12527_zuldrak_rat_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12527_zuldrak_rat_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_GORGED_LURKING_BASILISK)) + return false; + return true; + } + + void HandleScriptEffect(SpellEffIndex /* effIndex */) + { + if (GetHitAura() && GetHitAura()->GetStackAmount() >= GetSpellInfo()->StackAmount) + { + GetHitUnit()->CastSpell((Unit*) NULL, SPELL_SUMMON_GORGED_LURKING_BASILISK, true); + if (Creature* basilisk = GetHitUnit()->ToCreature()) + basilisk->DespawnOrUnsummon(); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q12527_zuldrak_rat_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_q12527_zuldrak_rat_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -1554,4 +1598,5 @@ void AddSC_quest_spell_scripts() new spell_q11010_q11102_q11023_choose_loc(); new spell_q11010_q11102_q11023_q11008_check_fly_mount(); new spell_q12372_azure_on_death_force_whisper(); + new spell_q12527_zuldrak_rat(); } -- cgit v1.2.3 From 802657250c20088d7f42ec7c836589a532e66fcc Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 14 Jan 2013 09:50:59 +0100 Subject: Core/Misc: Apply codestyle to multiple files --- src/server/authserver/Server/AuthSocket.cpp | 2 +- src/server/collision/DynamicTree.cpp | 6 +- src/server/collision/Maps/TileAssembler.cpp | 10 +- src/server/collision/Maps/TileAssembler.h | 4 +- src/server/collision/Models/GameObjectModel.cpp | 2 +- src/server/collision/RegularGrid.h | 2 +- src/server/game/Battlefield/Battlefield.cpp | 8 +- src/server/game/Battlefield/Battlefield.h | 2 +- src/server/game/Battlefield/BattlefieldMgr.cpp | 8 +- src/server/game/Battlefield/BattlefieldMgr.h | 14 +- .../game/Battlefield/Zones/BattlefieldWG.cpp | 2 +- src/server/game/Battlefield/Zones/BattlefieldWG.h | 8 +- src/server/game/Battlegrounds/Battleground.cpp | 2 +- src/server/game/Calendar/CalendarMgr.cpp | 2 +- src/server/game/Combat/ThreatManager.cpp | 2 +- src/server/game/Conditions/ConditionMgr.cpp | 2 +- src/server/game/DataStores/DBCfmt.h | 203 ++++++++++----------- src/server/game/DungeonFinding/LFGMgr.cpp | 2 +- src/server/game/DungeonFinding/LFGMgr.h | 4 +- src/server/game/Entities/GameObject/GameObject.h | 2 +- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Entities/Unit/Unit.cpp | 8 +- src/server/game/Entities/Unit/Unit.h | 16 +- src/server/game/Globals/ObjectMgr.cpp | 4 +- src/server/game/Grids/Notifiers/GridNotifiers.h | 2 +- src/server/game/Guilds/Guild.cpp | 2 +- src/server/game/Handlers/BattlefieldHandler.cpp | 2 +- src/server/game/Handlers/GuildHandler.cpp | 2 +- src/server/game/Handlers/MiscHandler.cpp | 2 +- src/server/game/Maps/ZoneScript.h | 8 +- src/server/game/Miscellaneous/SharedDefines.h | 4 +- src/server/game/Movement/MotionMaster.cpp | 28 +-- .../FleeingMovementGenerator.cpp | 16 +- .../MovementGenerators/HomeMovementGenerator.cpp | 4 +- .../MovementGenerators/PointMovementGenerator.cpp | 2 +- .../MovementGenerators/RandomMovementGenerator.cpp | 4 +- .../TargetedMovementGenerator.cpp | 44 ++--- src/server/game/Movement/Spline/MoveSpline.cpp | 6 +- src/server/game/Movement/Spline/MoveSpline.h | 6 +- src/server/game/Movement/Spline/MoveSplineFlag.h | 2 +- src/server/game/Movement/Spline/MoveSplineInit.cpp | 4 +- src/server/game/Movement/Spline/MoveSplineInit.h | 2 +- .../game/Movement/Spline/MoveSplineInitArgs.h | 2 +- .../game/Movement/Spline/MovementPacketBuilder.cpp | 2 +- src/server/game/Movement/Spline/MovementUtil.cpp | 130 ++++++------- src/server/game/Movement/Spline/Spline.cpp | 8 +- src/server/game/Movement/Spline/Spline.h | 18 +- src/server/game/Movement/Spline/SplineImpl.h | 2 +- src/server/game/OutdoorPvP/OutdoorPvP.cpp | 12 +- src/server/game/OutdoorPvP/OutdoorPvP.h | 2 +- src/server/game/Scripting/MapScripts.cpp | 2 +- src/server/game/Server/WorldSession.cpp | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 6 +- src/server/game/Spells/Auras/SpellAuras.cpp | 2 +- src/server/game/Spells/Spell.cpp | 6 +- src/server/game/Spells/SpellEffects.cpp | 2 +- src/server/game/Spells/SpellInfo.cpp | 8 +- src/server/game/Warden/Warden.h | 4 +- src/server/game/Warden/WardenMac.cpp | 2 +- src/server/game/Warden/WardenWin.cpp | 4 +- src/server/game/Warden/WardenWin.h | 2 +- src/server/game/World/World.cpp | 2 +- src/server/scripts/Commands/cs_debug.cpp | 6 +- src/server/scripts/Commands/cs_quest.cpp | 2 +- .../Karazhan/boss_prince_malchezaar.cpp | 2 +- .../ScarletEnclave/zone_the_scarlet_enclave.cpp | 2 +- .../Scholomance/boss_darkmaster_gandling.cpp | 8 +- .../Scholomance/boss_illucia_barov.cpp | 4 +- .../Scholomance/boss_instructor_malicia.cpp | 2 +- .../Scholomance/boss_kirtonos_the_herald.cpp | 2 +- .../Scholomance/boss_lord_alexei_barov.cpp | 2 +- .../SunwellPlateau/boss_eredar_twins.cpp | 8 +- .../SunwellPlateau/instance_sunwell_plateau.cpp | 2 +- .../EasternKingdoms/Uldaman/boss_archaedas.cpp | 2 +- .../EasternKingdoms/Uldaman/instance_uldaman.cpp | 2 +- .../scripts/EasternKingdoms/ZulAman/zulaman.cpp | 16 +- src/server/scripts/Events/childrens_week.cpp | 10 +- src/server/scripts/Kalimdor/zone_silithus.cpp | 2 +- src/server/scripts/Kalimdor/zone_the_barrens.cpp | 2 +- .../AzjolNerub/Ahnkahet/boss_amanitar.cpp | 32 ++-- .../AzjolNerub/Ahnkahet/boss_elder_nadox.cpp | 22 +-- .../TrialOfTheCrusader/boss_lord_jaraxxus.cpp | 2 +- .../TrialOfTheCrusader/trial_of_the_crusader.h | 4 +- .../ForgeOfSouls/boss_devourer_of_souls.cpp | 2 +- .../scripts/Northrend/Gundrak/boss_slad_ran.cpp | 2 +- .../scripts/Northrend/Naxxramas/boss_kelthuzad.cpp | 2 +- .../Northrend/Nexus/EyeOfEternity/boss_malygos.cpp | 4 +- .../Northrend/Ulduar/Ulduar/instance_ulduar.cpp | 2 +- .../UtgardeKeep/boss_ingvar_the_plunderer.cpp | 28 +-- .../UtgardeKeep/UtgardeKeep/boss_keleseth.cpp | 16 +- .../UtgardeKeep/UtgardePinnacle/boss_svala.cpp | 6 +- src/server/scripts/Northrend/zone_icecrown.cpp | 102 +++++------ .../scripts/Northrend/zone_sholazar_basin.cpp | 4 +- src/server/scripts/Northrend/zone_storm_peaks.cpp | 2 +- src/server/scripts/Northrend/zone_wintergrasp.cpp | 2 +- .../Outland/BlackTemple/boss_mother_shahraz.cpp | 2 +- .../BloodFurnace/instance_blood_furnace.cpp | 10 +- .../Outland/TempestKeep/Eye/boss_astromancer.cpp | 2 +- .../Mechanar/boss_nethermancer_sepethrea.cpp | 2 +- .../TempestKeep/Mechanar/instance_mechanar.cpp | 2 +- src/server/scripts/Outland/zone_nagrand.cpp | 4 +- src/server/scripts/Spells/spell_generic.cpp | 2 +- src/server/scripts/Spells/spell_item.cpp | 6 +- src/server/scripts/Spells/spell_pet.cpp | 2 +- src/server/scripts/World/npcs_special.cpp | 6 +- .../shared/Cryptography/WardenKeyGeneration.h | 2 +- src/server/shared/Dynamic/HashNamespace.h | 2 +- src/server/shared/Logging/Log.cpp | 2 +- src/server/shared/Logging/Log.h | 12 +- src/server/shared/Packets/ByteBuffer.h | 2 +- src/server/shared/Utilities/Util.h | 2 +- 112 files changed, 521 insertions(+), 522 deletions(-) (limited to 'src/server/scripts/Spells') diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index 9145c8413ff..8ab4ab8a1a2 100644 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -365,7 +365,7 @@ bool AuthSocket::_HandleLogonChallenge() if (result) { pkt << uint8(WOW_FAIL_BANNED); - sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] Banned ip tries to login!",socket().getRemoteAddress().c_str(), socket().getRemotePort()); + sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] Banned ip tries to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort()); } else { diff --git a/src/server/collision/DynamicTree.cpp b/src/server/collision/DynamicTree.cpp index 1a2f721a69f..c6754278d17 100644 --- a/src/server/collision/DynamicTree.cpp +++ b/src/server/collision/DynamicTree.cpp @@ -227,7 +227,7 @@ bool DynamicMapTree::getObjectHitPos(const uint32 phasemask, const Vector3& star bool DynamicMapTree::isInLineOfSight(float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask) const { - Vector3 v1(x1,y1,z1), v2(x2,y2,z2); + Vector3 v1(x1, y1, z1), v2(x2, y2, z2); float maxDist = (v2 - v1).magnitude(); @@ -243,8 +243,8 @@ bool DynamicMapTree::isInLineOfSight(float x1, float y1, float z1, float x2, flo float DynamicMapTree::getHeight(float x, float y, float z, float maxSearchDist, uint32 phasemask) const { - Vector3 v(x,y,z); - Ray r(v, Vector3(0,0,-1)); + Vector3 v(x, y, z); + Ray r(v, Vector3(0, 0, -1)); DynamicTreeIntersectionCallback callback(phasemask); impl.intersectZAllignedRay(r, callback, maxSearchDist); diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp index 380d6b5df21..c087f773630 100644 --- a/src/server/collision/Maps/TileAssembler.cpp +++ b/src/server/collision/Maps/TileAssembler.cpp @@ -380,11 +380,11 @@ namespace VMAP } } - fwrite(&displayId,sizeof(uint32),1,model_list_copy); - fwrite(&name_length,sizeof(uint32),1,model_list_copy); - fwrite(&buff,sizeof(char),name_length,model_list_copy); - fwrite(&bounds.low(),sizeof(Vector3),1,model_list_copy); - fwrite(&bounds.high(),sizeof(Vector3),1,model_list_copy); + fwrite(&displayId, sizeof(uint32), 1, model_list_copy); + fwrite(&name_length, sizeof(uint32), 1, model_list_copy); + fwrite(&buff, sizeof(char), name_length, model_list_copy); + fwrite(&bounds.low(), sizeof(Vector3), 1, model_list_copy); + fwrite(&bounds.high(), sizeof(Vector3), 1, model_list_copy); } fclose(model_list); diff --git a/src/server/collision/Maps/TileAssembler.h b/src/server/collision/Maps/TileAssembler.h index 087c2021b50..a11ce272d62 100644 --- a/src/server/collision/Maps/TileAssembler.h +++ b/src/server/collision/Maps/TileAssembler.h @@ -72,12 +72,12 @@ namespace VMAP uint32 liquidflags; std::vector triangles; std::vector vertexArray; - class WmoLiquid *liquid; + class WmoLiquid* liquid; GroupModel_Raw() : liquid(0) {} ~GroupModel_Raw(); - bool Read(FILE * f); + bool Read(FILE* f); }; struct WorldModel_Raw diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp index 237a5b33621..0ecf02648f9 100644 --- a/src/server/collision/Models/GameObjectModel.cpp +++ b/src/server/collision/Models/GameObjectModel.cpp @@ -79,7 +79,7 @@ void LoadGameObjectModelList() model_list.insert ( - ModelList::value_type( displayId, GameobjectModelData(std::string(buff,name_length),AABox(v1,v2)) ) + ModelList::value_type( displayId, GameobjectModelData(std::string(buff, name_length), AABox(v1, v2)) ) ); } diff --git a/src/server/collision/RegularGrid.h b/src/server/collision/RegularGrid.h index 5b7d1d74987..f38bf357a19 100644 --- a/src/server/collision/RegularGrid.h +++ b/src/server/collision/RegularGrid.h @@ -104,7 +104,7 @@ public: { ASSERT(x < CELL_NUMBER && y < CELL_NUMBER); if (!nodes[x][y]) - nodes[x][y] = NodeCreatorFunc::makeNode(x,y); + nodes[x][y] = NodeCreatorFunc::makeNode(x, y); return *nodes[x][y]; } diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index 32f71822737..dffdb2361d5 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -469,13 +469,13 @@ void Battlefield::SendWarningToAllInZone(uint32 entry) sCreatureTextMgr->SendChat(stalker, (uint8) entry, 0, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_ADDON, TEXT_RANGE_ZONE); } -/*void Battlefield::SendWarningToAllInWar(int32 entry,...) +/*void Battlefield::SendWarningToAllInWar(int32 entry, ...) { const char *format = sObjectMgr->GetTrinityStringForDBCLocale(entry); va_list ap; char str [1024]; va_start(ap, entry); - vsnprintf(str,1024,format, ap); + vsnprintf(str, 1024, format, ap); va_end(ap); std::string msg = (std::string)str; @@ -604,7 +604,7 @@ BfGraveyard* Battlefield::GetGraveyardById(uint32 id) const return NULL; } -WorldSafeLocsEntry const * Battlefield::GetClosestGraveYard(Player* player) +WorldSafeLocsEntry const* Battlefield::GetClosestGraveYard(Player* player) { BfGraveyard* closestGY = NULL; float maxdist = -1; @@ -816,7 +816,7 @@ Creature* Battlefield::SpawnCreature(uint32 entry, Position pos, TeamId team) Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, float o, TeamId team) { //Get map object - Map* map = const_cast < Map * >(sMapMgr->CreateBaseMap(m_MapId)); + Map* map = const_cast(sMapMgr->CreateBaseMap(m_MapId)); if (!map) { sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::SpawnCreature: Can't create creature entry: %u map not found", entry); diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h index 0da776b9624..7a8d856aa8e 100644 --- a/src/server/game/Battlefield/Battlefield.h +++ b/src/server/game/Battlefield/Battlefield.h @@ -277,7 +277,7 @@ class Battlefield : public ZoneScript // Graveyard methods // Find which graveyard the player must be teleported to to be resurrected by spiritguide - WorldSafeLocsEntry const * GetClosestGraveYard(Player* player); + WorldSafeLocsEntry const* GetClosestGraveYard(Player* player); virtual void AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid); void RemovePlayerFromResurrectQueue(uint64 player_guid); diff --git a/src/server/game/Battlefield/BattlefieldMgr.cpp b/src/server/game/Battlefield/BattlefieldMgr.cpp index 5aec0458b19..d30a0b17fd7 100644 --- a/src/server/game/Battlefield/BattlefieldMgr.cpp +++ b/src/server/game/Battlefield/BattlefieldMgr.cpp @@ -51,7 +51,7 @@ void BattlefieldMgr::InitBattlefield() /* For Cataclysm: Tol Barad pBf = new BattlefieldTB; // respawn, init variables - if(!pBf->SetupBattlefield()) + if (!pBf->SetupBattlefield()) { sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Battlefield : Tol Barad init failed."); delete pBf; @@ -68,7 +68,7 @@ void BattlefieldMgr::AddZone(uint32 zoneid, Battlefield *handle) m_BattlefieldMap[zoneid] = handle; } -void BattlefieldMgr::HandlePlayerEnterZone(Player * player, uint32 zoneid) +void BattlefieldMgr::HandlePlayerEnterZone(Player* player, uint32 zoneid) { BattlefieldMap::iterator itr = m_BattlefieldMap.find(zoneid); if (itr == m_BattlefieldMap.end()) @@ -81,7 +81,7 @@ void BattlefieldMgr::HandlePlayerEnterZone(Player * player, uint32 zoneid) sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Player %u entered outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId()); } -void BattlefieldMgr::HandlePlayerLeaveZone(Player * player, uint32 zoneid) +void BattlefieldMgr::HandlePlayerLeaveZone(Player* player, uint32 zoneid) { BattlefieldMap::iterator itr = m_BattlefieldMap.find(zoneid); if (itr == m_BattlefieldMap.end()) @@ -129,7 +129,7 @@ void BattlefieldMgr::Update(uint32 diff) } } -ZoneScript *BattlefieldMgr::GetZoneScript(uint32 zoneId) +ZoneScript* BattlefieldMgr::GetZoneScript(uint32 zoneId) { BattlefieldMap::iterator itr = m_BattlefieldMap.find(zoneId); if (itr != m_BattlefieldMap.end()) diff --git a/src/server/game/Battlefield/BattlefieldMgr.h b/src/server/game/Battlefield/BattlefieldMgr.h index 28b2a3c148a..af1cea763df 100644 --- a/src/server/game/Battlefield/BattlefieldMgr.h +++ b/src/server/game/Battlefield/BattlefieldMgr.h @@ -39,11 +39,11 @@ class BattlefieldMgr // create battlefield events void InitBattlefield(); // called when a player enters an battlefield area - void HandlePlayerEnterZone(Player * player, uint32 areaflag); + void HandlePlayerEnterZone(Player* player, uint32 areaflag); // called when player leaves an battlefield area - void HandlePlayerLeaveZone(Player * player, uint32 areaflag); + void HandlePlayerLeaveZone(Player* player, uint32 areaflag); // called when player resurrects - void HandlePlayerResurrects(Player * player, uint32 areaflag); + void HandlePlayerResurrects(Player* player, uint32 areaflag); // return assigned battlefield Battlefield* GetBattlefieldToZoneId(uint32 zoneid); Battlefield* GetBattlefieldByBattleId(uint32 battleid); @@ -54,14 +54,14 @@ class BattlefieldMgr void Update(uint32 diff); - void HandleGossipOption(Player * player, uint64 guid, uint32 gossipid); + void HandleGossipOption(Player* player, uint64 guid, uint32 gossipid); - bool CanTalkTo(Player * player, Creature * creature, GossipMenuItems gso); + bool CanTalkTo(Player* player, Creature* creature, GossipMenuItems gso); - void HandleDropFlag(Player * player, uint32 spellId); + void HandleDropFlag(Player* player, uint32 spellId); typedef std::vector < Battlefield * >BattlefieldSet; - typedef std::map < uint32 /* zoneid */ , Battlefield * >BattlefieldMap; + typedef std::map < uint32 /* zoneid */, Battlefield * >BattlefieldMap; private: // contains all initiated battlefield events // used when initing / cleaning up diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index a36d204a4b7..060aca3e5aa 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -916,7 +916,7 @@ void BattlefieldWG::UpdatedDestroyedTowerCount(TeamId team) } } -void BattlefieldWG::ProcessEvent(WorldObject *obj, uint32 eventId) +void BattlefieldWG::ProcessEvent(WorldObject* obj, uint32 eventId) { if (!obj || !IsWarTime()) return; diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index f313357e323..2f750de7b3a 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -405,7 +405,7 @@ class BattlefieldWG : public Battlefield void PromotePlayer(Player* killer); void UpdateTenacity(); - void ProcessEvent(WorldObject *obj, uint32 eventId); + void ProcessEvent(WorldObject* obj, uint32 eventId); bool FindAndRemoveVehicleFromList(Unit* vehicle); @@ -562,7 +562,7 @@ struct WintergraspObjectPositionData }; // ***************************************************** -// ************ Destructible (Wall,Tower..) ************ +// ************ Destructible (Wall, Tower..) ************ // ***************************************************** struct WintergraspBuildingSpawnData @@ -755,7 +755,7 @@ const WintergraspTeleporterData WGPortalDefenderData[WG_MAX_TELEPORTER] = }; // ********************************************************* -// **********Tower Element(GameObject,Creature)************* +// **********Tower Element(GameObject, Creature)************* // ********************************************************* struct WintergraspTowerData @@ -1055,7 +1055,7 @@ const WGWorkshopData WorkshopsData[WG_MAX_WORKSHOP] = }; // ******************************************************************** -// * Structs using for Building,Graveyard,Workshop * +// * Structs using for Building, Graveyard, Workshop * // ******************************************************************** // Structure for different buildings that can be destroyed during battle struct BfWGGameObjectBuilding diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index e0a3943d70f..e717a10fcd7 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1688,7 +1688,7 @@ void Battleground::SendWarningToAll(int32 entry, ...) if (!entry) return; - char const *format = sObjectMgr->GetTrinityStringForDBCLocale(entry); + char const* format = sObjectMgr->GetTrinityStringForDBCLocale(entry); char str[1024]; va_list ap; diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index f4dd059846e..763e0132c10 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -68,7 +68,7 @@ void CalendarMgr::LoadFromDB() if (flags & CALENDAR_FLAG_GUILD_EVENT || flags & CALENDAR_FLAG_WITHOUT_INVITES) guildId = Player::GetGuildIdFromDB(creatorGUID); - CalendarEvent* calendarEvent = new CalendarEvent(eventId, creatorGUID , guildId, type, dungeonId, time_t(eventTime), flags, time_t(timezoneTime), title, description); + CalendarEvent* calendarEvent = new CalendarEvent(eventId, creatorGUID, guildId, type, dungeonId, time_t(eventTime), flags, time_t(timezoneTime), title, description); _events.insert(calendarEvent); _maxEventId = std::max(_maxEventId, eventId); diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 0e13019c8a2..6d291ca301f 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -272,7 +272,7 @@ HostileReference* ThreatContainer::getReferenceByTarget(Unit* victim) const uint64 const guid = victim->GetGUID(); for (ThreatContainer::StorageType::const_iterator i = iThreatList.begin(); i != iThreatList.end(); ++i) { - HostileReference *ref = (*i); + HostileReference* ref = (*i); if (ref && ref->getUnitGuid() == guid) return ref; } diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index d476113edc4..5e1a05669ed 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -1364,7 +1364,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) if ((cond->SourceGroup > MAX_EFFECT_MASK) || !cond->SourceGroup) { - sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, has incorrect SourceGroup %u (spell effectMask) set , ignoring.", cond->SourceEntry, cond->SourceGroup); + sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, has incorrect SourceGroup %u (spell effectMask) set, ignoring.", cond->SourceEntry, cond->SourceGroup); return false; } diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index d0784f05c4d..b7d966757c8 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -19,111 +19,110 @@ #ifndef TRINITY_DBCSFRM_H #define TRINITY_DBCSFRM_H -char const Achievementfmt[]="niixssssssssssssssssxxxxxxxxxxxxxxxxxxiixixxxxxxxxxxxxxxxxxxii"; -const std::string CustomAchievementfmt="pppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaapapaaaaaaaaaaaaaaaaaapp"; +char const Achievementfmt[] = "niixssssssssssssssssxxxxxxxxxxxxxxxxxxiixixxxxxxxxxxxxxxxxxxii"; +const std::string CustomAchievementfmt = "pppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaapapaaaaaaaaaaaaaaaaaapp"; const std::string CustomAchievementIndex = "ID"; -char const AchievementCriteriafmt[]="niiiiiiiixxxxxxxxxxxxxxxxxiiiix"; -char const AreaTableEntryfmt[]="iiinixxxxxissssssssssssssssxiiiiixxx"; -char const AreaGroupEntryfmt[]="niiiiiii"; -char const AreaPOIEntryfmt[]="niiiiiiiiiiifffixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxix"; -char const AreaTriggerEntryfmt[]="niffffffff"; -char const AuctionHouseEntryfmt[]="niiixxxxxxxxxxxxxxxxx"; -char const BankBagSlotPricesEntryfmt[]="ni"; -char const BarberShopStyleEntryfmt[]="nixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiii"; -char const BattlemasterListEntryfmt[]="niiiiiiiiixssssssssssssssssxiixx"; -char const CharStartOutfitEntryfmt[]="xniiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; -char const CharTitlesEntryfmt[]="nxssssssssssssssssxxxxxxxxxxxxxxxxxxi"; -char const ChatChannelsEntryfmt[]="nixssssssssssssssssxxxxxxxxxxxxxxxxxx"; - // ChatChannelsEntryfmt, index not used (more compact store) -char const ChrClassesEntryfmt[]="nxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii"; -char const ChrRacesEntryfmt[]="nxixiixixxxxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi"; -char const CinematicSequencesEntryfmt[]="nxxxxxxxxx"; -char const CreatureDisplayInfofmt[]="nixxfxxxxxxxxxxx"; -char const CreatureFamilyfmt[]="nfifiiiiixssssssssssssssssxx"; -char const CreatureModelDatafmt[]="nxxxfxxxxxxxxxxffxxxxxxxxxxx"; -char const CreatureSpellDatafmt[]="niiiixxxx"; -char const CreatureTypefmt[]="nxxxxxxxxxxxxxxxxxx"; -char const CurrencyTypesfmt[]="xnxi"; -char const DestructibleModelDatafmt[]="nxxixxxixxxixxxixxx"; -char const DungeonEncounterfmt[]="niixissssssssssssssssxx"; -char const DurabilityCostsfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiii"; -char const DurabilityQualityfmt[]="nf"; -char const EmotesEntryfmt[]="nxxiiix"; -char const EmotesTextEntryfmt[]="nxixxxxxxxxxxxxxxxx"; -char const FactionEntryfmt[]="niiiiiiiiiiiiiiiiiiffixssssssssssssssssxxxxxxxxxxxxxxxxxx"; -char const FactionTemplateEntryfmt[]="niiiiiiiiiiiii"; -char const GameObjectDisplayInfofmt[]="nsxxxxxxxxxxffffffx"; -char const GemPropertiesEntryfmt[]="nixxi"; -char const GlyphPropertiesfmt[]="niii"; -char const GlyphSlotfmt[]="nii"; -char const GtBarberShopCostBasefmt[]="f"; -char const GtCombatRatingsfmt[]="f"; -char const GtChanceToMeleeCritBasefmt[]="f"; -char const GtChanceToMeleeCritfmt[]="f"; -char const GtChanceToSpellCritBasefmt[]="f"; -char const GtChanceToSpellCritfmt[]="f"; -char const GtOCTClassCombatRatingScalarfmt[]="df"; -char const GtOCTRegenHPfmt[]="f"; -//char const GtOCTRegenMPfmt[]="f"; -char const GtRegenHPPerSptfmt[]="f"; -char const GtRegenMPPerSptfmt[]="f"; -char const Holidaysfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiixxsiix"; -char const Itemfmt[]="niiiiiii"; -char const ItemBagFamilyfmt[]="nxxxxxxxxxxxxxxxxx"; -//char const ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx"; -//char const ItemCondExtCostsEntryfmt[]="xiii"; -char const ItemExtendedCostEntryfmt[]="niiiiiiiiiiiiiix"; -char const ItemLimitCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxii"; -char const ItemRandomPropertiesfmt[]="nxiiixxssssssssssssssssx"; -char const ItemRandomSuffixfmt[]="nssssssssssssssssxxiiixxiiixx"; -char const ItemSetEntryfmt[]="dssssssssssssssssxiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii"; -char const LFGDungeonEntryfmt[]="nssssssssssssssssxiiiiiiiiixxixixxxxxxxxxxxxxxxxx"; -char const LiquidTypefmt[]="nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; -char const LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; -char const MailTemplateEntryfmt[]="nxxxxxxxxxxxxxxxxxssssssssssssssssx"; -char const MapEntryfmt[]="nxixxssssssssssssssssxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixiffxiix"; -char const MapDifficultyEntryfmt[]="diisxxxxxxxxxxxxxxxxiix"; -char const MovieEntryfmt[]="nxx"; -char const OverrideSpellDatafmt[]="niiiiiiiiiix"; -char const QuestSortEntryfmt[]="nxxxxxxxxxxxxxxxxx"; -char const QuestXPfmt[]="niiiiiiiiii"; -char const QuestFactionRewardfmt[]="niiiiiiiiii"; -char const PvPDifficultyfmt[]="diiiii"; -char const RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii"; -char const ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiii"; -char const ScalingStatValuesfmt[]="iniiiiiiiiiiiiiiiiiiiiii"; -char const SkillLinefmt[]="nixssssssssssssssssxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxi"; -char const SkillLineAbilityfmt[]="niiiixxiiiiixx"; -char const SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; -char const SpellCastTimefmt[]="nixx"; -char const SpellDifficultyfmt[]="niiii"; -const std::string CustomSpellDifficultyfmt="ppppp"; -const std::string CustomSpellDifficultyIndex="id"; -char const SpellDurationfmt[]="niii"; -char const SpellEntryfmt[]="niiiiiiiiiiiixixiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiixxfffxx"; -const std::string CustomSpellEntryfmt="papppppppppppapapaaaaaaaaaaapaaapapppppppaaaaapaapaaaaaaaaaaaaaaaaaappppppppppppppppppppppppppppppppppppaaaaaapppppppppaaapppppppppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaappppppppapppaaaaappaaaaaaa"; +char const AchievementCriteriafmt[] = "niiiiiiiixxxxxxxxxxxxxxxxxiiiix"; +char const AreaTableEntryfmt[] = "iiinixxxxxissssssssssssssssxiiiiixxx"; +char const AreaGroupEntryfmt[] = "niiiiiii"; +char const AreaPOIEntryfmt[] = "niiiiiiiiiiifffixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxix"; +char const AreaTriggerEntryfmt[] = "niffffffff"; +char const AuctionHouseEntryfmt[] = "niiixxxxxxxxxxxxxxxxx"; +char const BankBagSlotPricesEntryfmt[] = "ni"; +char const BarberShopStyleEntryfmt[] = "nixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiii"; +char const BattlemasterListEntryfmt[] = "niiiiiiiiixssssssssssssssssxiixx"; +char const CharStartOutfitEntryfmt[] = "xniiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +char const CharTitlesEntryfmt[] = "nxssssssssssssssssxxxxxxxxxxxxxxxxxxi"; +char const ChatChannelsEntryfmt[] = "nixssssssssssssssssxxxxxxxxxxxxxxxxxx"; +char const ChrClassesEntryfmt[] = "nxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii"; +char const ChrRacesEntryfmt[] = "nxixiixixxxxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi"; +char const CinematicSequencesEntryfmt[] = "nxxxxxxxxx"; +char const CreatureDisplayInfofmt[] = "nixxfxxxxxxxxxxx"; +char const CreatureFamilyfmt[] = "nfifiiiiixssssssssssssssssxx"; +char const CreatureModelDatafmt[] = "nxxxfxxxxxxxxxxffxxxxxxxxxxx"; +char const CreatureSpellDatafmt[] = "niiiixxxx"; +char const CreatureTypefmt[] = "nxxxxxxxxxxxxxxxxxx"; +char const CurrencyTypesfmt[] = "xnxi"; +char const DestructibleModelDatafmt[] = "nxxixxxixxxixxxixxx"; +char const DungeonEncounterfmt[] = "niixissssssssssssssssxx"; +char const DurabilityCostsfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiii"; +char const DurabilityQualityfmt[] = "nf"; +char const EmotesEntryfmt[] = "nxxiiix"; +char const EmotesTextEntryfmt[] = "nxixxxxxxxxxxxxxxxx"; +char const FactionEntryfmt[] = "niiiiiiiiiiiiiiiiiiffixssssssssssssssssxxxxxxxxxxxxxxxxxx"; +char const FactionTemplateEntryfmt[] = "niiiiiiiiiiiii"; +char const GameObjectDisplayInfofmt[] = "nsxxxxxxxxxxffffffx"; +char const GemPropertiesEntryfmt[] = "nixxi"; +char const GlyphPropertiesfmt[] = "niii"; +char const GlyphSlotfmt[] = "nii"; +char const GtBarberShopCostBasefmt[] = "f"; +char const GtCombatRatingsfmt[] = "f"; +char const GtChanceToMeleeCritBasefmt[] = "f"; +char const GtChanceToMeleeCritfmt[] = "f"; +char const GtChanceToSpellCritBasefmt[] = "f"; +char const GtChanceToSpellCritfmt[] = "f"; +char const GtOCTClassCombatRatingScalarfmt[] = "df"; +char const GtOCTRegenHPfmt[] = "f"; +//char const GtOCTRegenMPfmt[] = "f"; +char const GtRegenHPPerSptfmt[] = "f"; +char const GtRegenMPPerSptfmt[] = "f"; +char const Holidaysfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiixxsiix"; +char const Itemfmt[] = "niiiiiii"; +char const ItemBagFamilyfmt[] = "nxxxxxxxxxxxxxxxxx"; +//char const ItemDisplayTemplateEntryfmt[] = "nxxxxxxxxxxixxxxxxxxxxx"; +//char const ItemCondExtCostsEntryfmt[] = "xiii"; +char const ItemExtendedCostEntryfmt[] = "niiiiiiiiiiiiiix"; +char const ItemLimitCategoryEntryfmt[] = "nxxxxxxxxxxxxxxxxxii"; +char const ItemRandomPropertiesfmt[] = "nxiiixxssssssssssssssssx"; +char const ItemRandomSuffixfmt[] = "nssssssssssssssssxxiiixxiiixx"; +char const ItemSetEntryfmt[] = "dssssssssssssssssxiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii"; +char const LFGDungeonEntryfmt[] = "nssssssssssssssssxiiiiiiiiixxixixxxxxxxxxxxxxxxxx"; +char const LiquidTypefmt[] = "nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +char const LockEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; +char const MailTemplateEntryfmt[] = "nxxxxxxxxxxxxxxxxxssssssssssssssssx"; +char const MapEntryfmt[] = "nxixxssssssssssssssssxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixiffxiix"; +char const MapDifficultyEntryfmt[] = "diisxxxxxxxxxxxxxxxxiix"; +char const MovieEntryfmt[] = "nxx"; +char const OverrideSpellDatafmt[] = "niiiiiiiiiix"; +char const QuestFactionRewardfmt[] = "niiiiiiiiii"; +char const QuestSortEntryfmt[] = "nxxxxxxxxxxxxxxxxx"; +char const QuestXPfmt[] = "niiiiiiiiii"; +char const PvPDifficultyfmt[] = "diiiii"; +char const RandomPropertiesPointsfmt[] = "niiiiiiiiiiiiiii"; +char const ScalingStatDistributionfmt[] = "niiiiiiiiiiiiiiiiiiiii"; +char const ScalingStatValuesfmt[] = "iniiiiiiiiiiiiiiiiiiiiii"; +char const SkillLinefmt[] = "nixssssssssssssssssxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxi"; +char const SkillLineAbilityfmt[] = "niiiixxiiiiixx"; +char const SoundEntriesfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +char const SpellCastTimefmt[] = "nixx"; +char const SpellDifficultyfmt[] = "niiii"; +const std::string CustomSpellDifficultyfmt = "ppppp"; +const std::string CustomSpellDifficultyIndex = "id"; +char const SpellDurationfmt[] = "niii"; +char const SpellEntryfmt[] = "niiiiiiiiiiiixixiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiixxfffxx"; +const std::string CustomSpellEntryfmt = "papppppppppppapapaaaaaaaaaaapaaapapppppppaaaaapaapaaaaaaaaaaaaaaaaaappppppppppppppppppppppppppppppppppppaaaaaapppppppppaaapppppppppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaappppppppapppaaaaappaaaaaaa"; const std::string CustomSpellEntryIndex = "Id"; -char const SpellFocusObjectfmt[]="nxxxxxxxxxxxxxxxxx"; -char const SpellItemEnchantmentfmt[]="nxiiiiiixxxiiissssssssssssssssxiiiiiii"; -char const SpellItemEnchantmentConditionfmt[]="nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX"; -char const SpellRadiusfmt[]="nfff"; -char const SpellRangefmt[]="nffffixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; -char const SpellRuneCostfmt[]="niiii"; -char const SpellShapeshiftfmt[]="nxxxxxxxxxxxxxxxxxxiixiiixxiiiiiiii"; +char const SpellFocusObjectfmt[] = "nxxxxxxxxxxxxxxxxx"; +char const SpellItemEnchantmentfmt[] = "nxiiiiiixxxiiissssssssssssssssxiiiiiii"; +char const SpellItemEnchantmentConditionfmt[] = "nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX"; +char const SpellRadiusfmt[] = "nfff"; +char const SpellRangefmt[] = "nffffixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +char const SpellRuneCostfmt[] = "niiii"; +char const SpellShapeshiftfmt[] = "nxxxxxxxxxxxxxxxxxxiixiiixxiiiiiiii"; char const StableSlotPricesfmt[] = "ni"; char const SummonPropertiesfmt[] = "niiiii"; -char const TalentEntryfmt[]="niiiiiiiixxxxixxixxxxxx"; -char const TalentTabEntryfmt[]="nxxxxxxxxxxxxxxxxxxxiiix"; -char const TaxiNodesEntryfmt[]="nifffssssssssssssssssxii"; -char const TaxiPathEntryfmt[]="niii"; -char const TaxiPathNodeEntryfmt[]="diiifffiiii"; -char const TeamContributionPointsfmt[]="df"; -char const TotemCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxii"; -char const VehicleEntryfmt[]="niffffiiiiiiiifffffffffffffffssssfifiixx"; -char const VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxx"; -char const WMOAreaTableEntryfmt[]="niiixxxxxiixxxxxxxxxxxxxxxxx"; -char const WorldMapAreaEntryfmt[]="xinxffffixx"; -char const WorldMapOverlayEntryfmt[]="nxiiiixxxxxxxxxxx"; -char const WorldSafeLocsEntryfmt[]="nifffxxxxxxxxxxxxxxxxx"; +char const TalentEntryfmt[] = "niiiiiiiixxxxixxixxxxxx"; +char const TalentTabEntryfmt[] = "nxxxxxxxxxxxxxxxxxxxiiix"; +char const TaxiNodesEntryfmt[] = "nifffssssssssssssssssxii"; +char const TaxiPathEntryfmt[] = "niii"; +char const TaxiPathNodeEntryfmt[] = "diiifffiiii"; +char const TeamContributionPointsfmt[] = "df"; +char const TotemCategoryEntryfmt[] = "nxxxxxxxxxxxxxxxxxii"; +char const VehicleEntryfmt[] = "niffffiiiiiiiifffffffffffffffssssfifiixx"; +char const VehicleSeatEntryfmt[] = "niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxx"; +char const WMOAreaTableEntryfmt[] = "niiixxxxxiixxxxxxxxxxxxxxxxx"; +char const WorldMapAreaEntryfmt[] = "xinxffffixx"; +char const WorldMapOverlayEntryfmt[] = "nxiiiixxxxxxxxxxx"; +char const WorldSafeLocsEntryfmt[] = "nifffxxxxxxxxxxxxxxxxx"; #endif diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 09be64813af..a931d61f740 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1704,7 +1704,7 @@ uint8 LFGMgr::GetKicksLeft(uint64 guid) return kicks; } -void LFGMgr::RestoreState(uint64 guid, char const *debugMsg) +void LFGMgr::RestoreState(uint64 guid, char const* debugMsg) { if (IS_GROUP_GUID(guid)) { diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index 33626467486..74c7ca9e3d3 100644 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -383,8 +383,8 @@ class LFGMgr private: uint8 GetTeam(uint64 guid); - void RestoreState(uint64 guid, char const *debugMsg); - void ClearState(uint64 guid, char const *debugMsg); + void RestoreState(uint64 guid, char const* debugMsg); + void ClearState(uint64 guid, char const* debugMsg); void SetDungeon(uint64 guid, uint32 dungeon); void SetSelectedDungeons(uint64 guid, LfgDungeonSet const& dungeons); void SetLockedDungeons(uint64 guid, LfgLockMap const& lock); diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 7b1ccbc9015..1049285605e 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -790,7 +790,7 @@ class GameObject : public WorldObject, public GridObject void SetDisplayId(uint32 displayid); uint32 GetDisplayId() const { return GetUInt32Value(GAMEOBJECT_DISPLAYID); } - GameObjectModel * m_model; + GameObjectModel* m_model; protected: bool AIM_Initialize(); uint32 m_spellId; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 14878b078bd..5fee82c5ece 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2375,7 +2375,7 @@ void Player::ProcessDelayedOperations() if (m_DelayedOperations & DELAYED_BG_GROUP_RESTORE) { - if (Group *g = GetGroup()) + if (Group* g = GetGroup()) g->SendUpdateToPlayer(GetGUID()); } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index fa82ac6f8c6..52e81d6d0cd 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2563,7 +2563,7 @@ class Player : public Unit, public GridObject //We allow only one timed quest active at the same time. Below can then be simple value instead of set. typedef std::set QuestSet; typedef std::set SeasonalQuestSet; - typedef UNORDERED_MAP SeasonalEventQuestMap; + typedef UNORDERED_MAP SeasonalEventQuestMap; QuestSet m_timedquests; QuestSet m_weeklyquests; QuestSet m_monthlyquests; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3381369b743..fe0a1e88885 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -388,7 +388,7 @@ bool Unit::haveOffhandWeapon() const void Unit::MonsterMoveWithSpeed(float x, float y, float z, float speed) { Movement::MoveSplineInit init(*this); - init.MoveTo(x,y,z); + init.MoveTo(x, y, z); init.SetVelocity(speed); init.Launch(); } @@ -6514,8 +6514,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere RemoveAura(57934); if (!redirectTarget) break; - CastSpell(this,59628,true); - CastSpell(redirectTarget,57933,true); + CastSpell(this, 59628, true); + CastSpell(redirectTarget, 57933, true); break; } } @@ -15228,7 +15228,7 @@ void Unit::UpdateAuraForGroup(uint8 slot) } } -float Unit::CalculateDefaultCoefficient(SpellInfo const *spellInfo, DamageEffectType damagetype) const +float Unit::CalculateDefaultCoefficient(SpellInfo const* spellInfo, DamageEffectType damagetype) const { // Damage over Time spells bonus calculation float DotFactor = 1.0f; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index c714303e8c7..4bcc9c4b823 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -495,7 +495,7 @@ enum UnitState UNIT_STATE_FOLLOW_MOVE = 0x08000000, UNIT_STATE_UNATTACKABLE = (UNIT_STATE_IN_FLIGHT | UNIT_STATE_ONVEHICLE), // for real move using movegen check and stop (except unstoppable flight) - UNIT_STATE_MOVING = UNIT_STATE_ROAMING_MOVE | UNIT_STATE_CONFUSED_MOVE | UNIT_STATE_FLEEING_MOVE | UNIT_STATE_CHASE_MOVE | UNIT_STATE_FOLLOW_MOVE , + UNIT_STATE_MOVING = UNIT_STATE_ROAMING_MOVE | UNIT_STATE_CONFUSED_MOVE | UNIT_STATE_FLEEING_MOVE | UNIT_STATE_CHASE_MOVE | UNIT_STATE_FOLLOW_MOVE, UNIT_STATE_CONTROLLED = (UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING), UNIT_STATE_LOST_CONTROL = (UNIT_STATE_CONTROLLED | UNIT_STATE_JUMPING | UNIT_STATE_CHARGING), UNIT_STATE_SIGHTLESS = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_EVADE), @@ -2020,15 +2020,15 @@ class Unit : public WorldObject int32 SpellBaseDamageBonusDone(SpellSchoolMask schoolMask); int32 SpellBaseDamageBonusTaken(SpellSchoolMask schoolMask); - uint32 SpellDamageBonusDone(Unit* victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1); - uint32 SpellDamageBonusTaken(Unit* caster, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1); + uint32 SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1); + uint32 SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1); int32 SpellBaseHealingBonusDone(SpellSchoolMask schoolMask); int32 SpellBaseHealingBonusTaken(SpellSchoolMask schoolMask); - uint32 SpellHealingBonusDone(Unit* victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); - uint32 SpellHealingBonusTaken(Unit* caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); + uint32 SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); + uint32 SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); - uint32 MeleeDamageBonusDone(Unit *pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const *spellProto = NULL); - uint32 MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage,WeaponAttackType attType, SpellInfo const *spellProto = NULL); + uint32 MeleeDamageBonusDone(Unit* pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const* spellProto = NULL); + uint32 MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackType attType, SpellInfo const* spellProto = NULL); bool isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType = BASE_ATTACK); @@ -2043,7 +2043,7 @@ class Unit : public WorldObject void SetContestedPvP(Player* attackedPlayer = NULL); uint32 GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const; - float CalculateDefaultCoefficient(SpellInfo const *spellInfo, DamageEffectType damagetype) const; + float CalculateDefaultCoefficient(SpellInfo const* spellInfo, DamageEffectType damagetype) const; uint32 GetRemainingPeriodicAmount(uint64 caster, uint32 spellId, AuraType auraType, uint8 effectIndex = 0) const; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 2ba456b5b3c..619d819bf9b 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3180,10 +3180,10 @@ void ObjectMgr::LoadPlayerInfo() uint32 max_class = current_class ? current_class + 1 : MAX_CLASSES; for (uint32 r = min_race; r < max_race; ++r) for (uint32 c = min_class; c < max_class; ++c) - if (PlayerInfo * info = _playerInfo[r][c]) + if (PlayerInfo* info = _playerInfo[r][c]) info->spell.push_back(fields[2].GetUInt32()); } - else if (PlayerInfo * info = _playerInfo[current_race][current_class]) + else if (PlayerInfo* info = _playerInfo[current_race][current_class]) info->spell.push_back(fields[2].GetUInt32()); else { diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index d2069a7f5f4..f52b6443872 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -968,7 +968,7 @@ namespace Trinity if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->isTotem()) return false; - if (i_funit->_IsValidAttackTarget(u, _spellInfo,i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT ? i_obj : NULL) && i_obj->IsWithinDistInMap(u, i_range)) + if (i_funit->_IsValidAttackTarget(u, _spellInfo, i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT ? i_obj : NULL) && i_obj->IsWithinDistInMap(u, i_range)) return true; return false; diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index fc80a7d7635..376ee011638 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -235,7 +235,7 @@ void Guild::BankEventLogEntry::WritePacket(WorldPacket& data) const data << uint8(m_eventType); data << uint64(MAKE_NEW_GUID(m_playerGuid, 0, HIGHGUID_PLAYER)); - switch(m_eventType) + switch (m_eventType) { case GUILD_BANK_LOG_DEPOSIT_ITEM: case GUILD_BANK_LOG_WITHDRAW_ITEM: diff --git a/src/server/game/Handlers/BattlefieldHandler.cpp b/src/server/game/Handlers/BattlefieldHandler.cpp index 0263b64456f..4a29dee4fb0 100644 --- a/src/server/game/Handlers/BattlefieldHandler.cpp +++ b/src/server/game/Handlers/BattlefieldHandler.cpp @@ -60,7 +60,7 @@ void WorldSession::SendBfInvitePlayerToQueue(uint32 BattleId) //Param2:(ZoneId) the zone where the battle is (4197 for wg) //Param3:(CanQueue) if able to queue //Param4:(Full) on log in is full -void WorldSession::SendBfQueueInviteResponse(uint32 BattleId,uint32 ZoneId, bool CanQueue, bool Full) +void WorldSession::SendBfQueueInviteResponse(uint32 BattleId, uint32 ZoneId, bool CanQueue, bool Full) { WorldPacket data(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, 11); data << uint32(BattleId); diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index f57a5ce020f..60749932637 100644 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -339,7 +339,7 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket& recvData) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANKER_ACTIVATE [%s]: Go: [" UI64FMTD "] AllSlots: %u" , GetPlayerInfo().c_str(), guid, sendAllSlots); - Guild * const guild = GetPlayer()->GetGuild(); + Guild* const guild = GetPlayer()->GetGuild(); if (!guild) { Guild::SendCommandResult(this, GUILD_COMMAND_VIEW_TAB, ERR_GUILD_PLAYER_NOT_IN_GUILD); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 3ee14ed429a..c16a33ad97c 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1684,7 +1684,7 @@ void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket& recvData) sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, guid); if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId())) - bf->SendAreaSpiritHealerQueryOpcode(_player,guid); + bf->SendAreaSpiritHealerQueryOpcode(_player, guid); } void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket& recvData) diff --git a/src/server/game/Maps/ZoneScript.h b/src/server/game/Maps/ZoneScript.h index 9cea5fec518..ce7168a4040 100644 --- a/src/server/game/Maps/ZoneScript.h +++ b/src/server/game/Maps/ZoneScript.h @@ -32,11 +32,11 @@ class ZoneScript virtual uint32 GetCreatureEntry(uint32 /*guidlow*/, CreatureData const* data) { return data->id; } virtual uint32 GetGameObjectEntry(uint32 /*guidlow*/, uint32 entry) { return entry; } - virtual void OnCreatureCreate(Creature *) { } - virtual void OnCreatureRemove(Creature *) { } + virtual void OnCreatureCreate(Creature* ) { } + virtual void OnCreatureRemove(Creature* ) { } - virtual void OnGameObjectCreate(GameObject *) { } - virtual void OnGameObjectRemove(GameObject *) { } + virtual void OnGameObjectCreate(GameObject* ) { } + virtual void OnGameObjectRemove(GameObject* ) { } virtual void OnUnitDeath(Unit*) { } diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 05696694033..19dfb9df20f 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -432,7 +432,7 @@ enum SpellAttr4 SPELL_ATTR4_UNK19 = 0x00080000, // 19 proc dalayed, after damage or don't proc on absorb? SPELL_ATTR4_NOT_CHECK_SELFCAST_POWER = 0x00100000, // 20 supersedes message "More powerful spell applied" for self casts. SPELL_ATTR4_UNK21 = 0x00200000, // 21 Pally aura, dk presence, dudu form, warrior stance, shadowform, hunter track - SPELL_ATTR4_UNK22 = 0x00400000, // 22 Seal of Command (42058,57770) and Gymer's Smash 55426 + SPELL_ATTR4_UNK22 = 0x00400000, // 22 Seal of Command (42058, 57770) and Gymer's Smash 55426 SPELL_ATTR4_UNK23 = 0x00800000, // 23 SPELL_ATTR4_UNK24 = 0x01000000, // 24 some shoot spell SPELL_ATTR4_IS_PET_SCALING = 0x02000000, // 25 pet scaling auras @@ -441,7 +441,7 @@ enum SpellAttr4 SPELL_ATTR4_UNK28 = 0x10000000, // 28 Aimed Shot SPELL_ATTR4_UNK29 = 0x20000000, // 29 SPELL_ATTR4_UNK30 = 0x40000000, // 30 - SPELL_ATTR4_UNK31 = 0x80000000 // 31 Polymorph (chicken) 228 and Sonic Boom (38052,38488) + SPELL_ATTR4_UNK31 = 0x80000000 // 31 Polymorph (chicken) 228 and Sonic Boom (38052, 38488) }; enum SpellAttr5 diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index ba648c72e26..277a5721c3d 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -207,11 +207,11 @@ void MotionMaster::MoveTargetedHome() else if (_owner->GetTypeId()==TYPEID_UNIT && ((Creature*)_owner)->GetCharmerOrOwnerGUID()) { sLog->outDebug(LOG_FILTER_GENERAL, "Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUIDLow()); - Unit *target = ((Creature*)_owner)->GetCharmerOrOwner(); + Unit* target = ((Creature*)_owner)->GetCharmerOrOwner(); if (target) { sLog->outDebug(LOG_FILTER_GENERAL, "Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow()); - Mutate(new FollowMovementGenerator(*target,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE), MOTION_SLOT_ACTIVE); + Mutate(new FollowMovementGenerator(*target, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE), MOTION_SLOT_ACTIVE); } } else @@ -248,7 +248,7 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle) _owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); - Mutate(new ChaseMovementGenerator(*target,dist,angle), MOTION_SLOT_ACTIVE); + Mutate(new ChaseMovementGenerator(*target, dist, angle), MOTION_SLOT_ACTIVE); } else { @@ -256,7 +256,7 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle) _owner->GetEntry(), _owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); - Mutate(new ChaseMovementGenerator(*target,dist,angle), MOTION_SLOT_ACTIVE); + Mutate(new ChaseMovementGenerator(*target, dist, angle), MOTION_SLOT_ACTIVE); } } @@ -272,7 +272,7 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo sLog->outDebug(LOG_FILTER_GENERAL, "Player (GUID: %u) follow to %s (GUID: %u)", _owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); - Mutate(new FollowMovementGenerator(*target,dist,angle), slot); + Mutate(new FollowMovementGenerator(*target, dist, angle), slot); } else { @@ -280,7 +280,7 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo _owner->GetEntry(), _owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); - Mutate(new FollowMovementGenerator(*target,dist,angle), slot); + Mutate(new FollowMovementGenerator(*target, dist, angle), slot); } } @@ -307,7 +307,7 @@ void MotionMaster::MoveLand(uint32 id, Position const& pos) sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z); Movement::MoveSplineInit init(*_owner); - init.MoveTo(x,y,z); + init.MoveTo(x, y, z); init.SetAnimation(Movement::ToGround); init.Launch(); Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE); @@ -321,7 +321,7 @@ void MotionMaster::MoveTakeoff(uint32 id, Position const& pos) sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z); Movement::MoveSplineInit init(*_owner); - init.MoveTo(x,y,z); + init.MoveTo(x, y, z); init.SetAnimation(Movement::ToFly); init.Launch(); Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE); @@ -336,13 +336,13 @@ void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, floa float x, y, z; float moveTimeHalf = speedZ / Movement::gravity; float dist = 2 * moveTimeHalf * speedXY; - float max_height = -Movement::computeFallElevation(moveTimeHalf,false,-speedZ); + float max_height = -Movement::computeFallElevation(moveTimeHalf, false, -speedZ); _owner->GetNearPoint(_owner, x, y, z, _owner->GetObjectSize(), dist, _owner->GetAngle(srcX, srcY) + M_PI); Movement::MoveSplineInit init(*_owner); - init.MoveTo(x,y,z); - init.SetParabolic(max_height,0); + init.MoveTo(x, y, z); + init.SetParabolic(max_height, 0); init.SetOrientationFixed(true); init.SetVelocity(speedXY); init.Launch(); @@ -368,11 +368,11 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee sLog->outDebug(LOG_FILTER_GENERAL, "Unit (GUID: %u) jump to point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z); float moveTimeHalf = speedZ / Movement::gravity; - float max_height = -Movement::computeFallElevation(moveTimeHalf,false,-speedZ); + float max_height = -Movement::computeFallElevation(moveTimeHalf, false, -speedZ); Movement::MoveSplineInit init(*_owner); - init.MoveTo(x,y,z); - init.SetParabolic(max_height,0); + init.MoveTo(x, y, z); + init.SetParabolic(max_height, 0); init.SetVelocity(speedXY); init.Launch(); Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED); diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp index e89d30c56f4..d9050e2b76a 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp @@ -47,7 +47,7 @@ void FleeingMovementGenerator::_setTargetLocation(T &owner) owner.AddUnitState(UNIT_STATE_FLEEING_MOVE); Movement::MoveSplineInit init(owner); - init.MoveTo(x,y,z); + init.MoveTo(x, y, z); init.SetWalk(false); init.Launch(); } @@ -153,9 +153,9 @@ bool FleeingMovementGenerator::_getPoint(T &owner, float &x, float &y, float Trinity::NormalizeMapCoord(temp_y); if (owner.IsWithinLOS(temp_x, temp_y, z)) { - bool is_water_now = _map->IsInWater(x,y,z); + bool is_water_now = _map->IsInWater(x, y, z); - if (is_water_now && _map->IsInWater(temp_x,temp_y,z)) + if (is_water_now && _map->IsInWater(temp_x, temp_y, z)) { x = temp_x; y = temp_y; @@ -173,8 +173,8 @@ bool FleeingMovementGenerator::_getPoint(T &owner, float &x, float &y, float if (!(new_z - z) || distance / fabs(new_z - z) > 1.0f) { - float new_z_left = _map->GetHeight(owner.GetPhaseMask(), temp_x + 1.0f* std::cos(angle+static_cast(M_PI/2)),temp_y + 1.0f* std::sin(angle+static_cast(M_PI/2)),z,true); - float new_z_right = _map->GetHeight(owner.GetPhaseMask(), temp_x + 1.0f* std::cos(angle-static_cast(M_PI/2)),temp_y + 1.0f* std::sin(angle-static_cast(M_PI/2)),z,true); + float new_z_left = _map->GetHeight(owner.GetPhaseMask(), temp_x + 1.0f * std::cos(angle+static_cast(M_PI/2)), temp_y + 1.0f * std::sin(angle+static_cast(M_PI/2)), z, true); + float new_z_right = _map->GetHeight(owner.GetPhaseMask(), temp_x + 1.0f * std::cos(angle-static_cast(M_PI/2)), temp_y + 1.0f * std::sin(angle-static_cast(M_PI/2)), z, true); if (fabs(new_z_left - new_z) < 1.2f && fabs(new_z_right - new_z) < 1.2f) { x = temp_x; @@ -186,7 +186,7 @@ bool FleeingMovementGenerator::_getPoint(T &owner, float &x, float &y, float } } i_to_distance_from_caster = 0.0f; - i_nextCheckTime.Reset(urand(500,1000)); + i_nextCheckTime.Reset(urand(500, 1000)); return false; } @@ -209,7 +209,7 @@ bool FleeingMovementGenerator::_setMoveData(T &owner) { // we are very far or too close, stopping i_to_distance_from_caster = 0.0f; - i_nextCheckTime.Reset(urand(500,1000)); + i_nextCheckTime.Reset(urand(500, 1000)); return false; } else @@ -293,7 +293,7 @@ void FleeingMovementGenerator::DoInitialize(T &owner) _Init(owner); - if (Unit *fright = ObjectAccessor::GetUnit(owner, i_frightGUID)) + if (Unit* fright = ObjectAccessor::GetUnit(owner, i_frightGUID)) { i_caster_x = fright->GetPositionX(); i_caster_y = fright->GetPositionY(); diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index 358362c9c15..4f0a620c303 100644 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -40,12 +40,12 @@ void HomeMovementGenerator::_setTargetLocation(Creature & owner) Movement::MoveSplineInit init(owner); float x, y, z, o; // at apply we can select more nice return points base at current movegen - //if (owner.GetMotionMaster()->empty() || !owner.GetMotionMaster()->top()->GetResetPosition(owner,x,y,z)) + //if (owner.GetMotionMaster()->empty() || !owner.GetMotionMaster()->top()->GetResetPosition(owner, x, y, z)) //{ owner.GetHomePosition(x, y, z, o); init.SetFacing(o); //} - init.MoveTo(x,y,z); + init.MoveTo(x, y, z); init.SetWalk(false); init.Launch(); diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index 59c41d841f2..68f62d28899 100644 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -129,7 +129,7 @@ void EffectMovementGenerator::Finalize(Unit &unit) // Need restore previous movement since we have no proper states system //if (unit.isAlive() && !unit.HasUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_FLEEING)) //{ - // if (Unit * victim = unit.getVictim()) + // if (Unit* victim = unit.getVictim()) // unit.GetMotionMaster()->MoveChase(victim); // else // unit.GetMotionMaster()->Initialize(); diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index f733fa3331c..06521fadb3a 100644 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -165,8 +165,8 @@ bool RandomMovementGenerator::GetResetPosition(Creature &creature, flo creature.GetRespawnPosition(x, y, z, NULL, &radius); // use current if in range - if (creature.IsWithinDist2d(x,y,radius)) - creature.GetPosition(x,y,z); + if (creature.IsWithinDist2d(x, y,radius)) + creature.GetPosition(x, y, z); return true; } diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index ebcb830cf61..a1ac4ccb679 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -29,7 +29,7 @@ #include template -void TargetedMovementGeneratorMedium::_setTargetLocation(T &owner) +void TargetedMovementGeneratorMedium::_setTargetLocation(T &owner) { if (!i_target.isValid() || !i_target->IsInWorld()) return; @@ -41,7 +41,7 @@ void TargetedMovementGeneratorMedium::_setTargetLocation(T &owner) //! Following block of code deleted by MrSmite in issue 4891 //! Code kept for learning and diagnostical purposes // -// if (i_offset && i_target->IsWithinDistInMap(&owner,2*i_offset)) +// if (i_offset && i_target->IsWithinDistInMap(&owner, 2*i_offset)) // { // if (!owner.movespline->Finalized()) // return; @@ -99,7 +99,7 @@ void TargetedMovementGeneratorMedium::_setTargetLocation(T &owner) //We don't update Mob Movement, if the difference between New destination and last destination is < BothObjectSize float bothObjectSize = i_target->GetObjectBoundingRadius() + owner.GetObjectBoundingRadius() + CONTACT_DISTANCE; - if ( i_destinationHolder.HasDestination() && i_destinationHolder.GetDestinationDiff(x,y,z) < bothObjectSize ) + if ( i_destinationHolder.HasDestination() && i_destinationHolder.GetDestinationDiff(x, y,z) < bothObjectSize ) return; */ @@ -109,39 +109,39 @@ void TargetedMovementGeneratorMedium::_setTargetLocation(T &owner) i_recalculateTravel = false; Movement::MoveSplineInit init(owner); - init.MoveTo(x,y,z); + init.MoveTo(x, y, z); init.SetWalk(((D*)this)->EnableWalking()); init.Launch(); } template<> -void TargetedMovementGeneratorMedium >::UpdateFinalDistance(float /*fDistance*/) +void TargetedMovementGeneratorMedium >::UpdateFinalDistance(float /*fDistance*/) { // nothing to do for Player } template<> -void TargetedMovementGeneratorMedium >::UpdateFinalDistance(float /*fDistance*/) +void TargetedMovementGeneratorMedium >::UpdateFinalDistance(float /*fDistance*/) { // nothing to do for Player } template<> -void TargetedMovementGeneratorMedium >::UpdateFinalDistance(float fDistance) +void TargetedMovementGeneratorMedium >::UpdateFinalDistance(float fDistance) { i_offset = fDistance; i_recalculateTravel = true; } template<> -void TargetedMovementGeneratorMedium >::UpdateFinalDistance(float fDistance) +void TargetedMovementGeneratorMedium >::UpdateFinalDistance(float fDistance) { i_offset = fDistance; i_recalculateTravel = true; } template -bool TargetedMovementGeneratorMedium::DoUpdate(T &owner, uint32 time_diff) +bool TargetedMovementGeneratorMedium::DoUpdate(T &owner, uint32 time_diff) { if (!i_target.isValid() || !i_target->IsInWorld()) return false; @@ -176,7 +176,7 @@ bool TargetedMovementGeneratorMedium::DoUpdate(T &owner, uint32 time_diff) i_recheckDistance.Reset(50); //More distance let have better performance, less distance let have more sensitive reaction at target move. float allowed_dist = i_target->GetObjectSize() + owner.GetObjectSize() + MELEE_RANGE - 0.5f; - float dist = (owner.movespline->FinalDestination() - G3D::Vector3(i_target->GetPositionX(),i_target->GetPositionY(),i_target->GetPositionZ())).squaredLength(); + float dist = (owner.movespline->FinalDestination() - G3D::Vector3(i_target->GetPositionX(), i_target->GetPositionY(), i_target->GetPositionZ())).squaredLength(); if (dist >= allowed_dist * allowed_dist) _setTargetLocation(owner); } @@ -206,7 +206,7 @@ template void ChaseMovementGenerator::_reachTarget(T &owner) { if (owner.IsWithinMeleeRange(this->i_target.getTarget())) - owner.Attack(this->i_target.getTarget(),true); + owner.Attack(this->i_target.getTarget(), true); } template<> @@ -275,9 +275,9 @@ void FollowMovementGenerator::_updateSpeed(Creature &u) if (!((Creature&)u).isPet() || !i_target.isValid() || i_target->GetGUID() != u.GetOwnerGUID()) return; - u.UpdateSpeed(MOVE_RUN,true); - u.UpdateSpeed(MOVE_WALK,true); - u.UpdateSpeed(MOVE_SWIM,true); + u.UpdateSpeed(MOVE_RUN, true); + u.UpdateSpeed(MOVE_WALK, true); + u.UpdateSpeed(MOVE_SWIM, true); } template<> @@ -323,14 +323,14 @@ void FollowMovementGenerator::MovementInform(Creature &unit) } //-----------------------------------------------// -template void TargetedMovementGeneratorMedium >::_setTargetLocation(Player &); -template void TargetedMovementGeneratorMedium >::_setTargetLocation(Player &); -template void TargetedMovementGeneratorMedium >::_setTargetLocation(Creature &); -template void TargetedMovementGeneratorMedium >::_setTargetLocation(Creature &); -template bool TargetedMovementGeneratorMedium >::DoUpdate(Player &, uint32); -template bool TargetedMovementGeneratorMedium >::DoUpdate(Player &, uint32); -template bool TargetedMovementGeneratorMedium >::DoUpdate(Creature &, uint32); -template bool TargetedMovementGeneratorMedium >::DoUpdate(Creature &, uint32); +template void TargetedMovementGeneratorMedium >::_setTargetLocation(Player &); +template void TargetedMovementGeneratorMedium >::_setTargetLocation(Player &); +template void TargetedMovementGeneratorMedium >::_setTargetLocation(Creature &); +template void TargetedMovementGeneratorMedium >::_setTargetLocation(Creature &); +template bool TargetedMovementGeneratorMedium >::DoUpdate(Player &, uint32); +template bool TargetedMovementGeneratorMedium >::DoUpdate(Player &, uint32); +template bool TargetedMovementGeneratorMedium >::DoUpdate(Creature &, uint32); +template bool TargetedMovementGeneratorMedium >::DoUpdate(Creature &, uint32); template void ChaseMovementGenerator::_reachTarget(Player &); template void ChaseMovementGenerator::_reachTarget(Creature &); diff --git a/src/server/game/Movement/Spline/MoveSpline.cpp b/src/server/game/Movement/Spline/MoveSpline.cpp index 1e96cd00fd3..f6b1c07a927 100644 --- a/src/server/game/Movement/Spline/MoveSpline.cpp +++ b/src/server/game/Movement/Spline/MoveSpline.cpp @@ -32,7 +32,7 @@ Location MoveSpline::ComputePosition() const ASSERT(Initialized()); float u = 1.f; - int32 seg_time = spline.length(point_Idx,point_Idx+1); + int32 seg_time = spline.length(point_Idx, point_Idx+1); if (seg_time > 0) u = (time_passed - spline.length(point_Idx)) / (float)seg_time; Location c; @@ -103,7 +103,7 @@ struct FallInitializer float start_elevation; inline int32 operator()(Spline& s, int32 i) { - return Movement::computeFallTime(start_elevation - s.getPoint(i+1).z,false) * 1000.f; + return Movement::computeFallTime(start_elevation - s.getPoint(i+1).z, false) * 1000.f; } }; @@ -125,7 +125,7 @@ struct CommonInitializer void MoveSpline::init_spline(const MoveSplineInitArgs& args) { - const SplineBase::EvaluationMode modes[2] = {SplineBase::ModeLinear,SplineBase::ModeCatmullrom}; + const SplineBase::EvaluationMode modes[2] = {SplineBase::ModeLinear, SplineBase::ModeCatmullrom}; if (args.flags.cyclic) { uint32 cyclic_point = 0; diff --git a/src/server/game/Movement/Spline/MoveSpline.h b/src/server/game/Movement/Spline/MoveSpline.h index 46611e58447..8e51e2678dd 100644 --- a/src/server/game/Movement/Spline/MoveSpline.h +++ b/src/server/game/Movement/Spline/MoveSpline.h @@ -27,7 +27,7 @@ namespace Movement struct Location : public Vector3 { Location() : orientation(0) {} - Location(float x, float y, float z, float o) : Vector3(x,y,z), orientation(o) {} + Location(float x, float y, float z, float o) : Vector3(x, y, z), orientation(o) {} Location(const Vector3& v) : Vector3(v), orientation(0) {} Location(const Vector3& v, float o) : Vector3(v), orientation(o) {} @@ -101,14 +101,14 @@ namespace Movement ASSERT(Initialized()); do handler(_updateState(difftime)); - while(difftime > 0); + while (difftime > 0); } void updateState(int32 difftime) { ASSERT(Initialized()); do _updateState(difftime); - while(difftime > 0); + while (difftime > 0); } Location ComputePosition() const; diff --git a/src/server/game/Movement/Spline/MoveSplineFlag.h b/src/server/game/Movement/Spline/MoveSplineFlag.h index f3f436c9d00..ec7eaf7e763 100644 --- a/src/server/game/Movement/Spline/MoveSplineFlag.h +++ b/src/server/game/Movement/Spline/MoveSplineFlag.h @@ -27,7 +27,7 @@ namespace Movement #if defined( __GNUC__ ) #pragma pack(1) #else -#pragma pack(push,1) +#pragma pack(push, 1) #endif class MoveSplineFlag diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index b327d0d0cd6..32658d8fdc5 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -118,7 +118,7 @@ namespace Movement } PacketBuilder::WriteMonsterMove(move_spline, data); - unit.SendMessageToSet(&data,true); + unit.SendMessageToSet(&data, true); } MoveSplineInit::MoveSplineInit(Unit& m) : unit(m) @@ -130,7 +130,7 @@ namespace Movement args.flags.flying = unit.m_movementInfo.HasMovementFlag((MovementFlags)(MOVEMENTFLAG_CAN_FLY|MOVEMENTFLAG_DISABLE_GRAVITY)); } - void MoveSplineInit::SetFacing(const Unit * target) + void MoveSplineInit::SetFacing(const Unit* target) { args.flags.EnableFacingTarget(); args.facing.target = target->GetGUID(); diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index 8ebac4aec06..2188c05f2f3 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -75,7 +75,7 @@ namespace Movement */ void SetFacing(float angle); void SetFacing(Vector3 const& point); - void SetFacing(const Unit * target); + void SetFacing(const Unit* target); /* Initializes movement by path * @param path - array of points, shouldn't be empty diff --git a/src/server/game/Movement/Spline/MoveSplineInitArgs.h b/src/server/game/Movement/Spline/MoveSplineInitArgs.h index 32045629c9f..4a086094c3f 100644 --- a/src/server/game/Movement/Spline/MoveSplineInitArgs.h +++ b/src/server/game/Movement/Spline/MoveSplineInitArgs.h @@ -31,7 +31,7 @@ namespace Movement union FacingInfo { struct{ - float x,y,z; + float x, y, z; }f; uint64 target; float angle; diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index d747d6f69a6..7133fc50e9f 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -141,7 +141,7 @@ namespace Movement void PacketBuilder::WriteCreate(const MoveSpline& move_spline, ByteBuffer& data) { - //WriteClientStatus(mov,data); + //WriteClientStatus(mov, data); //data.append(&mov.m_float_values[SpeedWalk], SpeedMaxCount); //if (mov.SplineEnabled()) { diff --git a/src/server/game/Movement/Spline/MovementUtil.cpp b/src/server/game/Movement/Spline/MovementUtil.cpp index b69d4b39e19..99413384dd8 100644 --- a/src/server/game/Movement/Spline/MovementUtil.cpp +++ b/src/server/game/Movement/Spline/MovementUtil.cpp @@ -103,39 +103,39 @@ namespace Movement char const* g_MovementFlag_names[] = { - STR(Forward ),// 0x00000001, - STR(Backward ),// 0x00000002, - STR(Strafe_Left ),// 0x00000004, - STR(Strafe_Right ),// 0x00000008, - STR(Turn_Left ),// 0x00000010, - STR(Turn_Right ),// 0x00000020, - STR(Pitch_Up ),// 0x00000040, - STR(Pitch_Down ),// 0x00000080, - - STR(Walk ),// 0x00000100, // Walking - STR(Ontransport ),// 0x00000200, - STR(Levitation ),// 0x00000400, - STR(Root ),// 0x00000800, - STR(Falling ),// 0x00001000, - STR(Fallingfar ),// 0x00002000, - STR(Pendingstop ),// 0x00004000, - STR(PendingSTRafestop ),// 0x00008000, - STR(Pendingforward ),// 0x00010000, - STR(Pendingbackward ),// 0x00020000, - STR(PendingSTRafeleft ),// 0x00040000, - STR(PendingSTRaferight ),// 0x00080000, - STR(Pendingroot ),// 0x00100000, - STR(Swimming ),// 0x00200000, // Appears With Fly Flag Also - STR(Ascending ),// 0x00400000, // Swim Up Also - STR(Descending ),// 0x00800000, // Swim Down Also - STR(Can_Fly ),// 0x01000000, // Can Fly In 3.3? - STR(Flying ),// 0x02000000, // Actual Flying Mode - STR(Spline_Elevation ),// 0x04000000, // Used For Flight Paths - STR(Spline_Enabled ),// 0x08000000, // Used For Flight Paths - STR(Waterwalking ),// 0x10000000, // Prevent Unit From Falling Through Water - STR(Safe_Fall ),// 0x20000000, // Active Rogue Safe Fall Spell (Passive) - STR(Hover ),// 0x40000000 - STR(Unknown13 ),// 0x80000000 + STR(Forward ), // 0x00000001, + STR(Backward ), // 0x00000002, + STR(Strafe_Left ), // 0x00000004, + STR(Strafe_Right ), // 0x00000008, + STR(Turn_Left ), // 0x00000010, + STR(Turn_Right ), // 0x00000020, + STR(Pitch_Up ), // 0x00000040, + STR(Pitch_Down ), // 0x00000080, + + STR(Walk ), // 0x00000100, // Walking + STR(Ontransport ), // 0x00000200, + STR(Levitation ), // 0x00000400, + STR(Root ), // 0x00000800, + STR(Falling ), // 0x00001000, + STR(Fallingfar ), // 0x00002000, + STR(Pendingstop ), // 0x00004000, + STR(PendingSTRafestop ), // 0x00008000, + STR(Pendingforward ), // 0x00010000, + STR(Pendingbackward ), // 0x00020000, + STR(PendingSTRafeleft ), // 0x00040000, + STR(PendingSTRaferight ), // 0x00080000, + STR(Pendingroot ), // 0x00100000, + STR(Swimming ), // 0x00200000, // Appears With Fly Flag Also + STR(Ascending ), // 0x00400000, // Swim Up Also + STR(Descending ), // 0x00800000, // Swim Down Also + STR(Can_Fly ), // 0x01000000, // Can Fly In 3.3? + STR(Flying ), // 0x02000000, // Actual Flying Mode + STR(Spline_Elevation ), // 0x04000000, // Used For Flight Paths + STR(Spline_Enabled ), // 0x08000000, // Used For Flight Paths + STR(Waterwalking ), // 0x10000000, // Prevent Unit From Falling Through Water + STR(Safe_Fall ), // 0x20000000, // Active Rogue Safe Fall Spell (Passive) + STR(Hover ), // 0x40000000 + STR(Unknown13 ), // 0x80000000 STR(Unk1 ), STR(Unk2 ), STR(Unk3 ), @@ -156,38 +156,38 @@ namespace Movement char const* g_SplineFlag_names[32] = { - STR(AnimBit1 ),// 0x00000001, - STR(AnimBit2 ),// 0x00000002, - STR(AnimBit3 ),// 0x00000004, - STR(AnimBit4 ),// 0x00000008, - STR(AnimBit5 ),// 0x00000010, - STR(AnimBit6 ),// 0x00000020, - STR(AnimBit7 ),// 0x00000040, - STR(AnimBit8 ),// 0x00000080, - STR(Done ),// 0x00000100, - STR(Falling ),// 0x00000200, // Not Compartible With Trajectory Movement - STR(No_Spline ),// 0x00000400, - STR(Trajectory ),// 0x00000800, // Not Compartible With Fall Movement - STR(Walkmode ),// 0x00001000, - STR(Flying ),// 0x00002000, // Smooth Movement(Catmullrom Interpolation Mode), Flying Animation - STR(Knockback ),// 0x00004000, // Model Orientation Fixed - STR(Final_Point ),// 0x00008000, - STR(Final_Target ),// 0x00010000, - STR(Final_Angle ),// 0x00020000, - STR(Catmullrom ),// 0x00040000, // Used Catmullrom Interpolation Mode - STR(Cyclic ),// 0x00080000, // Movement By Cycled Spline - STR(Enter_Cycle ),// 0x00100000, // Everytime Appears With Cyclic Flag In Monster Move Packet - STR(Animation ),// 0x00200000, // Animationid (0...3), Uint32 Time, Not Compartible With Trajectory And Fall Movement - STR(Unknown4 ),// 0x00400000, // Disables Movement By Path - STR(Unknown5 ),// 0x00800000, - STR(Unknown6 ),// 0x01000000, - STR(Unknown7 ),// 0x02000000, - STR(Unknown8 ),// 0x04000000, - STR(OrientationInversed ),// 0x08000000, // Appears With Runmode Flag, Nodes ),// 1, Handles Orientation - STR(Unknown10 ),// 0x10000000, - STR(Unknown11 ),// 0x20000000, - STR(Unknown12 ),// 0x40000000, - STR(Unknown13 ),// 0x80000000, + STR(AnimBit1 ), // 0x00000001, + STR(AnimBit2 ), // 0x00000002, + STR(AnimBit3 ), // 0x00000004, + STR(AnimBit4 ), // 0x00000008, + STR(AnimBit5 ), // 0x00000010, + STR(AnimBit6 ), // 0x00000020, + STR(AnimBit7 ), // 0x00000040, + STR(AnimBit8 ), // 0x00000080, + STR(Done ), // 0x00000100, + STR(Falling ), // 0x00000200, // Not Compartible With Trajectory Movement + STR(No_Spline ), // 0x00000400, + STR(Trajectory ), // 0x00000800, // Not Compartible With Fall Movement + STR(Walkmode ), // 0x00001000, + STR(Flying ), // 0x00002000, // Smooth Movement(Catmullrom Interpolation Mode), Flying Animation + STR(Knockback ), // 0x00004000, // Model Orientation Fixed + STR(Final_Point ), // 0x00008000, + STR(Final_Target ), // 0x00010000, + STR(Final_Angle ), // 0x00020000, + STR(Catmullrom ), // 0x00040000, // Used Catmullrom Interpolation Mode + STR(Cyclic ), // 0x00080000, // Movement By Cycled Spline + STR(Enter_Cycle ), // 0x00100000, // Everytime Appears With Cyclic Flag In Monster Move Packet + STR(Animation ), // 0x00200000, // Animationid (0...3), Uint32 Time, Not Compartible With Trajectory And Fall Movement + STR(Unknown4 ), // 0x00400000, // Disables Movement By Path + STR(Unknown5 ), // 0x00800000, + STR(Unknown6 ), // 0x01000000, + STR(Unknown7 ), // 0x02000000, + STR(Unknown8 ), // 0x04000000, + STR(OrientationInversed ), // 0x08000000, // Appears With Runmode Flag, Nodes ), // 1, Handles Orientation + STR(Unknown10 ), // 0x10000000, + STR(Unknown11 ), // 0x20000000, + STR(Unknown12 ), // 0x40000000, + STR(Unknown13 ), // 0x80000000, }; template diff --git a/src/server/game/Movement/Spline/Spline.cpp b/src/server/game/Movement/Spline/Spline.cpp index 6970acf5415..887541e2289 100644 --- a/src/server/game/Movement/Spline/Spline.cpp +++ b/src/server/game/Movement/Spline/Spline.cpp @@ -59,7 +59,7 @@ SplineBase::InitMethtod SplineBase::initializers[SplineBase::ModesEnd] = using G3D::Matrix4; static const Matrix4 s_catmullRomCoeffs( - -0.5f, 1.5f,-1.5f, 0.5f, + -0.5f, 1.5f, -1.5f, 0.5f, 1.f, -2.5f, 2.f, -0.5f, -0.5f, 0.f, 0.5f, 0.f, 0.f, 1.f, 0.f, 0.f); @@ -222,7 +222,7 @@ void SplineBase::InitLinear(const Vector3* controls, index_type count, bool cycl points.resize(real_size); - memcpy(&points[0],controls, sizeof(Vector3) * count); + memcpy(&points[0], controls, sizeof(Vector3) * count); // first and last two indexes are space for special 'virtual points' // these points are required for proper C_Evaluate and C_Evaluate_Derivative methtod work @@ -244,7 +244,7 @@ void SplineBase::InitCatmullRom(const Vector3* controls, index_type count, bool int lo_index = 1; int high_index = lo_index + count - 1; - memcpy(&points[lo_index],controls, sizeof(Vector3) * count); + memcpy(&points[lo_index], controls, sizeof(Vector3) * count); // first and last two indexes are space for special 'virtual points' // these points are required for proper C_Evaluate and C_Evaluate_Derivative methtod work @@ -274,7 +274,7 @@ void SplineBase::InitBezier3(const Vector3* controls, index_type count, bool /*c index_type t = c / 3u; points.resize(c); - memcpy(&points[0],controls, sizeof(Vector3) * c); + memcpy(&points[0], controls, sizeof(Vector3) * c); index_lo = 0; index_hi = t-1; diff --git a/src/server/game/Movement/Spline/Spline.h b/src/server/game/Movement/Spline/Spline.h index 63e61b84579..2a2f3fa8f43 100644 --- a/src/server/game/Movement/Spline/Spline.h +++ b/src/server/game/Movement/Spline/Spline.h @@ -61,7 +61,7 @@ protected: void EvaluateLinear(index_type, float, Vector3&) const; void EvaluateCatmullRom(index_type, float, Vector3&) const; void EvaluateBezier3(index_type, float, Vector3&) const; - typedef void (SplineBase::*EvaluationMethtod)(index_type,float,Vector3&) const; + typedef void (SplineBase::*EvaluationMethtod)(index_type, float, Vector3&) const; static EvaluationMethtod evaluators[ModesEnd]; void EvaluateDerivativeLinear(index_type, float, Vector3&) const; @@ -91,13 +91,13 @@ public: @param t - percent of segment length, assumes that t in range [0, 1] @param Idx - spline segment index, should be in range [first, last) */ - void evaluate_percent(index_type Idx, float u, Vector3& c) const {(this->*evaluators[m_mode])(Idx,u,c);} + void evaluate_percent(index_type Idx, float u, Vector3& c) const {(this->*evaluators[m_mode])(Idx, u,c);} /** Caclulates derivation in index Idx, and percent of segment length t @param Idx - spline segment index, should be in range [first, last) @param t - percent of spline segment length, assumes that t in range [0, 1] */ - void evaluate_derivative(index_type Idx, float u, Vector3& hermite) const {(this->*derivative_evaluators[m_mode])(Idx,u,hermite);} + void evaluate_derivative(index_type Idx, float u, Vector3& hermite) const {(this->*derivative_evaluators[m_mode])(Idx, u,hermite);} /** Bounds for spline indexes. All indexes should be in range [first, last). */ index_type first() const { return index_lo;} @@ -119,7 +119,7 @@ public: would be no harm to have some custom initializers. */ template inline void init_spline(Init& initializer) { - initializer(m_mode,cyclic,points,index_lo,index_hi); + initializer(m_mode, cyclic, points, index_lo, index_hi); } void clear(); @@ -156,20 +156,20 @@ public: /** Calculates the position for given segment Idx, and percent of segment length t @param t = partial_segment_length / whole_segment_length @param Idx - spline segment index, should be in range [first, last). */ - void evaluate_percent(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_percent(Idx,u,c);} + void evaluate_percent(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_percent(Idx, u,c);} /** Caclulates derivation for index Idx, and percent of segment length t @param Idx - spline segment index, should be in range [first, last) @param t - percent of spline segment length, assumes that t in range [0, 1]. */ - void evaluate_derivative(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_derivative(Idx,u,c);} + void evaluate_derivative(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_derivative(Idx, u,c);} // Assumes that t in range [0, 1] index_type computeIndexInBounds(float t) const; void computeIndex(float t, index_type& out_idx, float& out_u) const; /** Initializes spline. Don't call other methods while spline not initialized. */ - void init_spline(const Vector3 * controls, index_type count, EvaluationMode m) { SplineBase::init_spline(controls,count,m);} - void init_cyclic_spline(const Vector3 * controls, index_type count, EvaluationMode m, index_type cyclic_point) { SplineBase::init_cyclic_spline(controls,count,m,cyclic_point);} + void init_spline(const Vector3 * controls, index_type count, EvaluationMode m) { SplineBase::init_spline(controls, count, m);} + void init_cyclic_spline(const Vector3 * controls, index_type count, EvaluationMode m, index_type cyclic_point) { SplineBase::init_cyclic_spline(controls, count, m,cyclic_point);} /** Initializes lengths with SplineBase::SegLength method. */ void initLengths(); @@ -181,7 +181,7 @@ public: index_type i = index_lo; lengths.resize(index_hi+1); length_type prev_length = 0, new_length = 0; - while(i < index_hi) + while (i < index_hi) { new_length = cacher(*this, i); lengths[++i] = new_length; diff --git a/src/server/game/Movement/Spline/SplineImpl.h b/src/server/game/Movement/Spline/SplineImpl.h index eded2d8c903..98f3f5fe079 100644 --- a/src/server/game/Movement/Spline/SplineImpl.h +++ b/src/server/game/Movement/Spline/SplineImpl.h @@ -81,7 +81,7 @@ template void Spline::initLengths() index_type i = index_lo; length_type length = 0; lengths.resize(index_hi+1); - while(i < index_hi ) + while (i < index_hi) { length += SegLength(i); lengths[++i] = length; diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp index bb7dea76461..93bf7edc7d5 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp @@ -392,7 +392,7 @@ void OutdoorPvP::SendUpdateWorldState(uint32 field, uint32 value) if (m_sendUpdate) for (int i = 0; i < 2; ++i) for (PlayerSet::iterator itr = m_players[i].begin(); itr != m_players[i].end(); ++itr) - if (Player * const player = ObjectAccessor::FindPlayer(*itr)) + if (Player* const player = ObjectAccessor::FindPlayer(*itr)) player->SendUpdateWorldState(field, value); } @@ -402,7 +402,7 @@ void OPvPCapturePoint::SendUpdateWorldState(uint32 field, uint32 value) { // send to all players present in the area for (PlayerSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end(); ++itr) - if (Player * const player = ObjectAccessor::FindPlayer(*itr)) + if (Player* const player = ObjectAccessor::FindPlayer(*itr)) player->SendUpdateWorldState(field, value); } } @@ -424,7 +424,7 @@ void OPvPCapturePoint::SendObjectiveComplete(uint32 id, uint64 guid) // send to all players present in the area for (PlayerSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end(); ++itr) - if (Player * const player = ObjectAccessor::FindPlayer(*itr)) + if (Player* const player = ObjectAccessor::FindPlayer(*itr)) player->KilledMonsterCredit(id, guid); } @@ -563,7 +563,7 @@ void OutdoorPvP::BroadcastPacket(WorldPacket &data) const // This is faster than sWorld->SendZoneMessage for (uint32 team = 0; team < 2; ++team) for (PlayerSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr) - if (Player * const player = ObjectAccessor::FindPlayer(*itr)) + if (Player* const player = ObjectAccessor::FindPlayer(*itr)) player->GetSession()->SendPacket(&data); } @@ -583,13 +583,13 @@ void OutdoorPvP::TeamCastSpell(TeamId team, int32 spellId) if (spellId > 0) { for (PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr) - if (Player * const player = ObjectAccessor::FindPlayer(*itr)) + if (Player* const player = ObjectAccessor::FindPlayer(*itr)) player->CastSpell(player, (uint32)spellId, true); } else { for (PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr) - if (Player * const player = ObjectAccessor::FindPlayer(*itr)) + if (Player* const player = ObjectAccessor::FindPlayer(*itr)) player->RemoveAura((uint32)-spellId); // by stack? } } diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.h b/src/server/game/OutdoorPvP/OutdoorPvP.h index 5f1607843fb..1e23f87a52e 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvP.h +++ b/src/server/game/OutdoorPvP/OutdoorPvP.h @@ -285,7 +285,7 @@ class OutdoorPvP : public ZoneScript void RegisterZone(uint32 zoneid); - bool HasPlayer(Player const * player) const; + bool HasPlayer(Player const* player) const; void TeamCastSpell(TeamId team, int32 spellId); }; diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index 6cd6a72a06a..7cee754bba7 100644 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -476,7 +476,7 @@ void Map::ScriptsProcess() // Source or target must be Creature. if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script)) { - Unit * unit = (Unit*)cSource; + Unit* unit = (Unit*)cSource; if (step.script->MoveTo.TravelTime != 0) { float speed = unit->GetDistance(step.script->MoveTo.DestX, step.script->MoveTo.DestY, step.script->MoveTo.DestZ) / ((float)step.script->MoveTo.TravelTime * 0.001f); diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 484a382c988..990963b8c4d 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -815,7 +815,7 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) if (mi->HasMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION)) data >> mi->splineElevation; - //! Anti-cheat checks. Please keep them in seperate if() blocks to maintain a clear overview. + //! Anti-cheat checks. Please keep them in seperate if () blocks to maintain a clear overview. //! Might be subject to latency, so just remove improper flags. #ifdef TRINITY_DEBUG #define REMOVE_VIOLATING_FLAGS(check, maskToRemove) \ diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 12551c93346..3b5c6131c5a 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5077,13 +5077,13 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool switch (GetId()) { case 59628: //Tricks of the trade buff on rogue (6sec duration) - target->SetReducedThreatPercent(0,0); + target->SetReducedThreatPercent(0, 0); break; case 57934: //Tricks of the trade buff on rogue (30sec duration) if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE || !caster->GetMisdirectionTarget()) - target->SetReducedThreatPercent(0,0); + target->SetReducedThreatPercent(0, 0); else - target->SetReducedThreatPercent(0,caster->GetMisdirectionTarget()->GetGUID()); + target->SetReducedThreatPercent(0, caster->GetMisdirectionTarget()->GetGUID()); break; } default: diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index b33546ee988..24a83c7990c 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1350,7 +1350,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && GetSpellInfo()->SpellFamilyFlags[1] & 0x1) { // Shattered Barrier - if (AuraEffect * dummy = caster->GetDummyAuraEffect(SPELLFAMILY_MAGE, 2945, 0)) + if (AuraEffect* dummy = caster->GetDummyAuraEffect(SPELLFAMILY_MAGE, 2945, 0)) if (roll_chance_i(dummy->GetSpellInfo()->ProcChance)) caster->CastSpell(target, 55080, true, NULL, GetEffect(0)); } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index af6ed55ed58..9bb3eaa31f1 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1880,7 +1880,7 @@ void Spell::SearchTargets(SEARCHER& searcher, uint32 containerMask, Unit* refere bool searchInWorld = containerMask & (GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER | GRID_MAP_TYPE_MASK_CORPSE); if (searchInGrid || searchInWorld) { - float x,y; + float x, y; x = pos->GetPositionX(); y = pos->GetPositionY(); @@ -1898,7 +1898,7 @@ void Spell::SearchTargets(SEARCHER& searcher, uint32 containerMask, Unit* refere if (searchInGrid) { TypeContainerVisitor grid_object_notifier(searcher); - cell.Visit(p, grid_object_notifier, map, radius, x , y); + cell.Visit(p, grid_object_notifier, map, radius, x, y); } } } @@ -2591,7 +2591,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA debuff_resist_chance += unit->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(m_spellInfo->Dispel)); if (debuff_resist_chance > 0) - if (irand(0,10000) <= (debuff_resist_chance * 100)) + if (irand(0, 10000) <= (debuff_resist_chance * 100)) { effectMask &= ~(1 << effectNumber); returnVal = SPELL_MISS_RESIST; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 4e4698eb01b..1dddb08be0b 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3283,7 +3283,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) } if (m_spellInfo->SpellFamilyFlags[0] & 0x8000000) // Mocking Blow { - if (unitTarget->IsImmunedToSpellEffect(m_spellInfo,EFFECT_1) || unitTarget->GetTypeId() == TYPEID_PLAYER) + if (unitTarget->IsImmunedToSpellEffect(m_spellInfo, EFFECT_1) || unitTarget->GetTypeId() == TYPEID_PLAYER) { m_damage = 0; return; diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index afbf85a0a13..0c298efd83e 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -232,7 +232,7 @@ SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data[TOTAL_SPELL_ {TARGET_OBJECT_TYPE_GOBJ, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 23 TARGET_GAMEOBJECT_TARGET {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_CHECK_ENEMY, TARGET_DIR_FRONT}, // 24 TARGET_UNIT_CONE_ENEMY_24 {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 25 TARGET_UNIT_TARGET_ANY - {TARGET_OBJECT_TYPE_GOBJ_ITEM, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 26 TARGET_GAMEOBJECT_ITEM_TARGET + {TARGET_OBJECT_TYPE_GOBJ_ITEM, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 26 TARGET_GAMEOBJECT_ITEM_TARGET {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 27 TARGET_UNIT_MASTER {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_ENEMY, TARGET_DIR_NONE}, // 28 TARGET_DEST_DYNOBJ_ENEMY {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_ALLY, TARGET_DIR_NONE}, // 29 TARGET_DEST_DYNOBJ_ALLY @@ -267,7 +267,7 @@ SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data[TOTAL_SPELL_ {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_RAID, TARGET_DIR_NONE}, // 58 TARGET_UNIT_NEARBY_RAID {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_CHECK_ALLY, TARGET_DIR_FRONT}, // 59 TARGET_UNIT_CONE_ALLY {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_CHECK_ENTRY, TARGET_DIR_FRONT}, // 60 TARGET_UNIT_CONE_ENTRY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_RAID_CLASS,TARGET_DIR_NONE}, // 61 TARGET_UNIT_TARGET_AREA_RAID_CLASS + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_RAID_CLASS, TARGET_DIR_NONE}, // 61 TARGET_UNIT_TARGET_AREA_RAID_CLASS {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 62 TARGET_UNK_62 {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 63 TARGET_DEST_TARGET_ANY {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_FRONT}, // 64 TARGET_DEST_TARGET_FRONT @@ -299,9 +299,9 @@ SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data[TOTAL_SPELL_ {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 90 TARGET_UNIT_TARGET_MINIPET {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_RANDOM}, // 91 TARGET_DEST_DEST_RADIUS {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 92 TARGET_UNIT_SUMMONER - {TARGET_OBJECT_TYPE_CORPSE, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_ENEMY, TARGET_DIR_NONE}, // 93 TARGET_CORPSE_SRC_AREA_ENEMY + {TARGET_OBJECT_TYPE_CORPSE, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_ENEMY, TARGET_DIR_NONE}, // 93 TARGET_CORPSE_SRC_AREA_ENEMY {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 94 TARGET_UNIT_VEHICLE - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_PASSENGER, TARGET_DIR_NONE}, // 95 TARGET_UNIT_TARGET_PASSENGER + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_PASSENGER, TARGET_DIR_NONE}, // 95 TARGET_UNIT_TARGET_PASSENGER {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 96 TARGET_UNIT_PASSENGER_0 {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 97 TARGET_UNIT_PASSENGER_1 {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 98 TARGET_UNIT_PASSENGER_2 diff --git a/src/server/game/Warden/Warden.h b/src/server/game/Warden/Warden.h index 7a61f3d5723..b9470b0c8a7 100644 --- a/src/server/game/Warden/Warden.h +++ b/src/server/game/Warden/Warden.h @@ -40,7 +40,7 @@ enum WardenOpcodes WARDEN_SMSG_MODULE_CACHE = 1, WARDEN_SMSG_CHEAT_CHECKS_REQUEST = 2, WARDEN_SMSG_MODULE_INITIALIZE = 3, - WARDEN_SMSG_MEM_CHECKS_REQUEST = 4, // byte len; while(!EOF) { byte unk(1); byte index(++); string module(can be 0); int offset; byte len; byte[] bytes_to_compare[len]; } + WARDEN_SMSG_MEM_CHECKS_REQUEST = 4, // byte len; while (!EOF) { byte unk(1); byte index(++); string module(can be 0); int offset; byte len; byte[] bytes_to_compare[len]; } WARDEN_SMSG_HASH_REQUEST = 5 }; @@ -60,7 +60,7 @@ enum WardenCheckType #if defined(__GNUC__) #pragma pack(1) #else -#pragma pack(push,1) +#pragma pack(push, 1) #endif struct WardenModuleUse diff --git a/src/server/game/Warden/WardenMac.cpp b/src/server/game/Warden/WardenMac.cpp index d1df94d7f07..7c2979e0dc6 100644 --- a/src/server/game/Warden/WardenMac.cpp +++ b/src/server/game/Warden/WardenMac.cpp @@ -38,7 +38,7 @@ WardenMac::~WardenMac() { } -void WardenMac::Init(WorldSession *pClient, BigNumber *K) +void WardenMac::Init(WorldSession* pClient, BigNumber* K) { _session = pClient; // Generate Warden Key diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp index bff12280d89..4da05eded0c 100644 --- a/src/server/game/Warden/WardenWin.cpp +++ b/src/server/game/Warden/WardenWin.cpp @@ -42,7 +42,7 @@ WardenWin::~WardenWin() { } -void WardenWin::Init(WorldSession* session, BigNumber *k) +void WardenWin::Init(WorldSession* session, BigNumber* k) { _session = session; // Generate Warden Key @@ -368,7 +368,7 @@ void WardenWin::HandleData(ByteBuffer &buff) sLog->outDebug(LOG_FILTER_WARDEN, "Ticks diff %u", ourTicks - newClientTicks); } - WardenCheckResult *rs; + WardenCheckResult* rs; WardenCheck *rd; uint8 type; uint16 checkFailed = 0; diff --git a/src/server/game/Warden/WardenWin.h b/src/server/game/Warden/WardenWin.h index 102a64c6895..1b1cc6746f4 100644 --- a/src/server/game/Warden/WardenWin.h +++ b/src/server/game/Warden/WardenWin.h @@ -28,7 +28,7 @@ #if defined(__GNUC__) #pragma pack(1) #else -#pragma pack(push,1) +#pragma pack(push, 1) #endif struct WardenInitModuleRequest diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index d232920418d..068bca2692f 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2889,7 +2889,7 @@ void World::ResetMonthlyQuests() void World::ResetEventSeasonalQuests(uint16 event_id) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_QUEST_STATUS_SEASONAL); - stmt->setUInt16(0,event_id); + stmt->setUInt16(0, event_id); CharacterDatabase.Execute(stmt); for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 030bc136333..400e35b705b 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1120,13 +1120,13 @@ public: if (isInt32) { uint32 value = (uint32)atoi(y); - target->SetUInt32Value(opcode , value); + target->SetUInt32Value(opcode, value); handler->PSendSysMessage(LANG_SET_UINT_FIELD, GUID_LOPART(guid), opcode, value); } else { float value = (float)atof(y); - target->SetFloatValue(opcode , value); + target->SetFloatValue(opcode, value); handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, GUID_LOPART(guid), opcode, value); } @@ -1328,7 +1328,7 @@ public: { Player* player = handler->GetSession()->GetPlayer(); - sLog->outInfo(LOG_FILTER_SQL_DEV, "(@PATH, XX, %.3f, %.3f, %.5f, 0,0, 0,100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); + sLog->outInfo(LOG_FILTER_SQL_DEV, "(@PATH, XX, %.3f, %.3f, %.5f, 0, 0, 0, 100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); handler->PSendSysMessage("Waypoint SQL written to SQL Developer log"); return true; diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index a8748bc1adf..e10cf883518 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -80,7 +80,7 @@ public: // check item starting quest (it can work incorrectly if added without item in inventory) ItemTemplateContainer const* itc = sObjectMgr->GetItemTemplateStore(); - ItemTemplateContainer::const_iterator result = find_if(itc->begin(), itc->end(), Finder(entry, &ItemTemplate::StartQuest)); + ItemTemplateContainer::const_iterator result = find_if (itc->begin(), itc->end(), Finder(entry, &ItemTemplate::StartQuest)); if (result != itc->end()) { diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 3a026d23faa..ae4b6197f4c 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -603,7 +603,7 @@ public: void netherspite_infernal::netherspite_infernalAI::Cleanup() { - Creature *pMalchezaar = Unit::GetCreature(*me, malchezaar); + Creature* pMalchezaar = Unit::GetCreature(*me, malchezaar); if (pMalchezaar && pMalchezaar->isAlive()) CAST_AI(boss_malchezaar::boss_malchezaarAI, pMalchezaar->AI())->Cleanup(me, point); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp index 32ce484f715..27e057ce6aa 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp @@ -104,7 +104,7 @@ public: { me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOM_SPELL_01); DoCast(player, SPELL_REVIVE, true); - Talk(WHISPER_REVIVE,player->GetGUID()); + Talk(WHISPER_REVIVE, player->GetGUID()); } FlyBackTimer = 5000; break; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp index b596ad3f609..5d164fbfafa 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp @@ -117,7 +117,7 @@ class boss_darkmaster_gandling : public CreatureScript case EVENT_SHADOW_PORTAL: if (HealthAbovePct(3)) { - DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_SHADOW_PORTAL,true); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_SHADOW_PORTAL, true); events.ScheduleEvent(EVENT_SHADOW_PORTAL, urand(17000, 27000)); } } @@ -172,7 +172,7 @@ class spell_shadow_portal : public SpellScriptLoader { if (attempts++ >= 6) break; - switch (urand(0,5)) + switch (urand(0, 5)) { case ROOM_HALL_OF_SECRETS: if (InstanceScript* instance = GetCaster()->GetInstanceScript()) @@ -223,7 +223,7 @@ class spell_shadow_portal : public SpellScriptLoader } }; -// Script for Shadow Portal spells 17863,17939,17943,17944,17946,17948 +// Script for Shadow Portal spells 17863, 17939, 17943, 17944, 17946, 17948 Position const SummonPos[18] = { // Hall of Secrects @@ -331,7 +331,7 @@ class spell_shadow_portal_rooms : public SpellScriptLoader if (Summoned) { Summoned->GetMotionMaster()->MoveRandom(5); - Summoned->AI()->SetData(0,phase_to_set); + Summoned->AI()->SetData(0, phase_to_set); } } diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp index d09a5ae96c9..617dff17220 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp @@ -48,7 +48,7 @@ class boss_illucia_barov : public CreatureScript struct boss_illuciabarovAI : public BossAI { - boss_illuciabarovAI(Creature* creature) : BossAI(creature,DATA_LADYILLUCIABAROV) {} + boss_illuciabarovAI(Creature* creature) : BossAI(creature, DATA_LADYILLUCIABAROV) {} void EnterCombat(Unit* /*who*/) { @@ -78,7 +78,7 @@ class boss_illucia_barov : public CreatureScript events.ScheduleEvent(EVENT_CURSEOFAGONY, 30000); break; case EVENT_SHADOWSHOCK: - DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_SHADOWSHOCK,true); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_SHADOWSHOCK, true); events.ScheduleEvent(EVENT_SHADOWSHOCK, 12000); break; case EVENT_SILENCE: diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp index 5036158cae2..e2c7287f178 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp @@ -91,7 +91,7 @@ class boss_instructor_malicia : public CreatureScript events.ScheduleEvent(EVENT_CALLOFGRAVES, 65000); break; case EVENT_CORRUPTION: - DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_CORRUPTION,true); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_CORRUPTION, true); events.ScheduleEvent(EVENT_CORRUPTION, 24000); break; case EVENT_RENEW: diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp index 32c16a1c70c..b0a2d48d053 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp @@ -152,7 +152,7 @@ class boss_kirtonos_the_herald : public CreatureScript switch (_introEvent) { case INTRO_1: - me->GetMotionMaster()->MovePath(KIRTONOS_PATH,false); + me->GetMotionMaster()->MovePath(KIRTONOS_PATH, false); _introEvent = 0; break; case INTRO_2: diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp index e8fb4324d00..3a7aee0d6c6 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp @@ -74,7 +74,7 @@ class boss_lord_alexei_barov : public CreatureScript switch (eventId) { case EVENT_IMMOLATE: - DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_IMMOLATE,true); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_IMMOLATE, true); events.ScheduleEvent(EVENT_IMMOLATE, 12000); break; case EVENT_VEILOFSHADOW: diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp index 6e3f024ac1d..c186ada72b7 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp @@ -114,7 +114,7 @@ public: if (instance) { - if (Creature *temp = Unit::GetCreature(*me, instance->GetData64(DATA_ALYTHESS))) + if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ALYTHESS))) { if (temp->isDead()) temp->Respawn(); @@ -145,7 +145,7 @@ public: if (instance) { - Creature *temp = Unit::GetCreature(*me, instance->GetData64(DATA_ALYTHESS)); + Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_ALYTHESS)); if (temp && temp->isAlive() && !temp->getVictim()) temp->AI()->AttackStart(who); } @@ -374,7 +374,7 @@ public: if (instance) { - if (Creature *temp = Unit::GetCreature((*me), instance->GetData64(DATA_SACROLASH))) + if (Creature* temp = Unit::GetCreature((*me), instance->GetData64(DATA_SACROLASH))) { if (temp->isDead()) temp->Respawn(); @@ -406,7 +406,7 @@ public: if (instance) { - Creature *temp = Unit::GetCreature(*me, instance->GetData64(DATA_SACROLASH)); + Creature* temp = Unit::GetCreature(*me, instance->GetData64(DATA_SACROLASH)); if (temp && temp->isAlive() && !temp->getVictim()) temp->AI()->AttackStart(who); } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp index d575b7633cb..57699a34e17 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp @@ -122,7 +122,7 @@ public: return false; } - Player const * GetPlayerInMap() const + Player const* GetPlayerInMap() const { Map::PlayerList const& players = instance->GetPlayers(); diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index 22c4da74d44..81f64ce6de0 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -102,7 +102,7 @@ class boss_archaedas : public CreatureScript DoCast(minion, SPELL_AWAKEN_VAULT_WALKER, flag); minion->CastSpell(minion, SPELL_ARCHAEDAS_AWAKEN, true); minion->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - minion->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE); + minion->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); minion->setFaction(14); } } diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp index ac26056c6e6..df87eaca5a8 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp @@ -205,7 +205,7 @@ class instance_uldaman : public InstanceMapScript continue; archaedas->CastSpell(target, SPELL_AWAKEN_VAULT_WALKER, true); target->CastSpell(target, SPELL_ARCHAEDAS_AWAKEN, true); - target->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE); + target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); target->setFaction(14); return; // only want the first one we find diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index 59997ebaa31..44fa0f87177 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -314,7 +314,7 @@ class npc_harrison_jones : public CreatureScript me->SetEntry(NPC_HARRISON_JONES_2); me->SetDisplayId(MODEL_HARRISON_JONES_2); me->SetTarget(0); - me->SetByteValue(UNIT_FIELD_BYTES_1,0,UNIT_STAND_STATE_DEAD); + me->SetByteValue(UNIT_FIELD_BYTES_1, 0,UNIT_STAND_STATE_DEAD); me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); if (instance) instance->SetData(DATA_GONGEVENT, DONE); @@ -330,7 +330,7 @@ class npc_harrison_jones : public CreatureScript switch (_gongEvent) { case GONG_EVENT_1: - me->GetMotionMaster()->MovePath(HARRISON_MOVE_1,false); + me->GetMotionMaster()->MovePath(HARRISON_MOVE_1, false); _gongEvent = GONG_EVENT_2; _gongTimer = 12000; break; @@ -345,14 +345,14 @@ class npc_harrison_jones : public CreatureScript break; case GONG_EVENT_3: if (GameObject* gong = me->GetMap()->GetGameObject(instance->GetData64(GO_STRANGE_GONG))) - gong->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_NOT_SELECTABLE); + gong->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); _gongEvent = GONG_EVENT_4; _gongTimer = 105000; break; case GONG_EVENT_4: me->RemoveAura(SPELL_BANGING_THE_GONG); if (GameObject* gong = me->GetMap()->GetGameObject(instance->GetData64(GO_STRANGE_GONG))) - gong->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_NOT_SELECTABLE); + gong->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); // trigger or gong will need to be scripted to set IN_PROGRESS after enough hits. // This is temp workaround. @@ -362,7 +362,7 @@ class npc_harrison_jones : public CreatureScript if (instance->GetData(DATA_GONGEVENT) == IN_PROGRESS) { // Players are Now Saved to instance at SPECIAL (Player should be notified?) - me->GetMotionMaster()->MovePath(HARRISON_MOVE_2,false); + me->GetMotionMaster()->MovePath(HARRISON_MOVE_2, false); _gongEvent = GONG_EVENT_5; _gongTimer = 5000; } @@ -401,12 +401,12 @@ class npc_harrison_jones : public CreatureScript ptarget->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_SPEAR)); ptarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); ptarget->SetReactState(REACT_PASSIVE); - ptarget->AI()->SetData(0,1); + ptarget->AI()->SetData(0, 1); } else ptarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); ptarget->SetReactState(REACT_PASSIVE); - ptarget->AI()->SetData(0,2); + ptarget->AI()->SetData(0, 2); } } } @@ -421,7 +421,7 @@ class npc_harrison_jones : public CreatureScript DoCast(me, SPELL_STEALTH); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(0)); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); - me->GetMotionMaster()->MovePath(HARRISON_MOVE_3,false); + me->GetMotionMaster()->MovePath(HARRISON_MOVE_3, false); _gongTimer = 1000; _gongEvent = 0; break; diff --git a/src/server/scripts/Events/childrens_week.cpp b/src/server/scripts/Events/childrens_week.cpp index 26f83922f87..9d35b510f6e 100644 --- a/src/server/scripts/Events/childrens_week.cpp +++ b/src/server/scripts/Events/childrens_week.cpp @@ -189,10 +189,10 @@ class npc_winterfin_playmate : public CreatureScript return; } - switch(phase) + switch (phase) { case 1: - orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5,me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ()); + orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ()); orphan->AI()->Talk(TEXT_ORACLE_ORPHAN_1); timer = 3000; break; @@ -290,7 +290,7 @@ class npc_snowfall_glade_playmate : public CreatureScript switch (phase) { case 1: - orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5,me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ()); + orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ()); orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_1); timer = 5000; break; @@ -810,7 +810,7 @@ class npc_alexstraza_the_lifebinder : public CreatureScript timer = 5000; break; case 8: - if(Creature* krasus = me->FindNearestCreature(NPC_KRASUS, 10.0f)) + if (Creature* krasus = me->FindNearestCreature(NPC_KRASUS, 10.0f)) { orphan->SetFacingToObject(krasus); krasus->AI()->Talk(TEXT_KRASUS_8); @@ -974,7 +974,7 @@ class npc_cw_area_trigger : public CreatureScript if (Creature* samuro = me->FindNearestCreature(25151, 20.0f)) { uint32 emote = 0; - switch(urand(1,5)) + switch (urand(1, 5)) { case 1: emote = EMOTE_ONESHOT_WAVE; diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp index 58665224bdd..a612269eff7 100644 --- a/src/server/scripts/Kalimdor/zone_silithus.cpp +++ b/src/server/scripts/Kalimdor/zone_silithus.cpp @@ -544,7 +544,7 @@ public: switch (AnimationCount) { case 0: - Talk(ANACHRONOS_SAY_1,Fandral->GetGUID()); + Talk(ANACHRONOS_SAY_1, Fandral->GetGUID()); break; case 1: Fandral->SetTarget(me->GetGUID()); diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp index 8f7ab09260b..b349de8f083 100644 --- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp @@ -146,7 +146,7 @@ public: Talk(SAY_GIL_FREEBOOTERS, player->GetGUID()); break; case 37: - Talk(SAY_GIL_ALMOST,player->GetGUID()); + Talk(SAY_GIL_ALMOST, player->GetGUID()); break; case 47: Talk(SAY_GIL_SWEET, player->GetGUID()); diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp index 02245c92efd..d484e2a4279 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp @@ -89,11 +89,11 @@ public: { _EnterCombat(); - events.ScheduleEvent(EVENT_ROOT, urand(5,9)*IN_MILLISECONDS); - events.ScheduleEvent(EVENT_BASH, urand(10,14)*IN_MILLISECONDS); - events.ScheduleEvent(EVENT_BOLT, urand(15,20)*IN_MILLISECONDS); - events.ScheduleEvent(EVENT_MINI, urand(12,18)*IN_MILLISECONDS); - events.ScheduleEvent(EVENT_SPAWN, 5 *IN_MILLISECONDS); + events.ScheduleEvent(EVENT_ROOT, urand(5, 9) * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_BASH, urand(10, 14) * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_BOLT, urand(15, 20) * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_MINI, urand(12, 18) * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SPAWN, 5 * IN_MILLISECONDS); me->SetInCombatWithZone(); if (instance) @@ -123,7 +123,7 @@ public: { u = 1 - u; trigger->DisappearAndDie(); - me->SummonCreature(u > 0 ? NPC_POISONOUS_MUSHROOM : NPC_HEALTHY_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60*IN_MILLISECONDS); + me->SummonCreature(u > 0 ? NPC_POISONOUS_MUSHROOM : NPC_HEALTHY_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60 * IN_MILLISECONDS); } } } @@ -145,23 +145,23 @@ public: { case EVENT_SPAWN: SpawnAdds(); - events.ScheduleEvent(EVENT_SPAWN, 20*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SPAWN, 20 * IN_MILLISECONDS); break; case EVENT_MINI: DoCast(SPELL_MINI); - events.ScheduleEvent(EVENT_MINI, urand(25,30)*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_MINI, urand(25, 30) * IN_MILLISECONDS); break; case EVENT_ROOT: - DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_ENTANGLING_ROOTS,true); - events.ScheduleEvent(EVENT_ROOT, urand(10,15)*IN_MILLISECONDS); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_ENTANGLING_ROOTS, true); + events.ScheduleEvent(EVENT_ROOT, urand(10, 15) * IN_MILLISECONDS); break; case EVENT_BASH: DoCastVictim(SPELL_BASH); - events.ScheduleEvent(EVENT_BASH, urand(7,12)*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_BASH, urand(7, 12) * IN_MILLISECONDS); break; case EVENT_BOLT: - DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_VENOM_BOLT_VOLLEY,true); - events.ScheduleEvent(EVENT_BOLT, urand(18,22)*IN_MILLISECONDS); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_VENOM_BOLT_VOLLEY, true); + events.ScheduleEvent(EVENT_BOLT, urand(18, 22) * IN_MILLISECONDS); break; default: break; @@ -191,7 +191,7 @@ public: void Reset() { events.Reset(); - events.ScheduleEvent(EVENT_AURA, 1*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_AURA, 1 * IN_MILLISECONDS); me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); DoCast(SPELL_PUTRID_MUSHROOM); @@ -231,7 +231,7 @@ public: DoCast(me, SPELL_POISONOUS_MUSHROOM_VISUAL_AREA, true); DoCast(me, SPELL_POISONOUS_MUSHROOM_POISON_CLOUD); } - events.ScheduleEvent(EVENT_AURA, 7*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_AURA, 7 * IN_MILLISECONDS); break; default: break; @@ -250,4 +250,4 @@ void AddSC_boss_amanitar() { new boss_amanitar(); new mob_amanitar_mushrooms(); -} \ No newline at end of file +} diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp index cd583603734..ac668c33874 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp @@ -94,13 +94,13 @@ class boss_elder_nadox : public CreatureScript if (instance) instance->SetData(DATA_ELDER_NADOX_EVENT, IN_PROGRESS); - events.ScheduleEvent(EVENT_PLAGUE, 13*IN_MILLISECONDS); - events.ScheduleEvent(EVENT_SUMMON_SWARMER, 10*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_PLAGUE, 13 * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SUMMON_SWARMER, 10 * IN_MILLISECONDS); if (IsHeroic()) { - events.ScheduleEvent(EVENT_RAGE, 12*IN_MILLISECONDS); - events.ScheduleEvent(EVENT_CHECK_ENRAGE, 5*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_RAGE, 12 * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_CHECK_ENRAGE, 5 * IN_MILLISECONDS); } } @@ -151,25 +151,25 @@ class boss_elder_nadox : public CreatureScript switch (eventId) { case EVENT_PLAGUE: - DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_BROOD_PLAGUE,true); - events.ScheduleEvent(EVENT_PLAGUE, 15*IN_MILLISECONDS); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_BROOD_PLAGUE, true); + events.ScheduleEvent(EVENT_PLAGUE, 15 * IN_MILLISECONDS); break; case EVENT_RAGE: DoCast(H_SPELL_BROOD_RAGE); - events.ScheduleEvent(EVENT_RAGE, urand(10*IN_MILLISECONDS, 50*IN_MILLISECONDS)); + events.ScheduleEvent(EVENT_RAGE, urand(10 * IN_MILLISECONDS, 50 * IN_MILLISECONDS)); break; case EVENT_SUMMON_SWARMER: DoCast(me, SPELL_SUMMON_SWARMERS); if (urand(1, 3) == 3) // 33% chance of dialog Talk(SAY_EGG_SAC); - events.ScheduleEvent(EVENT_SUMMON_SWARMER, 10*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SUMMON_SWARMER, 10 * IN_MILLISECONDS); break; case EVENT_CHECK_ENRAGE: if (me->HasAura(SPELL_ENRAGE)) return; if (me->GetPositionZ() < 24.0f) DoCast(me, SPELL_ENRAGE, true); - events.ScheduleEvent(EVENT_CHECK_ENRAGE, 5*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_CHECK_ENRAGE, 5 * IN_MILLISECONDS); break; default: break; @@ -209,7 +209,7 @@ class mob_ahnkahar_nerubian : public CreatureScript if (me->GetEntry() == NPC_AHNKAHAR_GUARDIAN) DoCast(me, SPELL_GUARDIAN_AURA, true); - events.ScheduleEvent(EVENT_SPRINT, 13*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SPRINT, 13 * IN_MILLISECONDS); } void JustDied(Unit* /*killer*/) @@ -234,7 +234,7 @@ class mob_ahnkahar_nerubian : public CreatureScript { case EVENT_SPRINT: DoCast(me, SPELL_SPRINT); - events.ScheduleEvent(EVENT_SPRINT, 20*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SPRINT, 20 * IN_MILLISECONDS); break; } } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index ac520968db8..82cff5ff01f 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -182,7 +182,7 @@ class boss_jaraxxus : public CreatureScript events.ScheduleEvent(EVENT_INCINERATE_FLESH, urand(20*IN_MILLISECONDS, 25*IN_MILLISECONDS)); return; case EVENT_NETHER_POWER: - me->CastCustomSpell(SPELL_NETHER_POWER, SPELLVALUE_AURA_STACK, RAID_MODE(5, 10, 5,10), me, true); + me->CastCustomSpell(SPELL_NETHER_POWER, SPELLVALUE_AURA_STACK, RAID_MODE(5, 10, 5, 10), me, true); events.ScheduleEvent(EVENT_NETHER_POWER, 40*IN_MILLISECONDS); return; case EVENT_LEGION_FLAME: diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h index 70fe03c5e0f..f42c985d3e5 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h @@ -136,8 +136,8 @@ const Position AnubarakLoc[]= const Position EndSpawnLoc[]= { {648.9167f, 131.0208f, 141.6161f, 0}, // 0 - Highlord Tirion Fordring - {649.1614f, 142.0399f, 141.3057f ,0}, // 1 - Argent Mage - {644.6250f, 149.2743f, 140.6015f ,0} // 2 - Portal to Dalaran + {649.1614f, 142.0399f, 141.3057f, 0}, // 1 - Argent Mage + {644.6250f, 149.2743f, 140.6015f, 0} // 2 - Portal to Dalaran }; enum euiWorldStates diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp index caf38fd2418..b3781f89e06 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp @@ -109,7 +109,7 @@ struct outroPosition { { 0, 0 }, { 0.0f, 0.0f, 0.0f, 0.0f } } }; -Position const CrucibleSummonPos = {5672.294f,2520.686f, 713.4386f, 0.9599311f}; +Position const CrucibleSummonPos = {5672.294f, 2520.686f, 713.4386f, 0.9599311f}; #define DATA_THREE_FACED 1 diff --git a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp index 4acabc3b2b3..1b5f6e5d426 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp @@ -251,7 +251,7 @@ public: if (TempSummon* _me = me->ToTempSummon()) if (Creature* sladran = _me->GetSummoner()->ToCreature()) - sladran->AI()->SetGUID(target->GetGUID() ,DATA_SNAKES_WHYD_IT_HAVE_TO_BE_SNAKES); + sladran->AI()->SetGUID(target->GetGUID(), DATA_SNAKES_WHYD_IT_HAVE_TO_BE_SNAKES); me->DespawnOrUnsummon(); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 35f703e0563..1b34e2a93a7 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -603,7 +603,7 @@ public: ThreatContainer::StorageType const &threatList = me->getThreatManager().getThreatList(); for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr) { - Unit * const target = (*itr)->getTarget(); + Unit* const target = (*itr)->getTarget(); if (target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() == POWER_MANA diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 952363c6dcf..1be93dcbaa5 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -167,7 +167,7 @@ enum Texts #define MAX_HOVER_DISK_WAYPOINTS 18 -// Sniffed data (x, y,z) +// Sniffed data (x, y, z) const Position HoverDiskWaypoints[MAX_HOVER_DISK_WAYPOINTS] = { {782.9821f, 1296.652f, 282.1114f, 0.0f}, @@ -192,7 +192,7 @@ const Position HoverDiskWaypoints[MAX_HOVER_DISK_WAYPOINTS] = #define GROUND_Z 268 -// Source: Sniffs (x,y,z) +// Source: Sniffs (x, y, z) #define MALYGOS_MAX_WAYPOINTS 16 const Position MalygosPhaseTwoWaypoints[MALYGOS_MAX_WAYPOINTS] = { diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index 7934f6fba72..d3c174841ee 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -787,7 +787,7 @@ class instance_ulduar : public InstanceMapScript return 0; } - bool CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* , Unit const* /* = NULL */, uint32 /* = 0 */) + bool CheckAchievementCriteriaMeet(uint32 criteriaId, Player const*, Unit const* /* = NULL */, uint32 /* = 0 */) { switch (criteriaId) { diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp index 1fd84b6f6ce..f579fb2b93c 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp @@ -124,10 +124,10 @@ public: events.Reset(); events.SetPhase(PHASE_HUMAN); - events.ScheduleEvent(EVENT_CLEAVE, urand(6,12)*IN_MILLISECONDS, 0, PHASE_HUMAN); - events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18,21)*IN_MILLISECONDS, 0, PHASE_HUMAN); - events.ScheduleEvent(EVENT_ENRAGE, urand(7,14)*IN_MILLISECONDS, 0, PHASE_HUMAN); - events.ScheduleEvent(EVENT_SMASH, urand(12,17)*IN_MILLISECONDS, 0, PHASE_HUMAN); + events.ScheduleEvent(EVENT_CLEAVE, urand(6, 12)*IN_MILLISECONDS, 0, PHASE_HUMAN); + events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18, 21)*IN_MILLISECONDS, 0, PHASE_HUMAN); + events.ScheduleEvent(EVENT_ENRAGE, urand(7, 14)*IN_MILLISECONDS, 0, PHASE_HUMAN); + events.ScheduleEvent(EVENT_SMASH, urand(12, 17)*IN_MILLISECONDS, 0, PHASE_HUMAN); if (instance) instance->SetData(DATA_INGVAR_EVENT, NOT_STARTED); @@ -193,9 +193,9 @@ public: void ScheduleSecondPhase() { events.SetPhase(PHASE_UNDEAD); - events.ScheduleEvent(EVENT_DARK_SMASH, urand(14,18)*IN_MILLISECONDS, 0, PHASE_UNDEAD); - events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18,22)*IN_MILLISECONDS, 0, PHASE_UNDEAD); - events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10,14)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + events.ScheduleEvent(EVENT_DARK_SMASH, urand(14, 18)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18, 22)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10, 14)*IN_MILLISECONDS, 0, PHASE_UNDEAD); events.ScheduleEvent(EVENT_SHADOW_AXE, 30*IN_MILLISECONDS, 0, PHASE_UNDEAD); } @@ -221,19 +221,19 @@ public: // PHASE ONE case EVENT_CLEAVE: DoCastVictim(SPELL_CLEAVE); - events.ScheduleEvent(EVENT_CLEAVE, urand(6,12)*IN_MILLISECONDS, 0, PHASE_HUMAN); + events.ScheduleEvent(EVENT_CLEAVE, urand(6, 12)*IN_MILLISECONDS, 0, PHASE_HUMAN); break; case EVENT_STAGGERING_ROAR: DoCast(me, SPELL_STAGGERING_ROAR); - events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18,22)*IN_MILLISECONDS, 0, PHASE_HUMAN); + events.ScheduleEvent(EVENT_STAGGERING_ROAR, urand(18, 22)*IN_MILLISECONDS, 0, PHASE_HUMAN); break; case EVENT_ENRAGE: DoCast(me, SPELL_ENRAGE); - events.ScheduleEvent(EVENT_ENRAGE, urand(7,14)*IN_MILLISECONDS, 0, PHASE_HUMAN); + events.ScheduleEvent(EVENT_ENRAGE, urand(7, 14)*IN_MILLISECONDS, 0, PHASE_HUMAN); break; case EVENT_SMASH: DoCastAOE(SPELL_SMASH); - events.ScheduleEvent(EVENT_SMASH, urand(12,16)*IN_MILLISECONDS, 0, PHASE_HUMAN); + events.ScheduleEvent(EVENT_SMASH, urand(12, 16)*IN_MILLISECONDS, 0, PHASE_HUMAN); break; case EVENT_JUST_TRANSFORMED: me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -247,15 +247,15 @@ public: // PHASE TWO case EVENT_DARK_SMASH: DoCastVictim(SPELL_DARK_SMASH); - events.ScheduleEvent(EVENT_DARK_SMASH, urand(12,16)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + events.ScheduleEvent(EVENT_DARK_SMASH, urand(12, 16)*IN_MILLISECONDS, 0, PHASE_UNDEAD); break; case EVENT_DREADFUL_ROAR: DoCast(me, SPELL_DREADFUL_ROAR); - events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18,22)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + events.ScheduleEvent(EVENT_DREADFUL_ROAR, urand(18, 22)*IN_MILLISECONDS, 0, PHASE_UNDEAD); break; case EVENT_WOE_STRIKE: DoCastVictim(SPELL_WOE_STRIKE); - events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10,14)*IN_MILLISECONDS, 0, PHASE_UNDEAD); + events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10, 14)*IN_MILLISECONDS, 0, PHASE_UNDEAD); break; case EVENT_SHADOW_AXE: if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1)) diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp index d709182bf04..6e532a88396 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp @@ -129,8 +129,8 @@ public: instance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED); events.Reset(); - events.ScheduleEvent(EVENT_SHADOWBOLT, urand(2,3)*IN_MILLISECONDS); - events.ScheduleEvent(EVENT_FROST_TOMB, urand(14,19)*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SHADOWBOLT, urand(2, 3)*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_FROST_TOMB, urand(14, 19)*IN_MILLISECONDS); events.ScheduleEvent(EVENT_SUMMON_SKELETONS, 6*IN_MILLISECONDS); summons.DespawnAll(); @@ -213,7 +213,7 @@ public: break; case EVENT_SHADOWBOLT: DoCastVictim(SPELL_SHADOWBOLT); - events.ScheduleEvent(EVENT_SHADOWBOLT, urand(2,3)*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SHADOWBOLT, urand(2, 3)*IN_MILLISECONDS); break; case EVENT_FROST_TOMB: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true, -SPELL_FROST_TOMB)) @@ -225,7 +225,7 @@ public: // checked from sniffs - the player casts the spell target->CastSpell(target, SPELL_FROST_TOMB_SUMMON, true); } - events.ScheduleEvent(EVENT_FROST_TOMB, urand(14,19)*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_FROST_TOMB, urand(14, 19)*IN_MILLISECONDS); break; } } @@ -261,7 +261,7 @@ public: void Reset() { events.Reset(); - events.ScheduleEvent(EVENT_DECREPIFY, urand(4,6)*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_DECREPIFY, urand(4, 6)*IN_MILLISECONDS); } @@ -280,7 +280,7 @@ public: me->SetFlag(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD); events.Reset(); - events.ScheduleEvent(EVENT_RESURRECT, urand(18,22)*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_RESURRECT, urand(18, 22)*IN_MILLISECONDS); me->GetMotionMaster()->MovementExpired(false); me->GetMotionMaster()->MoveIdle(); @@ -304,7 +304,7 @@ public: { case EVENT_DECREPIFY: DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, -SPELL_DECREPIFY), SPELL_DECREPIFY); - events.ScheduleEvent(EVENT_DECREPIFY, urand(1,5)*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_DECREPIFY, urand(1, 5)*IN_MILLISECONDS); break; case EVENT_RESURRECT: events.ScheduleEvent(EVENT_FULL_HEAL, 1*IN_MILLISECONDS); @@ -325,7 +325,7 @@ public: me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD); me->GetMotionMaster()->MoveChase(me->getVictim()); - events.ScheduleEvent(EVENT_DECREPIFY, urand(4,6)*IN_MILLISECONDS); + events.ScheduleEvent(EVENT_DECREPIFY, urand(4, 6)*IN_MILLISECONDS); break; } } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index 9468a111db5..dffdadc5b9c 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -101,8 +101,8 @@ enum SvalaPhase static const float spectatorWP[2][3] = { - {296.95f,-312.76f,86.36f}, - {297.69f,-275.81f,86.36f} + {296.95f, -312.76f, 86.36f}, + {297.69f, -275.81f, 86.36f} }; static Position ArthasPos = { 295.81f, -366.16f, 92.57f, 1.58f }; @@ -517,7 +517,7 @@ public: if (motionType == POINT_MOTION_TYPE) { if (pointId == 1) - me->GetMotionMaster()->MovePoint(2,spectatorWP[1][0],spectatorWP[1][1],spectatorWP[1][2]); + me->GetMotionMaster()->MovePoint(2, spectatorWP[1][0], spectatorWP[1][1], spectatorWP[1][2]); else if (pointId == 2) me->DespawnOrUnsummon(1000); } diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index 2ec5a3e8164..098fa80a3d3 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -586,7 +586,7 @@ public: struct npc_blessed_bannerAI : public Scripted_NoMovementAI { - npc_blessed_bannerAI(Creature* creature) : Scripted_NoMovementAI(creature) , Summons(me) + npc_blessed_bannerAI(Creature* creature) : Scripted_NoMovementAI(creature), Summons(me) { HalofSpawned = false; PhaseCount = 0; @@ -611,7 +611,7 @@ public: me->setRegeneratingHealth(false); DoCast(SPELL_THREAT_PULSE); me->AI()->Talk(BANNER_SAY); - events.ScheduleEvent(EVENT_SPAWN,3000); + events.ScheduleEvent(EVENT_SPAWN, 3000); } void EnterCombat(Unit* /*who*/) {} @@ -672,167 +672,167 @@ public: guidMason[2] = Mason3->GetGUID(); Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[1]); } - events.ScheduleEvent(EVENT_INTRO_1,15000); + events.ScheduleEvent(EVENT_INTRO_1, 15000); } break; case EVENT_INTRO_1: { - if (Creature* Dalfors = me->GetCreature(*me,guidDalfors)) + if (Creature* Dalfors = me->GetCreature(*me, guidDalfors)) Dalfors->AI()->Talk(DALFORS_SAY_PRE_1); - events.ScheduleEvent(EVENT_INTRO_2,5000); + events.ScheduleEvent(EVENT_INTRO_2, 5000); } break; case EVENT_INTRO_2: { - if (Creature* Dalfors = me->GetCreature(*me,guidDalfors)) + if (Creature* Dalfors = me->GetCreature(*me, guidDalfors)) { Dalfors->SetFacingTo(6.215f); Dalfors->AI()->Talk(DALFORS_SAY_PRE_2); } - events.ScheduleEvent(EVENT_INTRO_3,5000); + events.ScheduleEvent(EVENT_INTRO_3, 5000); } break; case EVENT_INTRO_3: { - if (Creature* Dalfors = me->GetCreature(*me,guidDalfors)) + if (Creature* Dalfors = me->GetCreature(*me, guidDalfors)) { Dalfors->GetMotionMaster()->MovePoint(0, DalforsPos[2]); Dalfors->SetHomePosition(DalforsPos[2]); } - if (Creature* Priest1 = me->GetCreature(*me,guidPriest[0])) + if (Creature* Priest1 = me->GetCreature(*me, guidPriest[0])) { Priest1->SetFacingTo(5.7421f); Priest1->SetHomePosition(Priest1Pos[1]); } - if (Creature* Priest2 = me->GetCreature(*me,guidPriest[1])) + if (Creature* Priest2 = me->GetCreature(*me, guidPriest[1])) { Priest2->SetFacingTo(5.7421f); Priest2->SetHomePosition(Priest2Pos[1]); } - if (Creature* Priest3 = me->GetCreature(*me,guidPriest[2])) + if (Creature* Priest3 = me->GetCreature(*me, guidPriest[2])) { Priest3->SetFacingTo(5.7421f); Priest3->SetHomePosition(Priest3Pos[1]); } - if (Creature* Mason1 = me->GetCreature(*me,guidMason[0])) + if (Creature* Mason1 = me->GetCreature(*me, guidMason[0])) { Mason1->GetMotionMaster()->MovePoint(0, Mason1Pos[2]); Mason1->SetHomePosition(Mason1Pos[2]); } - if (Creature* Mason2 = me->GetCreature(*me,guidMason[1])) + if (Creature* Mason2 = me->GetCreature(*me, guidMason[1])) { Mason2->GetMotionMaster()->MovePoint(0, Mason2Pos[2]); Mason2->SetHomePosition(Mason2Pos[2]); } - if (Creature* Mason3 = me->GetCreature(*me,guidMason[2])) + if (Creature* Mason3 = me->GetCreature(*me, guidMason[2])) { Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[2]); Mason3->SetHomePosition(Mason3Pos[2]); } - events.ScheduleEvent(EVENT_START_FIGHT,5000); - events.ScheduleEvent(EVENT_MASON_ACTION,15000); + events.ScheduleEvent(EVENT_START_FIGHT, 5000); + events.ScheduleEvent(EVENT_MASON_ACTION, 15000); } break; case EVENT_MASON_ACTION: { - if (Creature* Mason1 = me->GetCreature(*me,guidMason[0])) + if (Creature* Mason1 = me->GetCreature(*me, guidMason[0])) { Mason1->SetFacingTo(2.8972f); - Mason1->AI()->SetData(1,1); // triggers SAI actions on npc + Mason1->AI()->SetData(1, 1); // triggers SAI actions on npc } - if (Creature* Mason2 = me->GetCreature(*me,guidMason[1])) + if (Creature* Mason2 = me->GetCreature(*me, guidMason[1])) { Mason2->SetFacingTo(3.1241f); - Mason2->AI()->SetData(1,1); // triggers SAI actions on npc + Mason2->AI()->SetData(1, 1); // triggers SAI actions on npc } - if (Creature* Mason3 = me->GetCreature(*me,guidMason[2])) + if (Creature* Mason3 = me->GetCreature(*me, guidMason[2])) { Mason3->SetFacingTo(3.6651f); - Mason3->AI()->SetData(1,1); // triggers SAI actions on npc + Mason3->AI()->SetData(1, 1); // triggers SAI actions on npc } } break; case EVENT_START_FIGHT: { - if(Creature* LK = GetClosestCreatureWithEntry(me,NPC_LK,100)) + if (Creature* LK = GetClosestCreatureWithEntry(me, NPC_LK, 100)) LK->AI()->Talk(LK_TALK_1); - if (Creature* Dalfors = me->GetCreature(*me,guidDalfors)) + if (Creature* Dalfors = me->GetCreature(*me, guidDalfors)) Dalfors->AI()->Talk(DALFORS_SAY_START); - events.ScheduleEvent(EVENT_WAVE_SPAWN,1000); + events.ScheduleEvent(EVENT_WAVE_SPAWN, 1000); } break; case EVENT_WAVE_SPAWN: { if (PhaseCount == 3) { - if (Creature* LK = GetClosestCreatureWithEntry(me,NPC_LK,100)) + if (Creature* LK = GetClosestCreatureWithEntry(me, NPC_LK, 100)) LK->AI()->Talk(LK_TALK_2); } else if (PhaseCount == 6) { - if (Creature* LK = GetClosestCreatureWithEntry(me,NPC_LK,100)) + if (Creature* LK = GetClosestCreatureWithEntry(me, NPC_LK, 100)) LK->AI()->Talk(LK_TALK_3); } - if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE,Mason3Pos[0])) + if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE, Mason3Pos[0])) { tempsum->SetHomePosition(DalforsPos[2]); - tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100)); + tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100)); } - if (urand(0,1) == 0) + if (urand(0, 1) == 0) { - if (Creature* tempsum = DoSummon(NPC_HIDEOUS_PLAGEBRINGER,Mason1Pos[0])) + if (Creature* tempsum = DoSummon(NPC_HIDEOUS_PLAGEBRINGER, Mason1Pos[0])) { tempsum->SetHomePosition(DalforsPos[2]); - tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100)); + tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100)); } - if (Creature* tempsum = DoSummon(NPC_HIDEOUS_PLAGEBRINGER,Mason2Pos[0])) + if (Creature* tempsum = DoSummon(NPC_HIDEOUS_PLAGEBRINGER, Mason2Pos[0])) { tempsum->SetHomePosition(DalforsPos[2]); - tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100)); + tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100)); } } else { - if (Creature* tempsum = DoSummon(NPC_REANIMATED_CAPTAIN,Mason1Pos[0])) + if (Creature* tempsum = DoSummon(NPC_REANIMATED_CAPTAIN, Mason1Pos[0])) { tempsum->SetHomePosition(DalforsPos[2]); - tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100)); + tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100)); } - if (Creature* tempsum = DoSummon(NPC_REANIMATED_CAPTAIN,Mason2Pos[0])) + if (Creature* tempsum = DoSummon(NPC_REANIMATED_CAPTAIN, Mason2Pos[0])) { tempsum->SetHomePosition(DalforsPos[2]); - tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100)); + tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100)); } } PhaseCount++; if (PhaseCount < 8) - events.ScheduleEvent(EVENT_WAVE_SPAWN,urand(10000,20000)); + events.ScheduleEvent(EVENT_WAVE_SPAWN, urand(10000, 20000)); else - events.ScheduleEvent(EVENT_HALOF,urand(10000,20000)); + events.ScheduleEvent(EVENT_HALOF, urand(10000, 20000)); } break; case EVENT_HALOF: { - if (Creature* LK = GetClosestCreatureWithEntry(me,NPC_LK,100)) + if (Creature* LK = GetClosestCreatureWithEntry(me, NPC_LK, 100)) LK->AI()->Talk(LK_TALK_4); - if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE,Mason1Pos[0])) + if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE, Mason1Pos[0])) { tempsum->SetHomePosition(DalforsPos[2]); - tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100)); + tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100)); } - if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE,Mason2Pos[0])) + if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE, Mason2Pos[0])) { tempsum->SetHomePosition(DalforsPos[2]); - tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100)); + tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100)); } - if (Creature* tempsum = DoSummon(NPC_HALOF_THE_DEATHBRINGER,DalforsPos[0])) + if (Creature* tempsum = DoSummon(NPC_HALOF_THE_DEATHBRINGER, DalforsPos[0])) { HalofSpawned = true; guidHalof = tempsum->GetGUID(); tempsum->SetHomePosition(DalforsPos[2]); - tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me,NPC_BLESSED_BANNER,100)); + tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100)); } } break; @@ -845,17 +845,17 @@ public: } if (PhaseCount == 8) - if (Creature* Halof = me->GetCreature(*me,guidHalof)) + if (Creature* Halof = me->GetCreature(*me, guidHalof)) if (Halof->isDead()) { - DoCast(me,SPELL_CRUSADERS_SPIRE_VICTORY,true); + DoCast(me, SPELL_CRUSADERS_SPIRE_VICTORY, true); Summons.DespawnEntry(NPC_HIDEOUS_PLAGEBRINGER); Summons.DespawnEntry(NPC_REANIMATED_CAPTAIN); Summons.DespawnEntry(NPC_SCOURGE_DRUDGE); Summons.DespawnEntry(NPC_HALOF_THE_DEATHBRINGER); - if (Creature* Dalfors = me->GetCreature(*me,guidDalfors)) + if (Creature* Dalfors = me->GetCreature(*me, guidDalfors)) Dalfors->AI()->Talk(DALFORS_YELL_FINISHED); - events.ScheduleEvent(EVENT_ENDED,10000); + events.ScheduleEvent(EVENT_ENDED, 10000); } } }; diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index 2aa355084a1..f3afc03e68a 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -540,13 +540,13 @@ public: Player* player = Player::GetPlayer(*me, playerGUID); Creature* orphan = Creature::GetCreature(*me, orphanGUID); - if(!orphan || !player) + if (!orphan || !player) { Reset(); return; } - switch(phase) + switch (phase) { case 1: orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ()); diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index 85ab1dc1127..dae2ffd36f6 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -423,7 +423,7 @@ public: Unit* player = me->GetVehicleKit()->GetPassenger(0); if (player && player->GetTypeId() == TYPEID_PLAYER) { - // for each prisoner on drake,give credit + // for each prisoner on drake, give credit for (uint8 i = 1; i < 4; ++i) if (Unit* prisoner = me->GetVehicleKit()->GetPassenger(i)) { diff --git a/src/server/scripts/Northrend/zone_wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp index 8935c77b30e..8c255d49d25 100644 --- a/src/server/scripts/Northrend/zone_wintergrasp.cpp +++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp @@ -271,7 +271,7 @@ class npc_wg_queue : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* /*creature*/ , uint32 /*sender*/ , uint32 /*action*/) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 /*action*/) { player->CLOSE_GOSSIP_MENU(); diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index 11569c30f1e..ec85d675225 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -45,7 +45,7 @@ enum MotherShahraz SPELL_ATTRACTION = 40871, SPELL_SILENCING_SHRIEK = 40823, SPELL_ENRAGE = 23537, - SPELL_SABER_LASH = 40810,//43267 + SPELL_SABER_LASH = 40810, //43267 SPELL_SABER_LASH_IMM = 43690, SPELL_TELEPORT_VISUAL = 40869, SPELL_BERSERK = 45078 diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp index 4eaf7cc2d6c..be51b7922a2 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp @@ -375,23 +375,23 @@ class instance_blood_furnace : public InstanceMapScript switch (id) { case DATA_PRISON_CELL5: - HandleGameObject(PrisonCell5GUID,true); + HandleGameObject(PrisonCell5GUID, true); ActivatePrisoners(PrisonersCell5); break; case DATA_PRISON_CELL6: - HandleGameObject(PrisonCell6GUID,true); + HandleGameObject(PrisonCell6GUID, true); ActivatePrisoners(PrisonersCell6); break; case DATA_PRISON_CELL7: - HandleGameObject(PrisonCell7GUID,true); + HandleGameObject(PrisonCell7GUID, true); ActivatePrisoners(PrisonersCell7); break; case DATA_PRISON_CELL8: - HandleGameObject(PrisonCell8GUID,true); + HandleGameObject(PrisonCell8GUID, true); ActivatePrisoners(PrisonersCell8); break; case DATA_DOOR5: - HandleGameObject(Door5GUID,true); + HandleGameObject(Door5GUID, true); if (Creature* broggok = instance->GetCreature(BroggokGUID)) broggok->AI()->DoAction(ACTION_ACTIVATE_BROGGOK); break; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index 9c4b764fd2a..01ca1636c6b 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -518,7 +518,7 @@ class spell_astromancer_wrath_of_the_astromancer : public SpellScriptLoader return; Unit* target = GetUnitOwner(); - target->CastSpell(target, GetSpellInfo()->Effects[EFFECT_1].CalcValue(),false); + target->CastSpell(target, GetSpellInfo()->Effects[EFFECT_1].CalcValue(), false); } void Register() diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp index 0b2370e1b17..9bda618b732 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp @@ -65,7 +65,7 @@ class boss_nethermancer_sepethrea : public CreatureScript struct boss_nethermancer_sepethreaAI : public BossAI { - boss_nethermancer_sepethreaAI(Creature* creature) : BossAI(creature,DATA_NETHERMANCER_SEPRETHREA) {} + boss_nethermancer_sepethreaAI(Creature* creature) : BossAI(creature, DATA_NETHERMANCER_SEPRETHREA) {} void EnterCombat(Unit* who) { diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp index e6cb05084ad..146569db284 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp @@ -41,7 +41,7 @@ class instance_mechanar : public InstanceMapScript SetBossNumber(EncounterCount); LoadDoorData(doorData); } - + void OnGameObjectCreate(GameObject* gameObject) { diff --git a/src/server/scripts/Outland/zone_nagrand.cpp b/src/server/scripts/Outland/zone_nagrand.cpp index 0a92b985c95..edb7a2642d5 100644 --- a/src/server/scripts/Outland/zone_nagrand.cpp +++ b/src/server/scripts/Outland/zone_nagrand.cpp @@ -639,7 +639,7 @@ public: if (ChainLightningTimer <= diff) { DoCast(me->getVictim(), SPELL_KUR_CHAIN_LIGHTNING); - ChainLightningTimer = urand(7000,14000); + ChainLightningTimer = urand(7000, 14000); } else ChainLightningTimer -= diff; if (HealthBelowPct(30)) @@ -654,7 +654,7 @@ public: if (FrostShockTimer <= diff) { DoCast(me->getVictim(), SPELL_KUR_FROST_SHOCK); - FrostShockTimer = urand(7500,15000); + FrostShockTimer = urand(7500, 15000); } else FrostShockTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 4a1b0d558ff..b5f4312bae5 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1594,7 +1594,7 @@ class spell_gen_gnomish_transporter : public SpellScriptLoader void HandleDummy(SpellEffIndex /* effIndex */) { Unit* caster = GetCaster(); - caster->CastSpell(caster, roll_chance_i(50) ? SPELL_TRANSPORTER_SUCCESS : SPELL_TRANSPORTER_FAILURE , true); + caster->CastSpell(caster, roll_chance_i(50) ? SPELL_TRANSPORTER_SUCCESS : SPELL_TRANSPORTER_FAILURE, true); } void Register() diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index ccd8f3f81e7..b4e06cb6b48 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1350,7 +1350,7 @@ class spell_item_poultryizer : public SpellScriptLoader void HandleDummy(SpellEffIndex /* effIndex */) { if (GetCastItem() && GetHitUnit()) - GetCaster()->CastSpell(GetHitUnit(), roll_chance_i(80) ? SPELL_POULTRYIZER_SUCCESS : SPELL_POULTRYIZER_BACKFIRE , true, GetCastItem()); + GetCaster()->CastSpell(GetHitUnit(), roll_chance_i(80) ? SPELL_POULTRYIZER_SUCCESS : SPELL_POULTRYIZER_BACKFIRE, true, GetCastItem()); } void Register() @@ -1710,7 +1710,7 @@ class spell_item_teach_language : public SpellScriptLoader Player* caster = GetCaster()->ToPlayer(); if (roll_chance_i(34)) - caster->CastSpell(caster,caster->GetTeam() == ALLIANCE ? SPELL_LEARN_GNOMISH_BINARY : SPELL_LEARN_GOBLIN_BINARY, true); + caster->CastSpell(caster, caster->GetTeam() == ALLIANCE ? SPELL_LEARN_GNOMISH_BINARY : SPELL_LEARN_GOBLIN_BINARY, true); } void Register() @@ -2004,7 +2004,7 @@ public: void HandleDummy(SpellEffIndex /*effIndex*/) { if (GetHitUnit()) - GetCaster()->CastSpell(GetCaster(),SPELL_FORCE_CAST_SUMMON_GNOME_SOUL); + GetCaster()->CastSpell(GetCaster(), SPELL_FORCE_CAST_SUMMON_GNOME_SOUL); } void Register() diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 5198e555ee1..c4d5562ab39 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -1451,7 +1451,7 @@ public: if (pet->GetEntry() == ENTRY_ARMY_OF_THE_DEAD_GHOUL) amount = -90; // Night of the dead - else if ( Aura * aur = owner->GetAuraOfRankedSpell(SPELL_NIGHT_OF_THE_DEAD)) + else if (Aura* aur = owner->GetAuraOfRankedSpell(SPELL_NIGHT_OF_THE_DEAD)) amount = aur->GetSpellInfo()->Effects[EFFECT_2].CalcValue(); } } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index aaac8ee4b83..8a3342cf2de 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -2509,11 +2509,11 @@ public: break; case GOSSIP_ACTION_INFO_DEF + 8: player->CLOSE_GOSSIP_MENU(); - player->AddItem(ITEM_KEY_TO_THE_FOCUSING_IRIS,1); + player->AddItem(ITEM_KEY_TO_THE_FOCUSING_IRIS, 1); break; case GOSSIP_ACTION_INFO_DEF + 9: player->CLOSE_GOSSIP_MENU(); - player->AddItem(ITEM_HC_KEY_TO_THE_FOCUSING_IRIS,1); + player->AddItem(ITEM_HC_KEY_TO_THE_FOCUSING_IRIS, 1); break; } return true; @@ -2828,7 +2828,7 @@ public: { if (!me->FindNearestCreature(NPC_OMEN, 100.0f, false) && me->GetDistance2d(omenSummonPos.GetPositionX(), omenSummonPos.GetPositionY()) <= 100.0f) { - switch (urand(0,9)) + switch (urand(0, 9)) { case 0: case 1: diff --git a/src/server/shared/Cryptography/WardenKeyGeneration.h b/src/server/shared/Cryptography/WardenKeyGeneration.h index 5c04da38dc9..6d5fd563ba3 100644 --- a/src/server/shared/Cryptography/WardenKeyGeneration.h +++ b/src/server/shared/Cryptography/WardenKeyGeneration.h @@ -73,7 +73,7 @@ private: SHA1Hash sh; uint32 taken; - uint8 o0[20],o1[20],o2[20]; + uint8 o0[20], o1[20], o2[20]; }; #endif diff --git a/src/server/shared/Dynamic/HashNamespace.h b/src/server/shared/Dynamic/HashNamespace.h index afb55ae0e00..88fa8c6f00e 100644 --- a/src/server/shared/Dynamic/HashNamespace.h +++ b/src/server/shared/Dynamic/HashNamespace.h @@ -93,7 +93,7 @@ template<> struct hash { size_t operator()(const std::string &__x) const { - return hash()(__x.c_str()); + return hash()(__x.c_str()); } }; diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index 4048f056f46..60320d049ac 100644 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -82,7 +82,7 @@ void Log::CreateAppenderFromConfig(const char* name) if (!name || *name == '\0') return; - // Format=type,level,flags,optional1,optional2 + // Format=type, level, flags, optional1, optional2 // if type = File. optional1 = file and option2 = mode // if type = Console. optional1 = Color std::string options = "Appender."; diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h index 26fcc40c5e0..6d6cfe715e8 100644 --- a/src/server/shared/Logging/Log.h +++ b/src/server/shared/Logging/Log.h @@ -45,12 +45,12 @@ class Log bool ShouldLog(LogFilterType type, LogLevel level) const; bool SetLogLevel(std::string const& name, char const* level, bool isLogger = true); - void outTrace(LogFilterType f, char const* str, ...) ATTR_PRINTF(3,4); - void outDebug(LogFilterType f, char const* str, ...) ATTR_PRINTF(3,4); - void outInfo(LogFilterType f, char const* str, ...) ATTR_PRINTF(3,4); - void outWarn(LogFilterType f, char const* str, ...) ATTR_PRINTF(3,4); - void outError(LogFilterType f, char const* str, ...) ATTR_PRINTF(3,4); - void outFatal(LogFilterType f, char const* str, ...) ATTR_PRINTF(3,4); + void outTrace(LogFilterType f, char const* str, ...) ATTR_PRINTF(3, 4); + void outDebug(LogFilterType f, char const* str, ...) ATTR_PRINTF(3, 4); + void outInfo(LogFilterType f, char const* str, ...) ATTR_PRINTF(3, 4); + void outWarn(LogFilterType f, char const* str, ...) ATTR_PRINTF(3, 4); + void outError(LogFilterType f, char const* str, ...) ATTR_PRINTF(3, 4); + void outFatal(LogFilterType f, char const* str, ...) ATTR_PRINTF(3, 4); void EnableDBAppenders(); void outCommand(uint32 account, const char * str, ...) ATTR_PRINTF(3, 4); diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 5553b04f461..22dad8d7dd1 100644 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -52,7 +52,7 @@ class ByteBufferPositionException : public ByteBufferException { ACE_Stack_Trace trace; - sLog->outError(LOG_FILTER_NETWORKIO, "Attempted to %s value with size: "SIZEFMTD" in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD")\n[Stacktrace: %s]" , + sLog->outError(LOG_FILTER_NETWORKIO, "Attempted to %s value with size: "SIZEFMTD" in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD")\n[Stacktrace: %s]", (_add ? "put" : "get"), ValueSize, Pos, Size, trace.c_str()); } diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index 10c2e866a7d..e7218d7ba72 100644 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -39,7 +39,7 @@ template struct Finder class Tokenizer { public: - typedef std::vector StorageType; + typedef std::vector StorageType; typedef StorageType::size_type size_type; -- cgit v1.2.3