Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-774 Proc val'anyr (fix pro val'anyr récuperation))
- class spell_recup_anyr : public SpellScriptLoader
- {
- public:
- spell_recup_anyr() : SpellScriptLoader("spell_recup_anyr") {}
- class spell_recup_anyr_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_recup_anyr_SpellScript);
- void HandleScriptEffect (SpellEffIndex /*index*/)
- {
- Unit *caster = GetCaster();
- if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
- return;
- caster->ToPlayer()->AddItem(32837, 1);
- if (caster->HasAura(64415))
- {
- caster->ToPlayer()->AddItem(32525, 1);
- if (!(caster->ToPlayer()->HasSpellCooldown(64411)))
- if ((rand() % 101 <= 50))
- {
- caster->ToPlayer()->AddItem(32483, 1);
- caster->ToPlayer()->CastSpell(caster, 64411);
- caster->ToPlayer()->AddSpellCooldown(64411, 0, uint32(time(NULL) + 35));
- }
- }
- if (caster->HasAura(64411))
- {
- if (!(caster->ToPlayer()->HasSpellCooldown(64413)))
- {
- caster->ToPlayer()->CastSpell(caster, 64413);
- }
- }
- }
- void Register() override
- {
- OnEffectHitTarget += SpellEffectFn(spell_recup_anyr_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_APPLY_AURA); //SPELL_EFFECT_APPLY_AURA || SPELL_EFFECT_APPLY_AREA_AURA_FRIEND
- }
- };
- SpellScript* GetSpellScript() const override
- {
- return new spell_recup_anyr_SpellScript();
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement