Skip to content

Commit

Permalink
Fix T10 Bonus for:
Browse files Browse the repository at this point in the history
- Paladin 2P Retribution
- Shaman 4P Enhancement
  • Loading branch information
John Holiver authored and leak committed Jan 2, 2011
1 parent a1d185c commit 2b42dca
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/server/game/Entities/Unit/Unit.cpp
Expand Up @@ -8543,6 +8543,14 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
// Maelstrom Weapon
case 53817:
{
// Item - Shaman T10 Enhancement 4P Bonus
if (AuraEffect * aurEff = ToPlayer()->GetAuraEffect(70832, 0))

This comment has been minimized.

Copy link
@QAston

QAston Jan 2, 2011

Contributor

What is this ToPlayer() cast for?

{
if (Aura *maelstrom = GetAura(53817))
if ((maelstrom->GetStackAmount() == maelstrom->GetSpellProto()->StackAmount) && roll_chance_i(aurEff->GetAmount()))
CastSpell(this, 70831, true, castItem, triggeredByAura);
}

// have rank dependent proc chance, ignore too often cases
// PPM = 2.5 * (rank of talent),
uint32 rank = sSpellMgr->GetSpellRank(auraSpellInfo->Id);
Expand Down
44 changes: 44 additions & 0 deletions src/server/scripts/Spells/spell_generic.cpp
Expand Up @@ -595,6 +595,49 @@ class spell_gen_shroud_of_death : public SpellScriptLoader
}
};

enum DivineStormSpell
{
SPELL_DIVINE_STORM = 53385,
};

// 70769 Divine Storm!
class spell_gen_divine_storm_cd_reset : public SpellScriptLoader
{
public:
spell_gen_divine_storm_cd_reset() : SpellScriptLoader("spell_gen_divine_storm_cd_reset") {}

class spell_gen_divine_storm_cd_reset_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_divine_storm_cd_reset_SpellScript)
bool Validate(SpellEntry const * /*spellEntry*/)
{
if (!sSpellStore.LookupEntry(SPELL_DIVINE_STORM))
return false;
return true;
}

void HandleScript(SpellEffIndex /*effIndex*/)
{
Player *caster = GetCaster()->ToPlayer();
if (caster->GetTypeId() != TYPEID_PLAYER)

This comment has been minimized.

Copy link
@lukaasm

lukaasm Jan 2, 2011

shouldn't be here if (!caster) ? since ToPlayer() will return NULL if GetCaster() isn't player ;f

return;

if (caster->HasSpellCooldown(SPELL_DIVINE_STORM))
caster->RemoveSpellCooldown(SPELL_DIVINE_STORM, true);
}

void Register()
{
OnEffect += SpellEffectFn(spell_gen_divine_storm_cd_reset_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};

SpellScript* GetSpellScript() const
{
return new spell_gen_divine_storm_cd_reset_SpellScript();
}
};

void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
Expand All @@ -610,4 +653,5 @@ void AddSC_generic_spell_scripts()
new spell_pvp_trinket_wotf_shared_cd();
new spell_gen_animal_blood();
new spell_gen_shroud_of_death();
new spell_gen_divine_storm_cd_reset();
}

1 comment on commit 2b42dca

@Broad
Copy link

@Broad Broad commented on 2b42dca Jan 2, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think its need for Paladin 2P Retribution
http://www.trinitycore.org/t/trinitycore/ticket/12

Please sign in to comment.