*Implement second part of Furor, closes #333.

*Add missed part of last commit (oops)

--HG--
branch : trunk
This commit is contained in:
maximius
2009-11-19 04:36:20 -08:00
parent ffe4451dc2
commit 4abed08f4d
2 changed files with 23 additions and 14 deletions
+16 -7
View File
@@ -3530,17 +3530,17 @@ void AuraEffect::HandleAuraModShapeshift(bool apply, bool Real, bool changeAmoun
m_target->SetByteValue(UNIT_FIELD_BYTES_2, 3, form); m_target->SetByteValue(UNIT_FIELD_BYTES_2, 3, form);
if(modelid > 0) if (modelid > 0)
m_target->SetDisplayId(modelid); m_target->SetDisplayId(modelid);
if(PowerType != POWER_MANA) if (PowerType != POWER_MANA)
{ {
uint32 oldPower = m_target->GetPower(PowerType); uint32 oldPower = m_target->GetPower(PowerType);
// reset power to default values only at power change // reset power to default values only at power change
if(m_target->getPowerType() != PowerType) if(m_target->getPowerType() != PowerType)
m_target->setPowerType(PowerType); m_target->setPowerType(PowerType);
switch(form) switch (form)
{ {
case FORM_CAT: case FORM_CAT:
case FORM_BEAR: case FORM_BEAR:
@@ -3548,21 +3548,30 @@ void AuraEffect::HandleAuraModShapeshift(bool apply, bool Real, bool changeAmoun
{ {
// get furor proc chance // get furor proc chance
uint32 FurorChance = 0; uint32 FurorChance = 0;
if (AuraEffect const * dummy = m_target->GetDummyAura(SPELLFAMILY_DRUID, 238, 0)) if (AuraEffect const *dummy = m_target->GetDummyAura(SPELLFAMILY_DRUID, 238, 0))
FurorChance = dummy->GetAmount() > 0 ? uint32(dummy->GetAmount()) : 0; FurorChance = std::max(dummy->GetAmount(), 0);
if (GetMiscValue() == FORM_CAT) switch (GetMiscValue())
{
case FORM_CAT:
{ {
int32 basePoints = int32(std::min(oldPower, FurorChance)); int32 basePoints = int32(std::min(oldPower, FurorChance));
m_target->CastCustomSpell(m_target, 17099, &basePoints, NULL, NULL, true, NULL, this); m_target->CastCustomSpell(m_target, 17099, &basePoints, NULL, NULL, true, NULL, this);
} }
else 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); uint32 newEnergy = std::min(m_target->GetPower(POWER_ENERGY), FurorChance);
m_target->SetPower(POWER_ENERGY, newEnergy); m_target->SetPower(POWER_ENERGY, newEnergy);
} }
break; break;
} }
break;
}
default: default:
break; break;
} }
+1 -1
View File
@@ -6750,7 +6750,7 @@ void Spell::EffectPlayerPull(uint32 i)
if(!unitTarget) if(!unitTarget)
return; 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) void Spell::EffectDispelMechanic(uint32 i)