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

View File

@ -450,7 +450,7 @@ RULE_REAL (Combat,TauntSkillFalloff, 0.33)//For every taunt skill point that's n
RULE_BOOL (Combat,EXPFromDmgShield, false) //Determine if damage from a damage shield counts for EXP gain. RULE_BOOL (Combat,EXPFromDmgShield, false) //Determine if damage from a damage shield counts for EXP gain.
RULE_INT(Combat, MonkACBonusWeight, 15) RULE_INT(Combat, MonkACBonusWeight, 15)
RULE_INT(Combat, ClientStunLevel, 55) //This is the level where client kicks and bashes can stun the target RULE_INT(Combat, ClientStunLevel, 55) //This is the level where client kicks and bashes can stun the target
RULE_INT(Combat, QuiverWRHasteDiv, 3) //Weight Reduction is divided by this to get haste contribution for quivers RULE_INT(Combat, QuiverHasteCap, 1000) //Quiver haste cap 1000 on live for a while, currently 700 on live
RULE_BOOL(Combat, UseArcheryBonusRoll, false) //Make the 51+ archery bonus require an actual roll RULE_BOOL(Combat, UseArcheryBonusRoll, false) //Make the 51+ archery bonus require an actual roll
RULE_INT(Combat, ArcheryBonusChance, 50) RULE_INT(Combat, ArcheryBonusChance, 50)
RULE_INT(Combat, BerserkerFrenzyStart, 35) RULE_INT(Combat, BerserkerFrenzyStart, 35)

View File

@ -4649,28 +4649,31 @@ void Client::SetAttackTimer()
int hhe = itembonuses.HundredHands + spellbonuses.HundredHands; int hhe = itembonuses.HundredHands + spellbonuses.HundredHands;
int speed = 0; int speed = 0;
int delay = 36; int delay = 3600;
float quiver_haste = 0.0f;
//if we have no weapon.. //if we have no weapon..
if (ItemToUse == nullptr) { if (ItemToUse == nullptr) {
//above checks ensure ranged weapons do not fall into here //above checks ensure ranged weapons do not fall into here
// Work out if we're a monk // Work out if we're a monk
if (GetClass() == MONK || GetClass() == BEASTLORD) if (GetClass() == MONK || GetClass() == BEASTLORD)
delay = GetMonkHandToHandDelay(); delay = 100 * GetMonkHandToHandDelay();
} else { } else {
//we have a weapon, use its delay //we have a weapon, use its delay
delay = ItemToUse->Delay; delay = 100 * ItemToUse->Delay;
if (ItemToUse->ItemType == ItemTypeBow || ItemToUse->ItemType == ItemTypeLargeThrowing) }
quiver_haste = GetQuiverHaste();
speed = delay / haste_mod;
if (ItemToUse && ItemToUse->ItemType == ItemTypeBow) {
// Live actually had a bug here where they would return the non-modified attack speed
// rather than the cap ...
speed = std::max(speed - GetQuiverHaste(speed), RuleI(Combat, QuiverHasteCap));
} else {
if (RuleB(Spells, Jun182014HundredHandsRevamp))
speed = static_cast<int>(speed + ((hhe / 1000.0f) * speed));
else
speed = static_cast<int>(speed + ((hhe / 100.0f) * delay));
} }
if (RuleB(Spells, Jun182014HundredHandsRevamp))
speed = static_cast<int>(((delay / haste_mod) + ((hhe / 1000.0f) * (delay / haste_mod))) * 100);
else
speed = static_cast<int>(((delay / haste_mod) + ((hhe / 100.0f) * delay)) * 100);
// this is probably wrong
if (quiver_haste > 0)
speed *= quiver_haste;
TimerToUse->SetAtTrigger(std::max(RuleI(Combat, MinHastedDelay), speed), true, true); TimerToUse->SetAtTrigger(std::max(RuleI(Combat, MinHastedDelay), speed), true, true);
} }
} }

View File

@ -8356,21 +8356,19 @@ void Client::ShowNumHits()
return; 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++) { for (int r = EmuConstants::GENERAL_BEGIN; r <= EmuConstants::GENERAL_END; r++) {
const ItemInst *pi = GetInv().GetItem(r); pi = GetInv().GetItem(r);
if (!pi) if (pi && pi->IsType(ItemClassContainer) && pi->GetItem()->BagType == BagTypeQuiver &&
continue; pi->GetItem()->BagWR > 0)
if (pi->IsType(ItemClassContainer) && pi->GetItem()->BagType == BagTypeQuiver) { break;
float temp_wr = (pi->GetItem()->BagWR / RuleI(Combat, QuiverWRHasteDiv)); if (r == EmuConstants::GENERAL_END)
quiver_haste = std::max(temp_wr, quiver_haste); // we will get here if we don't find a valid quiver
} return 0;
} }
if (quiver_haste > 0) return (pi->GetItem()->BagWR * 0.0025f * delay) + 1;
quiver_haste = 1.0f / (1.0f + static_cast<float>(quiver_haste) / 100.0f);
return quiver_haste;
} }
void Client::SendColoredText(uint32 color, std::string message) void Client::SendColoredText(uint32 color, std::string message)

View File

@ -226,7 +226,7 @@ public:
virtual inline bool IsBerserk() { return berserk; } virtual inline bool IsBerserk() { return berserk; }
virtual int32 GetMeleeMitDmg(Mob *attacker, int32 damage, int32 minhit, float mit_rating, float atk_rating); virtual int32 GetMeleeMitDmg(Mob *attacker, int32 damage, int32 minhit, float mit_rating, float atk_rating);
virtual void SetAttackTimer(); virtual void SetAttackTimer();
float GetQuiverHaste(); int GetQuiverHaste(int delay);
void DoAttackRounds(Mob *target, int hand, bool IsFromSpell = false); void DoAttackRounds(Mob *target, int hand, bool IsFromSpell = false);
void AI_Init(); void AI_Init();