mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Scripts: Added combat abilities to trash mobs in Ruby Sanctum
Thx @sirikfoll
SAI by @Keader
Closes #16703
(cherry picked from commit ef7a91d193)
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "SpellScript.h"
|
||||
#include "ruby_sanctum.h"
|
||||
#include "Player.h"
|
||||
|
||||
@@ -45,6 +46,11 @@ enum Events
|
||||
EVENT_XERESTRASZA_EVENT_7 = 7,
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_RALLY = 75416
|
||||
};
|
||||
|
||||
Position const xerestraszaMovePos = {3151.236f, 379.8733f, 86.31996f, 0.0f};
|
||||
|
||||
class npc_xerestrasza : public CreatureScript
|
||||
@@ -165,8 +171,53 @@ class at_baltharus_plateau : public AreaTriggerScript
|
||||
}
|
||||
};
|
||||
|
||||
// 75415 - Rallying Shout
|
||||
class spell_ruby_sanctum_rallying_shout : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_ruby_sanctum_rallying_shout() : SpellScriptLoader("spell_ruby_sanctum_rallying_shout") { }
|
||||
|
||||
class spell_ruby_sanctum_rallying_shout_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_ruby_sanctum_rallying_shout_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_RALLY))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CountTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
_targetCount = targets.size();
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (_targetCount && !GetCaster()->HasAura(SPELL_RALLY))
|
||||
GetCaster()->CastCustomSpell(SPELL_RALLY, SPELLVALUE_AURA_STACK, _targetCount, GetCaster(), TRIGGERED_FULL_MASK);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ruby_sanctum_rallying_shout_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
|
||||
OnEffectHit += SpellEffectFn(spell_ruby_sanctum_rallying_shout_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _targetCount = 0;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_ruby_sanctum_rallying_shout_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_ruby_sanctum()
|
||||
{
|
||||
new npc_xerestrasza();
|
||||
new at_baltharus_plateau();
|
||||
new spell_ruby_sanctum_rallying_shout();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user