*Fix the bug that Steady Shot make too much(over million) damage with these items: 42946, 44093.

--HG--
branch : trunk
This commit is contained in:
Anubisss
2009-08-26 17:56:35 +02:00
parent 0b7a89e3b0
commit cda2fc2ecb

View File

@@ -588,7 +588,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
}
}
//TODO: should this be put on taken but not done?
// TODO: should this be put on taken but not done?
if(found)
damage += m_spellInfo->EffectBasePoints[1];
@@ -598,7 +598,12 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
Item *item = ((Player*)m_caster)->GetWeaponForAttack(RANGED_ATTACK);
if(item)
{
damage += urand(uint32(item->GetProto()->Damage->DamageMin), uint32(item->GetProto()->Damage->DamageMax));
float dmg_min = item->GetProto()->Damage->DamageMin;
float dmg_max = item->GetProto()->Damage->DamageMax;
if(dmg_max == 0.0f && dmg_min > dmg_max)
damage += uint32(dmg_min);
else
damage += urand(uint32(dmg_min), uint32(dmg_max));
damage += ((Player*)m_caster)->GetAmmoDPS()*item->GetProto()->Delay/1000;
}
}