Guest User

By Cronic/Rexo

a guest
Jan 6th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.58 KB | None | 0 0
  1.  // Overpower Proc Enabler - 60503
  2. class spell_warrior_overpower_proc : public SpellScriptLoader
  3. {
  4. public:
  5.     spell_warrior_overpower_proc() : SpellScriptLoader("spell_warrior_overpower_proc") {}
  6.  
  7.     class spell_warrior_overpower_proc_AuraScript : public AuraScript
  8.     {
  9.         PrepareAuraScript(spell_warrior_overpower_proc_AuraScript);
  10.  
  11.         bool CheckProc(ProcEventInfo& eventInfo)
  12.         {
  13.             //"Your other melee abilities have a chance to activate Overpower."
  14.             //According to sources it should only proc on Whirlwind, Colossus Smash, Mortal Strike and Slam with a 5% chance.
  15.             uint32 _spellId = eventInfo.GetSpellInfo()->Id;
  16.             std::vector<uint32> spellList = { 1680, 167105, 12294, 1464 };
  17.             for (auto id : spellList)
  18.                 if (_spellId == id)
  19.                     return true;
  20.             return false;
  21.         }
  22.  
  23.         void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
  24.         {
  25.             Unit* caster = GetCaster();
  26.  
  27.             if (!caster->HasAura(SPELL_WARRIOR_OVERPOWER_PROC))
  28.                 caster->CastSpell(caster, SPELL_WARRIOR_OVERPOWER_PROC, true);
  29.         }
  30.  
  31.         void Register() override
  32.         {
  33.             OnEffectProc += AuraEffectProcFn(spell_warrior_overpower_proc_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
  34.             DoCheckProc += AuraCheckProcFn(spell_warrior_overpower_proc_AuraScript::CheckProc);
  35.         }
  36.     };
  37.  
  38.     AuraScript* GetAuraScript() const override
  39.     {
  40.         return new spell_warrior_overpower_proc_AuraScript();
  41.     }
  42. };
Advertisement
Add Comment
Please, Sign In to add comment