Fixed crippling blow issues with berserker frenzy

Also added two rules to control when to enter/exit berserker frenzy
This commit is contained in:
Michael Cook 2013-12-11 01:49:51 -05:00
parent cd2825288d
commit 76ec6e4da2
6 changed files with 24 additions and 24 deletions

View File

@ -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

View File

@ -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 )

View File

@ -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));
}
}

View File

@ -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);

View File

@ -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;
}
}

View File

@ -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();