Rework quiver haste

This commit is contained in:
Michael Cook (mackal)
2016-01-03 01:58:37 -05:00
parent 28848fa913
commit 05de206ace
4 changed files with 28 additions and 27 deletions
+10 -12
View File
@@ -8356,21 +8356,19 @@ void Client::ShowNumHits()
return;
}
float Client::GetQuiverHaste()
int Client::GetQuiverHaste(int delay)
{
float quiver_haste = 0;
const ItemInst *pi = nullptr;
for (int r = EmuConstants::GENERAL_BEGIN; r <= EmuConstants::GENERAL_END; r++) {
const ItemInst *pi = GetInv().GetItem(r);
if (!pi)
continue;
if (pi->IsType(ItemClassContainer) && pi->GetItem()->BagType == BagTypeQuiver) {
float temp_wr = (pi->GetItem()->BagWR / RuleI(Combat, QuiverWRHasteDiv));
quiver_haste = std::max(temp_wr, quiver_haste);
}
pi = GetInv().GetItem(r);
if (pi && pi->IsType(ItemClassContainer) && pi->GetItem()->BagType == BagTypeQuiver &&
pi->GetItem()->BagWR > 0)
break;
if (r == EmuConstants::GENERAL_END)
// we will get here if we don't find a valid quiver
return 0;
}
if (quiver_haste > 0)
quiver_haste = 1.0f / (1.0f + static_cast<float>(quiver_haste) / 100.0f);
return quiver_haste;
return (pi->GetItem()->BagWR * 0.0025f * delay) + 1;
}
void Client::SendColoredText(uint32 color, std::string message)