fix(Scripts/UtgardPinnacle): Implement Beast's Mark (#11298)
* chery-pick commit (https://github.com/TrinityCore/TrinityCore/commit/f6409efcf664a21d43243f8d2048025014c76afb) Co-Authored-By: Lucas Nascimento <keader.android@gmail.com> Co-authored-by: Lucas Nascimento <keader.android@gmail.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1649181854899342300');
|
||||||
|
|
||||||
|
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_utgarde_pinnacle_beast_mark';
|
||||||
|
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||||
|
(48876,'spell_utgarde_pinnacle_beast_mark'),
|
||||||
|
(59237,'spell_utgarde_pinnacle_beast_mark');
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU Affero General Public License as published by the
|
||||||
|
* Free Software Foundation; either version 3 of the License, or (at your
|
||||||
|
* option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ScriptMgr.h"
|
||||||
|
#include "SpellInfo.h"
|
||||||
|
#include "SpellScript.h"
|
||||||
|
#include "Unit.h"
|
||||||
|
#include "utgarde_pinnacle.h"
|
||||||
|
|
||||||
|
enum UtgardeSpells
|
||||||
|
{
|
||||||
|
SPELL_BEAST_MARK_NORMAL = 48876,
|
||||||
|
SPELL_BEAST_MARK_DAMAGE_N = 48877,
|
||||||
|
SPELL_BEAST_MARK_DAMAGE_H = 59233
|
||||||
|
};
|
||||||
|
|
||||||
|
// 48876 - Beast's Mark
|
||||||
|
// 59237 - Beast's Mark
|
||||||
|
class spell_utgarde_pinnacle_beast_mark : public AuraScript
|
||||||
|
{
|
||||||
|
PrepareAuraScript(spell_utgarde_pinnacle_beast_mark);
|
||||||
|
|
||||||
|
bool Validate(SpellInfo const* /*spell*/) override
|
||||||
|
{
|
||||||
|
return ValidateSpellInfo({ SPELL_BEAST_MARK_DAMAGE_N, SPELL_BEAST_MARK_DAMAGE_H });
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CheckProc(ProcEventInfo& eventInfo)
|
||||||
|
{
|
||||||
|
if (DamageInfo* damageInfo = eventInfo.GetDamageInfo())
|
||||||
|
{
|
||||||
|
Unit* attacker = damageInfo->GetAttacker();
|
||||||
|
if (!attacker || !damageInfo->GetDamage())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return attacker->GetCreatureType() == CREATURE_TYPE_BEAST;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||||
|
{
|
||||||
|
PreventDefaultAction();
|
||||||
|
Unit* target = GetTarget();
|
||||||
|
uint32 spellId = (m_scriptSpellId == SPELL_BEAST_MARK_NORMAL) ? SPELL_BEAST_MARK_DAMAGE_N : SPELL_BEAST_MARK_DAMAGE_H;
|
||||||
|
target->CastSpell(target, spellId, aurEff);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register() override
|
||||||
|
{
|
||||||
|
DoCheckProc += AuraCheckProcFn(spell_utgarde_pinnacle_beast_mark::CheckProc);
|
||||||
|
OnEffectProc += AuraEffectProcFn(spell_utgarde_pinnacle_beast_mark::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void AddSC_utgarde_pinnacle()
|
||||||
|
{
|
||||||
|
RegisterSpellScript(spell_utgarde_pinnacle_beast_mark);
|
||||||
|
}
|
||||||
@@ -111,6 +111,7 @@ void AddSC_boss_palehoof();
|
|||||||
void AddSC_boss_skadi();
|
void AddSC_boss_skadi();
|
||||||
void AddSC_boss_ymiron();
|
void AddSC_boss_ymiron();
|
||||||
void AddSC_instance_utgarde_pinnacle();
|
void AddSC_instance_utgarde_pinnacle();
|
||||||
|
void AddSC_utgarde_pinnacle();
|
||||||
void AddSC_utgarde_keep();
|
void AddSC_utgarde_keep();
|
||||||
void AddSC_boss_archavon(); //Vault of Archavon
|
void AddSC_boss_archavon(); //Vault of Archavon
|
||||||
void AddSC_boss_emalon();
|
void AddSC_boss_emalon();
|
||||||
@@ -276,6 +277,7 @@ void AddNorthrendScripts()
|
|||||||
AddSC_boss_skadi();
|
AddSC_boss_skadi();
|
||||||
AddSC_boss_ymiron();
|
AddSC_boss_ymiron();
|
||||||
AddSC_instance_utgarde_pinnacle();
|
AddSC_instance_utgarde_pinnacle();
|
||||||
|
AddSC_utgarde_pinnacle();
|
||||||
AddSC_utgarde_keep();
|
AddSC_utgarde_keep();
|
||||||
AddSC_boss_archavon(); //Vault of Archavon
|
AddSC_boss_archavon(); //Vault of Archavon
|
||||||
AddSC_boss_emalon();
|
AddSC_boss_emalon();
|
||||||
|
|||||||
Reference in New Issue
Block a user