Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// Bandit's Guile - 84654
- class spell_rog_bandits_guile : public SpellScriptLoader
- {
- public:
- spell_rog_bandits_guile() : SpellScriptLoader("spell_rog_bandits_guile") { }
- class spell_rog_bandits_guile_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_rog_bandits_guile_SpellScript);
- void HandleOnHit()
- {
- if (Player* _player = GetCaster()->ToPlayer())
- {
- if (Unit* target = GetHitUnit())
- {
- _player->insightCount++;
- // it takes a total of 4 strikes to get a proc, or a level up
- if (_player->insightCount >= 4)
- {
- _player->insightCount = 0;
- // it takes 4 strikes to get Shallow insight
- // than 4 strikes to get Moderate insight
- // and than 4 strikes to get Deep Insight
- // Shallow Insight
- if (_player->HasAura(84745))
- {
- _player->RemoveAura(84745);
- _player->AddAura(84746, _player); // Moderate Insight
- }
- else if (_player->HasAura(84746))
- {
- _player->RemoveAura(84746);
- _player->AddAura(84747, _player); // Deep Insight
- }
- // the cycle will begin
- else if (!_player->HasAura(84747))
- _player->AddAura(84745, _player); // Shallow Insight
- }
- else
- {
- // Each strike refreshes the duration of shallow insight or Moderate insight
- // but you can't refresh Deep Insight without starting from shallow insight.
- // Shallow Insight
- if (AuraPtr shallowInsight = _player->GetAura(84745))
- shallowInsight->RefreshDuration();
- // Moderate Insight
- else if (AuraPtr moderateInsight = _player->GetAura(84746))
- moderateInsight->RefreshDuration();
- }
- }
- }
- }
- void Register()
- {
- OnHit += SpellHitFn(spell_rog_bandits_guile_SpellScript::HandleOnHit);
- }
- };
- SpellScript* GetSpellScript() const
- {
- return new spell_rog_bandits_guile_SpellScript();
- }
- };
Add Comment
Please, Sign In to add comment