diff options
author | maximius <none@none> | 2009-11-19 04:36:20 -0800 |
---|---|---|
committer | maximius <none@none> | 2009-11-19 04:36:20 -0800 |
commit | 4abed08f4d4c39ac1b0d242950753a31a7930166 (patch) | |
tree | f4e512336bc3074218d53960fabc5b2982aa66fe /src | |
parent | ffe4451dc2cefe429d81fbd7bef69452eef619a6 (diff) |
*Implement second part of Furor, closes #333.
*Add missed part of last commit (oops)
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SpellAuras.cpp | 35 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 2 |
2 files changed, 23 insertions, 14 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 821209e8235..367ab474be8 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3530,17 +3530,17 @@ void AuraEffect::HandleAuraModShapeshift(bool apply, bool Real, bool changeAmoun m_target->SetByteValue(UNIT_FIELD_BYTES_2, 3, form); - if(modelid > 0) + if (modelid > 0) m_target->SetDisplayId(modelid); - if(PowerType != POWER_MANA) + if (PowerType != POWER_MANA) { uint32 oldPower = m_target->GetPower(PowerType); // reset power to default values only at power change if(m_target->getPowerType() != PowerType) m_target->setPowerType(PowerType); - switch(form) + switch (form) { case FORM_CAT: case FORM_BEAR: @@ -3548,18 +3548,27 @@ void AuraEffect::HandleAuraModShapeshift(bool apply, bool Real, bool changeAmoun { // get furor proc chance uint32 FurorChance = 0; - if (AuraEffect const * dummy = m_target->GetDummyAura(SPELLFAMILY_DRUID, 238, 0)) - FurorChance = dummy->GetAmount() > 0 ? uint32(dummy->GetAmount()) : 0; + if (AuraEffect const *dummy = m_target->GetDummyAura(SPELLFAMILY_DRUID, 238, 0)) + FurorChance = std::max(dummy->GetAmount(), 0); - if (GetMiscValue() == FORM_CAT) - { - int32 basePoints = int32(std::min(oldPower, FurorChance)); - m_target->CastCustomSpell(m_target, 17099, &basePoints, NULL, NULL, true, NULL, this); - } - else + switch (GetMiscValue()) { - uint32 newEnergy = std::min(m_target->GetPower(POWER_ENERGY), FurorChance); - m_target->SetPower(POWER_ENERGY, newEnergy); + case FORM_CAT: + { + int32 basePoints = int32(std::min(oldPower, FurorChance)); + m_target->CastCustomSpell(m_target, 17099, &basePoints, NULL, NULL, true, NULL, this); + } + break; + case FORM_BEAR: + case FORM_DIREBEAR: + if (urand(0,99) < FurorChance) + m_target->SetPower(POWER_RAGE, 10); + default: + { + uint32 newEnergy = std::min(m_target->GetPower(POWER_ENERGY), FurorChance); + m_target->SetPower(POWER_ENERGY, newEnergy); + } + break; } break; } diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 5198722ba85..91ca1d04471 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -6750,7 +6750,7 @@ void Spell::EffectPlayerPull(uint32 i) if(!unitTarget) return; - unitTarget->GetMotionMaster()->MoveJump(m_caster->GetPositionX(), m_caster->GetPositionY(), float(damage ? damage : unitTarget->GetDistance2d(m_caster)), float(m_spellInfo->EffectMiscValue[i])/10); + unitTarget->GetMotionMaster()->MoveJump(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ(), float(damage ? damage : unitTarget->GetDistance2d(m_caster)), float(m_spellInfo->EffectMiscValue[i])/10); } void Spell::EffectDispelMechanic(uint32 i) |