Advertisement
Guest User

Untitled

a guest
Apr 9th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.87 KB | None | 0 0
  1. //20375 - Seal of Command - Triggerspell distinction
  2. class spell_pal_seal_of_command : public SpellScriptLoader
  3. {
  4.     public:
  5.         spell_pal_seal_of_command() : SpellScriptLoader("spell_pal_seal_of_command") { }
  6.  
  7.         class spell_pal_seal_of_command_AuraScript : public AuraScript
  8.         {
  9.             PrepareAuraScript(spell_pal_seal_of_command_AuraScript);
  10.  
  11.             bool Validate(SpellInfo const* /*spellInfo*/) override
  12.             {
  13.                 // Check if spells are there?
  14.                 // TODO: Use Enums!!
  15.                 return ValidateSpellInfo({
  16.                     20375,
  17.                     69403,
  18.                     20424});
  19.             }
  20.  
  21.             bool CheckProc(ProcEventInfo& eventInfo)
  22.             {
  23.                 return eventInfo.GetProcTarget() != nullptr;
  24.             }
  25.  
  26.             void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
  27.             {
  28.                 PreventDefaultAction();
  29.  
  30.                 Unit* victim = eventInfo.GetProcTarget();
  31.                 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
  32.  
  33.                 // Cast Singletarget Proc on AOE Melees Hammer of Righteousness and Divine Storm
  34.                 if (!spellInfo || (spellInfo->Id != 53385 && spellInfo->Id != 53595))
  35.                     GetTarget()->CastSpell(victim, 20424);
  36.                 else
  37.                     GetTarget()->CastSpell(victim, 69403);
  38.             }
  39.  
  40.             void Register() override
  41.             {
  42.                 DoCheckProc += AuraCheckProcFn(spell_pal_seal_of_command_AuraScript::CheckProc);
  43.                 OnEffectProc += AuraEffectProcFn(spell_pal_seal_of_command_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
  44.             }
  45.         };
  46.  
  47.         AuraScript* GetAuraScript() const override
  48.         {
  49.             return new spell_pal_seal_of_command_AuraScript();
  50.         }
  51. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement