aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2016-10-06 00:58:38 -0300
committerariel- <ariel-@users.noreply.github.com>2016-10-06 00:59:26 -0300
commita0e317b9916e7e17019de254959647e4efa6ed66 (patch)
tree908b4e3776eef71d098b4ad46883d492de220f25
parentf09e7cbbfe1808956c50efefa6446515b62927e3 (diff)
Core/Scripts: De-hack glyph of Barkskin with proper spell
-rw-r--r--sql/updates/world/3.3.5/2016_10_06_03_world.sql8
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp5
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp74
3 files changed, 81 insertions, 6 deletions
diff --git a/sql/updates/world/3.3.5/2016_10_06_03_world.sql b/sql/updates/world/3.3.5/2016_10_06_03_world.sql
new file mode 100644
index 00000000000..2dd3e833f7f
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_06_03_world.sql
@@ -0,0 +1,8 @@
+DELETE FROM `spell_proc` WHERE `SpellId` = 63057;
+INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES
+(63057, 0, 7, 0x00000000, 0x00040000, 0x00000000, 16384, 0x0, 0x2, 0, 0x0, 0, 0, 0, 0); -- Glyph of Barkskin
+
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_dru_barkskin','spell_dru_glyph_of_barkskin');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(22812, 'spell_dru_barkskin'),
+(63057, 'spell_dru_glyph_of_barkskin');
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 1c1db83fb62..d1b4ba664af 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -2918,12 +2918,7 @@ float Unit::GetUnitCriticalChance(WeaponAttackType attackType, Unit const* victi
// reduce crit chance from Rating for players
if (attackType != RANGED_ATTACK)
- {
ApplyResilience(victim, &crit, NULL, false, CR_CRIT_TAKEN_MELEE);
- // Glyph of barkskin
- if (victim->HasAura(63057) && victim->HasAura(22812))
- crit -= 25.0f;
- }
else
ApplyResilience(victim, &crit, NULL, false, CR_CRIT_TAKEN_RANGED);
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index fc75b6d7972..3e03316d9e4 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -83,7 +83,42 @@ enum DruidSpells
SPELL_DRUID_LANGUISH = 71023,
SPELL_DRUID_REJUVENATION_T10_PROC = 70691,
SPELL_DRUID_BALANCE_T10_BONUS = 70718,
- SPELL_DRUID_BALANCE_T10_BONUS_PROC = 70721
+ SPELL_DRUID_BALANCE_T10_BONUS_PROC = 70721,
+ SPELL_DRUID_BARKSKIN_01 = 63058
+};
+
+// 22812 - Barkskin
+class spell_dru_barkskin : public SpellScriptLoader
+{
+ public:
+ spell_dru_barkskin() : SpellScriptLoader("spell_dru_barkskin") { }
+
+ class spell_dru_barkskin_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dru_barkskin_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_BARKSKIN_01))
+ return false;
+ return true;
+ }
+
+ void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ GetTarget()->RemoveAurasDueToSpell(SPELL_DRUID_BARKSKIN_01);
+ }
+
+ void Register() override
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_dru_barkskin_AuraScript::OnRemove, EFFECT_1, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_dru_barkskin_AuraScript();
+ }
};
// 1178 - Bear Form (Passive)
@@ -412,6 +447,41 @@ class spell_dru_flight_form : public SpellScriptLoader
}
};
+// 63057 - Glyph of Barkskin
+class spell_dru_glyph_of_barkskin : public SpellScriptLoader
+{
+ public:
+ spell_dru_glyph_of_barkskin() : SpellScriptLoader("spell_dru_glyph_of_barkskin") { }
+
+ class spell_dru_glyph_of_barkskin_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dru_glyph_of_barkskin_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_BARKSKIN_01))
+ return false;
+ return true;
+ }
+
+ void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+ eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_DRUID_BARKSKIN_01, true);
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_dru_glyph_of_barkskin_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_dru_glyph_of_barkskin_AuraScript();
+ }
+};
+
// 54832 - Glyph of Innervate
class spell_dru_glyph_of_innervate : public SpellScriptLoader
{
@@ -2181,12 +2251,14 @@ class spell_dru_wild_growth : public SpellScriptLoader
void AddSC_druid_spell_scripts()
{
+ new spell_dru_barkskin();
new spell_dru_bear_form_passive();
new spell_dru_dash();
new spell_dru_eclipse();
new spell_dru_enrage();
new spell_dru_forms_trinket();
new spell_dru_flight_form();
+ new spell_dru_glyph_of_barkskin();
new spell_dru_glyph_of_innervate();
new spell_dru_glyph_of_rake();
new spell_dru_glyph_of_rejuvenation();