diff options
author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-24 03:21:25 +0200 |
---|---|---|
committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-24 03:21:25 +0200 |
commit | 8adad5ebf44a4507ff2870fc32593219bb4e2b39 (patch) | |
tree | dceefc7be04e1e8f42b3f965754a4772292961f1 | |
parent | b2fb740b54fcb293f479c1039caaedf6928cd1e7 (diff) | |
parent | a522be81081dff341528969c799b526340294bc2 (diff) |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/game/Entities/Unit/Unit.cpp
src/server/scripts/Spells/spell_dk.cpp
src/server/scripts/Spells/spell_paladin.cpp
src/server/scripts/Spells/spell_priest.cpp
src/server/scripts/Spells/spell_shaman.cpp
src/server/scripts/Spells/spell_warlock.cpp
src/server/scripts/Spells/spell_warrior.cpp
-rw-r--r-- | sql/updates/world/2013_07_23_02_world_creature_template.sql | 1 | ||||
-rw-r--r-- | sql/updates/world/2013_07_24_00_world_spell_script_names.sql | 11 | ||||
-rw-r--r-- | src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 172 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_priest.cpp | 11 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 14 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 2 |
7 files changed, 118 insertions, 95 deletions
diff --git a/sql/updates/world/2013_07_23_02_world_creature_template.sql b/sql/updates/world/2013_07_23_02_world_creature_template.sql new file mode 100644 index 00000000000..b55999040f1 --- /dev/null +++ b/sql/updates/world/2013_07_23_02_world_creature_template.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `InhabitType` = 5 WHERE `entry` = 10184; diff --git a/sql/updates/world/2013_07_24_00_world_spell_script_names.sql b/sql/updates/world/2013_07_24_00_world_spell_script_names.sql new file mode 100644 index 00000000000..8c156fb2e57 --- /dev/null +++ b/sql/updates/world/2013_07_24_00_world_spell_script_names.sql @@ -0,0 +1,11 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (63310,50421,23780,33896,37594,37705,23551,23552,23572); +INSERT INTO `spell_script_names`(`spell_id`, `ScriptName`) VALUES +(63310,'spell_warl_glyph_of_shadowflame'), +(50421,'spell_dk_scent_of_blood'), +(23780,'spell_item_aegis_of_preservation'), +(33896,'spell_item_desperate_defense'), +(37594,'spell_pri_item_greater_heal_refund'), +(37705,'spell_pal_item_healing_discount'), +(23551,'spell_sha_item_lightning_shield'), +(23552,'spell_sha_item_lightning_shield_trigger'), +(23572,'spell_sha_item_mana_surge'); diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index afcbf1f0046..0adc6190d4b 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -413,7 +413,7 @@ public: } break; case EVENT_MOVEMENT: // Phase PHASE_BREATH - if (!IsMoving) + if (!IsMoving && !(me->HasUnitState(UNIT_STATE_CASTING))) { SetNextRandomPoint(); PointData = GetMoveData(); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index c7b6d326ce3..478473bf89e 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -73,6 +73,46 @@ class spell_item_trigger_spell : public SpellScriptLoader } }; +enum AegisOfPreservation +{ + SPELL_AEGIS_HEAL = 23781 +}; + +// 23780 - Aegis of Preservation +class spell_item_aegis_of_preservation : public SpellScriptLoader +{ + public: + spell_item_aegis_of_preservation() : SpellScriptLoader("spell_item_aegis_of_preservation") { } + + class spell_item_aegis_of_preservation_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_aegis_of_preservation_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_AEGIS_HEAL)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + GetTarget()->CastSpell(GetTarget(), SPELL_AEGIS_HEAL, true, NULL, aurEff); + } + + void Register() OVERRIDE + { + OnEffectProc += AuraEffectProcFn(spell_item_aegis_of_preservation_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_item_aegis_of_preservation_AuraScript(); + } +}; + // 26400 - Arcane Shroud class spell_item_arcane_shroud : public SpellScriptLoader { @@ -217,6 +257,46 @@ class spell_item_defibrillate : public SpellScriptLoader uint32 _failSpell; }; +enum DesperateDefense +{ + SPELL_DESPERATE_RAGE = 33898 +}; + +// 33896 - Desperate Defense +class spell_item_desperate_defense : public SpellScriptLoader +{ + public: + spell_item_desperate_defense() : SpellScriptLoader("spell_item_desperate_defense") { } + + class spell_item_desperate_defense_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_desperate_defense_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_DESPERATE_RAGE)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + GetTarget()->CastSpell(GetTarget(), SPELL_DESPERATE_RAGE, true, NULL, aurEff); + } + + void Register() OVERRIDE + { + OnEffectProc += AuraEffectProcFn(spell_item_desperate_defense_AuraScript::HandleProc, EFFECT_2, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_item_desperate_defense_AuraScript(); + } +}; + // http://www.wowhead.com/item=6522 Deviate Fish // 8063 Deviate Fish enum DeviateFishSpells @@ -523,15 +603,21 @@ class spell_item_necrotic_touch : public SpellScriptLoader return true; } + bool CheckProc(ProcEventInfo& eventInfo) + { + return eventInfo.GetProcTarget() && eventInfo.GetProcTarget()->IsAlive(); + } + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); int32 bp = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); - GetTarget()->CastCustomSpell(SPELL_ITEM_NECROTIC_TOUCH_PROC, SPELLVALUE_BASE_POINT0, bp, GetTarget(), true, NULL, aurEff); + GetTarget()->CastCustomSpell(SPELL_ITEM_NECROTIC_TOUCH_PROC, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetProcTarget(), true, NULL, aurEff); } void Register() OVERRIDE { + DoCheckProc += AuraCheckProcFn(spell_item_necrotic_touch_AuraScript::CheckProc); OnEffectProc += AuraEffectProcFn(spell_item_necrotic_touch_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); } }; @@ -2421,86 +2507,6 @@ public: } }; -enum AegisOfPreservation -{ - SPELL_AEGIS_HEAL = 23781 -}; - -// 23780 - Blazing Speed -class spell_item_aegis_of_preservation : public SpellScriptLoader -{ - public: - spell_item_aegis_of_preservation() : SpellScriptLoader("spell_item_aegis_of_preservation") { } - - class spell_item_aegis_of_preservation_AuraScript : public AuraScript - { - PrepareAuraScript(spell_item_aegis_of_preservation_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE - { - if (!sSpellMgr->GetSpellInfo(SPELL_AEGIS_HEAL)) - return false; - return true; - } - - void OnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) - { - PreventDefaultAction(); - GetTarget()->CastSpell(GetTarget(), SPELL_AEGIS_HEAL, true, NULL, aurEff); - } - - void Register() OVERRIDE - { - OnEffectProc += AuraEffectProcFn(spell_item_aegis_of_preservation_AuraScript::OnProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL); - } - }; - - AuraScript* GetAuraScript() const OVERRIDE - { - return new spell_item_aegis_of_preservation_AuraScript(); - } -}; - -enum DesperateDefense -{ - SPELL_DESPERATE_RAGE = 33898 -}; - -// 33896 - Desperate Defense -class spell_item_desperate_defense : public SpellScriptLoader -{ - public: - spell_item_desperate_defense() : SpellScriptLoader("spell_item_desperate_defense") { } - - class spell_item_desperate_defense_AuraScript : public AuraScript - { - PrepareAuraScript(spell_item_desperate_defense_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE - { - if (!sSpellMgr->GetSpellInfo(SPELL_DESPERATE_RAGE)) - return false; - return true; - } - - void OnProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) - { - PreventDefaultAction(); - GetTarget()->CastSpell(GetTarget(), SPELL_DESPERATE_RAGE, true, NULL, aurEff); - } - - void Register() OVERRIDE - { - OnEffectProc += AuraEffectProcFn(spell_item_desperate_defense_AuraScript::OnProc, EFFECT_2, SPELL_AURA_PROC_TRIGGER_SPELL); - } - }; - - AuraScript* GetAuraScript() const OVERRIDE - { - return new spell_item_desperate_defense_AuraScript(); - } -}; - void AddSC_item_spell_scripts() { // 23074 Arcanite Dragonling @@ -2512,11 +2518,13 @@ void AddSC_item_spell_scripts() // 23075 Mithril Mechanical Dragonling new spell_item_trigger_spell("spell_item_mithril_mechanical_dragonling", SPELL_MITHRIL_MECHANICAL_DRAGONLING); + new spell_item_aegis_of_preservation(); new spell_item_arcane_shroud(); new spell_item_blessing_of_ancient_kings(); new spell_item_defibrillate("spell_item_goblin_jumper_cables", 67, SPELL_GOBLIN_JUMPER_CABLES_FAIL); new spell_item_defibrillate("spell_item_goblin_jumper_cables_xl", 50, SPELL_GOBLIN_JUMPER_CABLES_XL_FAIL); new spell_item_defibrillate("spell_item_gnomish_army_knife", 33); + new spell_item_desperate_defense(); new spell_item_deviate_fish(); new spell_item_flask_of_the_north(); new spell_item_gnomish_death_ray(); @@ -2564,6 +2572,4 @@ void AddSC_item_spell_scripts() new spell_item_chicken_cover(); new spell_item_muisek_vessel(); new spell_item_greatmothers_soulcatcher(); - new spell_item_aegis_of_preservation(); - new spell_item_desperate_defense(); } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 3d754275c20..4d85f1ed818 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -769,12 +769,11 @@ class spell_pri_power_word_shield : public SpellScriptLoader if (dmgInfo.GetAttacker() == target) return; - if (Unit* caster = GetCaster()) - if (AuraEffect* talentAurEff = caster->GetAuraEffectOfRankedSpell(SPELL_PRIEST_REFLECTIVE_SHIELD_R1, EFFECT_0)) - { - int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount()); - target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); - } + if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_PRIEST_REFLECTIVE_SHIELD_R1, EFFECT_0)) + { + int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount()); + target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); + } } void Register() OVERRIDE diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 3b67fca94cf..af652192d59 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -279,17 +279,22 @@ class spell_sha_earth_shield : public SpellScriptLoader } } - void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + bool CheckProc(ProcEventInfo& /*eventInfo*/) { - PreventDefaultAction(); - //! HACK due to currenct proc system implementation if (Player* player = GetTarget()->ToPlayer()) if (player->HasSpellCooldown(SPELL_SHAMAN_EARTH_SHIELD_HEAL)) - return; + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); GetTarget()->CastCustomSpell(SPELL_SHAMAN_EARTH_SHIELD_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, NULL, aurEff, GetCasterGUID()); + /// @hack: due to currenct proc system implementation if (Player* player = GetTarget()->ToPlayer()) player->AddSpellCooldown(SPELL_SHAMAN_EARTH_SHIELD_HEAL, 0, time(NULL) + 3); } @@ -297,6 +302,7 @@ class spell_sha_earth_shield : public SpellScriptLoader void Register() OVERRIDE { DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_earth_shield_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_DUMMY); + DoCheckProc += AuraCheckProcFn(spell_sha_earth_shield_AuraScript::CheckProc); OnEffectProc += AuraEffectProcFn(spell_sha_earth_shield_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); } }; diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 6485b4da7fd..af136235fd6 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -70,7 +70,7 @@ enum MiscSpells enum WarriorSpellIcons { - WARRIOR_ICON_ID_SUDDEN_DEATH = 1989, + WARRIOR_ICON_ID_SUDDEN_DEATH = 1989 }; /// Updated 4.3.4 |