From 4abed08f4d4c39ac1b0d242950753a31a7930166 Mon Sep 17 00:00:00 2001 From: maximius Date: Thu, 19 Nov 2009 04:36:20 -0800 Subject: [PATCH] *Implement second part of Furor, closes #333. *Add missed part of last commit (oops) --HG-- branch : trunk --- src/game/SpellAuras.cpp | 35 ++++++++++++++++++++++------------- 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 821209e823..367ab474be 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) + switch (GetMiscValue()) { - int32 basePoints = int32(std::min(oldPower, FurorChance)); - m_target->CastCustomSpell(m_target, 17099, &basePoints, NULL, NULL, true, NULL, this); - } - else - { - 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 5198722ba8..91ca1d0447 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)