diff --git a/changelog.txt b/changelog.txt index 6a6382e5f..ca2e11a1f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 12/11/2013 == +demonstar55: Fixed issue with crippling blow from berserker frenzy not actually doing anything + == 12/04/2013 == demonstar55: Fixed SpellType_Charm case in AICastSpell diff --git a/common/ruletypes.h b/common/ruletypes.h index bc10cbf9b..26083a583 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -371,6 +371,8 @@ RULE_INT ( Combat, ClientStunLevel, 55) //This is the level where client kicks a RULE_INT ( Combat, QuiverWRHasteDiv, 3) //Weight Reduction is divided by this to get haste contribution for quivers RULE_BOOL ( Combat, UseArcheryBonusRoll, false) //Make the 51+ archery bonus require an actual roll RULE_INT ( Combat, ArcheryBonusChance, 50) +RULE_INT ( Combat, BerserkerFrenzyStart, 35) +RULE_INT ( Combat, BerserkerFrenzyEnd, 45) RULE_CATEGORY_END() RULE_CATEGORY( NPC ) diff --git a/zone/attack.cpp b/zone/attack.cpp index 7cf35e2a2..4623661b5 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1173,7 +1173,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(weapon_damage > 0){ //Berserker Berserk damage bonus - if(berserk && GetClass() == BERSERKER){ + if(IsBerserk() && GetClass() == BERSERKER){ int bonus = 3 + GetLevel()/10; //unverified weapon_damage = weapon_damage * (100+bonus) / 100; mlog(COMBAT__DAMAGE, "Berserker damage bonus increases DMG to %d", weapon_damage); @@ -4102,19 +4102,15 @@ void Mob::TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttack //Warning: Do not define these rules if you want live like critical hits. critChance += RuleI(Combat, MeleeBaseCritChance); - if(IsClient()) + if (IsClient()) { critChance += RuleI(Combat, ClientBaseCritChance); - bool IsBerserk = false; - if(((GetClass() == WARRIOR || GetClass() == BERSERKER) && GetLevel() >= 12 && IsClient())) - { - if(CastToClient()->berserk){ - critChance += RuleI(Combat, BerserkBaseCritChance); - IsBerserk = true; + if ((GetClass() == WARRIOR || GetClass() == BERSERKER) && GetLevel() >= 12) { + if (IsBerserk()) + critChance += RuleI(Combat, BerserkBaseCritChance); + else + critChance += RuleI(Combat, WarBerBaseCritChance); } - - else - critChance += RuleI(Combat, WarBerBaseCritChance); } if(skill == SkillArchery && GetClass() == RANGER && GetSkill(SkillArchery) >= 65) @@ -4154,10 +4150,11 @@ void Mob::TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttack //Crippling Blow Chance: The percent value of the effect is applied //to the your Chance to Critical. (ie You have 10% chance to critical and you //have a 200% Chance to Critical Blow effect, therefore you have a 20% Chance to Critical Blow. - if (CripplingBlowChance){ - critChance *= float(CripplingBlowChance)/100.0f; + if (CripplingBlowChance || IsBerserk()) { + if (!IsBerserk()) + critChance *= float(CripplingBlowChance)/100.0f; - if(MakeRandomFloat(0, 1) < critChance){ + if (IsBerserk() || MakeRandomFloat(0, 1) < critChance) { critMod = 400; crip_success = true; } @@ -4166,8 +4163,7 @@ void Mob::TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttack critMod += GetCritDmgMob(skill) * 2; // To account for base crit mod being 200 not 100 damage = damage * critMod / 100; - if(IsBerserk || crip_success) - { + if (crip_success) { entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, CRIPPLING_BLOW, GetCleanName(), itoa(damage)); // Crippling blows also have a chance to stun //Kayen: Crippling Blow would cause a chance to interrupt for npcs < 55, with a staggers message. @@ -4175,10 +4171,7 @@ void Mob::TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttack defender->Emote("staggers."); defender->Stun(0); } - } - - else - { + } else { entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, CRITICAL_HIT, GetCleanName(), itoa(damage)); } } diff --git a/zone/client.h b/zone/client.h index 0209d422a..8e4a38c16 100644 --- a/zone/client.h +++ b/zone/client.h @@ -220,6 +220,7 @@ public: virtual bool HasGroup() { return (GetGroup() ? true : false); } virtual Raid* GetRaid() { return entity_list.GetRaidByClient(this); } virtual Group* GetGroup() { return entity_list.GetGroupByClient(this); } + virtual inline bool IsBerserk() { return berserk; } void AI_Init(); void AI_Start(uint32 iMoveDelay = 0); diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 8bb3fd67c..9158f3bf2 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -464,13 +464,13 @@ bool Client::Process() { } if (GetClass() == WARRIOR || GetClass() == BERSERKER) { - if(!dead && !berserk && this->GetHPRatio() < 30) { + if (!dead && !IsBerserk() && GetHPRatio() < RuleI(Combat, BerserkerFrenzyStart)) { entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_START, GetName()); - this->berserk = true; + berserk = true; } - if (berserk && this->GetHPRatio() > 30) { + if (IsBerserk() && GetHPRatio() > RuleI(Combat, BerserkerFrenzyEnd)) { entity_list.MessageClose_StringID(this, false, 200, 0, BERSERK_END, GetName()); - this->berserk = false; + berserk = false; } } diff --git a/zone/mob.h b/zone/mob.h index 962bef3c8..2d58f0d79 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -126,6 +126,7 @@ public: void ApplyMeleeDamageBonus(uint16 skill, int32 &damage); virtual void MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttackOptions *opts = nullptr); bool CombatRange(Mob* other); + virtual inline bool IsBerserk() { return false; } // only clients //Appearance void SendLevelAppearance();