From 1b7841f683c58a0c816cc6d4bfe9214d29f0b0e2 Mon Sep 17 00:00:00 2001 From: Uleat Date: Tue, 26 Jan 2016 15:08:41 -0500 Subject: [PATCH] Fix for Berserker 'Piercing' skill issues --- changelog.txt | 3 +++ common/eq_constants.h | 8 ++++---- common/patches/rof2_constants.h | 2 ++ common/patches/rof_constants.h | 2 ++ common/patches/sod_constants.h | 2 ++ common/patches/sof_constants.h | 2 ++ common/patches/titanium_constants.h | 2 ++ common/patches/uf_constants.h | 2 ++ common/skills.cpp | 2 +- common/skills.h | 4 ++-- world/client.cpp | 5 +++++ zone/attack.cpp | 22 ++++++++++------------ zone/bot.cpp | 6 +++--- zone/client.cpp | 15 ++++++++++++--- zone/client_process.cpp | 5 +++++ zone/common.h | 2 +- zone/mob.cpp | 7 ++++++- zone/special_attacks.cpp | 4 ++-- 18 files changed, 66 insertions(+), 29 deletions(-) diff --git a/changelog.txt b/changelog.txt index 6bc29becc..c758d165c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 01/26/2016 == +Uleat: Fix for Berserker 'Piercing' skill issues. Server Admins: If you run custom skill sets, this patch touches the code segments that you will need to modify if you have changed the default berserker 1H-/2H-piercing skill values. + == 01/13/2016 == Kinglykrab: Modified #flag so you can refresh your target's account status (GM status level) without them having to relog. - Just target the person whose flag you want to refresh and type #flag. diff --git a/common/eq_constants.h b/common/eq_constants.h index 0fec1f223..add66c2f4 100644 --- a/common/eq_constants.h +++ b/common/eq_constants.h @@ -799,10 +799,10 @@ static const uint8 SkillDamageTypes[HIGHEST_SKILL + 1] = // change to _SkillServ /*Intimidation*/ DamageTypeUnknown, /*Berserking*/ DamageTypeUnknown, /*Taunt*/ DamageTypeUnknown, -/*Frenzy*/ 74 //, -// /*RemoveTrap*/ DamageTypeUnknown, // Needs research (set for SenseTrap value) -// /*TripleAttack*/ DamageTypeUnknown, // Needs research (set for DoubleAttack value) -// /*2HPiercing*/ 36 // Needs research (set for 1HPiercing value - similar to slash/blunt) +/*Frenzy*/ 74, +/*RemoveTrap*/ DamageTypeUnknown, // Needs research (set for SenseTrap value) +/*TripleAttack*/ DamageTypeUnknown, // Needs research (set for DoubleAttack value) +/*2HPiercing*/ 36 // Needs research (set for 1HPiercing value - similar to slash/blunt) }; /* diff --git a/common/patches/rof2_constants.h b/common/patches/rof2_constants.h index 4c8245737..0732044ca 100644 --- a/common/patches/rof2_constants.h +++ b/common/patches/rof2_constants.h @@ -186,6 +186,8 @@ namespace RoF2 { static const size_t POTION_BELT_ITEM_COUNT = 5; static const size_t TEXT_LINK_BODY_LENGTH = 56; + + static const size_t PLAYER_PROFILE_SKILL_MAX = Skill2HPiercing; } namespace limits { diff --git a/common/patches/rof_constants.h b/common/patches/rof_constants.h index 8b5fadbf2..b348f5fd5 100644 --- a/common/patches/rof_constants.h +++ b/common/patches/rof_constants.h @@ -185,6 +185,8 @@ namespace RoF { static const size_t POTION_BELT_ITEM_COUNT = 5; static const size_t TEXT_LINK_BODY_LENGTH = 55; + + static const size_t PLAYER_PROFILE_SKILL_MAX = SkillTripleAttack; } namespace limits { diff --git a/common/patches/sod_constants.h b/common/patches/sod_constants.h index 5dad9bb09..ebd1d7d48 100644 --- a/common/patches/sod_constants.h +++ b/common/patches/sod_constants.h @@ -182,6 +182,8 @@ namespace SoD { static const size_t POTION_BELT_ITEM_COUNT = 5; static const size_t TEXT_LINK_BODY_LENGTH = 50; + + static const size_t PLAYER_PROFILE_SKILL_MAX = SkillTripleAttack; } namespace limits { diff --git a/common/patches/sof_constants.h b/common/patches/sof_constants.h index 260722f00..4ffcdd525 100644 --- a/common/patches/sof_constants.h +++ b/common/patches/sof_constants.h @@ -182,6 +182,8 @@ namespace SoF { static const size_t POTION_BELT_ITEM_COUNT = 5; static const size_t TEXT_LINK_BODY_LENGTH = 50; + + static const size_t PLAYER_PROFILE_SKILL_MAX = SkillTripleAttack; } namespace limits { diff --git a/common/patches/titanium_constants.h b/common/patches/titanium_constants.h index d7e2a4964..4915c829c 100644 --- a/common/patches/titanium_constants.h +++ b/common/patches/titanium_constants.h @@ -181,6 +181,8 @@ namespace Titanium { static const size_t POTION_BELT_ITEM_COUNT = 4; static const size_t TEXT_LINK_BODY_LENGTH = 45; + + static const size_t PLAYER_PROFILE_SKILL_MAX = SkillFrenzy; } namespace limits { diff --git a/common/patches/uf_constants.h b/common/patches/uf_constants.h index 1a5a4cc44..b8096fd58 100644 --- a/common/patches/uf_constants.h +++ b/common/patches/uf_constants.h @@ -182,6 +182,8 @@ namespace UF { static const size_t POTION_BELT_ITEM_COUNT = 5; static const size_t TEXT_LINK_BODY_LENGTH = 50; + + static const size_t PLAYER_PROFILE_SKILL_MAX = SkillTripleAttack; } namespace limits { diff --git a/common/skills.cpp b/common/skills.cpp index 5edca778b..85c660f6c 100644 --- a/common/skills.cpp +++ b/common/skills.cpp @@ -71,7 +71,7 @@ float EQEmu::GetSkillMeleePushForce(SkillUseTypes skill) case SkillEagleStrike: case SkillKick: case SkillTigerClaw: - //case Skill2HPiercing: + case Skill2HPiercing: return 0.2f; case SkillArchery: return 0.15f; diff --git a/common/skills.h b/common/skills.h index c79a522ee..4e1e9eb83 100644 --- a/common/skills.h +++ b/common/skills.h @@ -114,7 +114,7 @@ enum SkillUseTypes /*13049*/ SkillTripleAttack, // RoF2+ specific skills -// /*00789*/ Skill2HPiercing, +/*00789*/ Skill2HPiercing, // /*01216*/ SkillNone, // This needs to move down as new skills are added /*00000*/ _EmuSkillCount // move to last position of active enumeration labels @@ -171,7 +171,7 @@ enum SkillUseTypes }; // temporary until it can be sorted out... -#define HIGHEST_SKILL SkillTripleAttack +#define HIGHEST_SKILL Skill2HPiercing // Spell Effects use this value to determine if an effect applies to all skills. #define ALL_SKILLS -1 diff --git a/world/client.cpp b/world/client.cpp index 9a194e5ec..dc17d7b4d 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -1814,6 +1814,11 @@ void Client::SetClassStartingSkills(PlayerProfile_Struct *pp) pp->skills[i] = database.GetSkillCap(pp->class_, (SkillUseTypes)i, 1); } } + + if (cle->GetClientVersion() < static_cast(ClientVersion::RoF2) && pp->class_ == BERSERKER) { + pp->skills[Skill1HPiercing] = pp->skills[Skill2HPiercing]; + pp->skills[Skill2HPiercing] = 0; + } } void Client::SetRaceStartingSkills( PlayerProfile_Struct *pp ) diff --git a/zone/attack.cpp b/zone/attack.cpp index 85ee29e9d..2fdf5f115 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -76,7 +76,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w case ItemType1HPiercing: // Piercing { skillinuse = Skill1HPiercing; - type = animPiercing; + type = anim1HPiercing; break; } case ItemType1HBlunt: // 1H Blunt @@ -93,7 +93,10 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w } case ItemType2HPiercing: // 2H Piercing { - skillinuse = Skill1HPiercing; // change to Skill2HPiercing once activated + if (IsClient() && CastToClient()->GetClientVersion() < ClientVersion::RoF2) + skillinuse = Skill1HPiercing; + else + skillinuse = Skill2HPiercing; type = anim2HWeapon; break; } @@ -127,7 +130,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w } case Skill1HPiercing: // Piercing { - type = animPiercing; + type = anim1HPiercing; break; } case Skill1HBlunt: // 1H Blunt @@ -140,7 +143,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w type = anim2HSlashing; //anim2HWeapon break; } - case 99: // 2H Piercing // change to Skill2HPiercing once activated + case Skill2HPiercing: // 2H Piercing { type = anim2HWeapon; break; @@ -1652,10 +1655,10 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool skillinuse = Skill2HSlashing; break; case ItemType1HPiercing: - //skillinuse = Skill1HPiercing; - //break; + skillinuse = Skill1HPiercing; + break; case ItemType2HPiercing: - skillinuse = Skill1HPiercing; // change to Skill2HPiercing once activated + skillinuse = Skill2HPiercing; break; case ItemType1HBlunt: skillinuse = Skill1HBlunt; @@ -1683,11 +1686,6 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool ItemInst weapon_inst(weapon, charges); AttackAnimation(skillinuse, Hand, &weapon_inst); - // Remove this once Skill2HPiercing is activated - //Work-around for there being no 2HP skill - We use 99 for the 2HB animation and 36 for pierce messages - if(skillinuse == 99) - skillinuse = static_cast(36); - //basically "if not immune" then do the attack if((weapon_damage) > 0) { diff --git a/zone/bot.cpp b/zone/bot.cpp index 01aafa4aa..926df4fb0 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -1179,7 +1179,7 @@ uint16 Bot::GetPrimarySkillValue() { break; } case ItemType2HPiercing: { - skill = Skill1HPiercing; // change to Skill2HPiercing once activated + skill = Skill2HPiercing; break; } case ItemTypeMartial: { @@ -6493,7 +6493,7 @@ void Bot::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) { ndamage = -5; DoSpecialAttackDamage(other, SkillBackstab, ndamage, min_hit, hate, ReuseTime); - DoAnim(animPiercing); + DoAnim(anim1HPiercing); } void Bot::RogueAssassinate(Mob* other) { @@ -6505,7 +6505,7 @@ void Bot::RogueAssassinate(Mob* other) { other->Damage(this, -5, SPELL_UNKNOWN, SkillBackstab); } - DoAnim(animPiercing); + DoAnim(anim1HPiercing); } void Bot::DoClassAttacks(Mob *target, bool IsRiposte) { diff --git a/zone/client.cpp b/zone/client.cpp index 3fab7671e..c8c1494e5 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -2343,11 +2343,17 @@ bool Client::HasSkill(SkillUseTypes skill_id) const { } bool Client::CanHaveSkill(SkillUseTypes skill_id) const { + if (GetClientVersion() < ClientVersion::RoF2 && class_ == BERSERKER && skill_id == Skill1HPiercing) + skill_id = Skill2HPiercing; + return(database.GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)) > 0); //if you don't have it by max level, then odds are you never will? } uint16 Client::MaxSkill(SkillUseTypes skillid, uint16 class_, uint16 level) const { + if (GetClientVersion() < ClientVersion::RoF2 && class_ == BERSERKER && skillid == Skill1HPiercing) + skillid = Skill2HPiercing; + return(database.GetSkillCap(class_, skillid, level)); } @@ -4211,7 +4217,10 @@ uint16 Client::GetPrimarySkillValue() } case ItemType2HPiercing: // 2H Piercing { - skill = Skill1HPiercing; // change to Skill2HPiercing once activated + if (IsClient() && CastToClient()->GetClientVersion() < ClientVersion::RoF2) + skill = Skill1HPiercing; + else + skill = Skill2HPiercing; break; } case ItemTypeMartial: // Hand to Hand @@ -4950,11 +4959,11 @@ void Client::ShowSkillsWindow() const char* SkillName[] = {"1H Blunt","1H Slashing","2H Blunt","2H Slashing","Abjuration","Alteration","Apply Poison","Archery", "Backstab","Bind Wound","Bash","Block","Brass Instruments","Channeling","Conjuration","Defense","Disarm","Disarm Traps","Divination", "Dodge","Double Attack","Dragon Punch","Dual Wield","Eagle Strike","Evocation","Feign Death","Flying Kick","Forage","Hand to Hand", - "Hide","Kick","Meditate","Mend","Offense","Parry","Pick Lock","Piercing","Ripost","Round Kick","Safe Fall","Sense Heading", + "Hide","Kick","Meditate","Mend","Offense","Parry","Pick Lock","1H Piercing","Ripost","Round Kick","Safe Fall","Sense Heading", "Singing","Sneak","Specialize Abjuration","Specialize Alteration","Specialize Conjuration","Specialize Divination","Specialize Evocation","Pick Pockets", "Stringed Instruments","Swimming","Throwing","Tiger Claw","Tracking","Wind Instruments","Fishing","Make Poison","Tinkering","Research", "Alchemy","Baking","Tailoring","Sense Traps","Blacksmithing","Fletching","Brewing","Alcohol Tolerance","Begging","Jewelry Making", - "Pottery","Percussion Instruments","Intimidation","Berserking","Taunt","Frenzy","Remove Traps","Triple Attack"}; + "Pottery","Percussion Instruments","Intimidation","Berserking","Taunt","Frenzy","Remove Traps","Triple Attack","2H Piercing"}; for(int i = 0; i <= (int)HIGHEST_SKILL; i++) Skills[SkillName[i]] = (SkillUseTypes)i; diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 3b973e7b7..3154a9ca9 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -1553,6 +1553,11 @@ void Client::OPGMTraining(const EQApplicationPacket *app) //Set it to 1 with CanHaveSkill or you wont be able to train past 1. } } + + if (GetClientVersion() < ClientVersion::RoF2 && GetClass() == BERSERKER) { + gmtrain->skills[Skill1HPiercing] = gmtrain->skills[Skill2HPiercing]; + gmtrain->skills[Skill2HPiercing] = 0; + } //#pragma GCC pop_options uchar ending[]={0x34,0x87,0x8a,0x3F,0x01 diff --git a/zone/common.h b/zone/common.h index 48749dbc3..bcae779a9 100644 --- a/zone/common.h +++ b/zone/common.h @@ -511,7 +511,7 @@ typedef struct //make DoAnim take it instead of int, to enforce its use. enum { //type arguments to DoAnim animKick = 1, - animPiercing = 2, //might be piercing? + anim1HPiercing = 2, //might be piercing? anim2HSlashing = 3, anim2HWeapon = 4, anim1HWeapon = 5, diff --git a/zone/mob.cpp b/zone/mob.cpp index 2ac1c7f5e..3dad9b247 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -5029,7 +5029,10 @@ uint16 Mob::GetSkillByItemType(int ItemType) case ItemType2HBlunt: return Skill2HBlunt; case ItemType2HPiercing: - return Skill1HPiercing; // change to 2HPiercing once activated + if (IsClient() && CastToClient()->GetClientVersion() < ClientVersion::RoF2) + return Skill1HPiercing; + else + return Skill2HPiercing; case ItemTypeBow: return SkillArchery; case ItemTypeLargeThrowing: @@ -5057,6 +5060,8 @@ uint8 Mob::GetItemTypeBySkill(SkillUseTypes skill) return ItemType2HSlash; case Skill1HPiercing: return ItemType1HPiercing; + case Skill2HPiercing: // watch for undesired client behavior + return ItemType2HPiercing; case Skill1HBlunt: return ItemType1HBlunt; case Skill2HBlunt: diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index c43c8f432..2c763df13 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -660,7 +660,7 @@ void Mob::RogueBackstab(Mob* other, bool min_damage, int ReuseTime) } DoSpecialAttackDamage(other, SkillBackstab, ndamage, min_hit, hate, ReuseTime, false, false); - DoAnim(animPiercing); + DoAnim(anim1HPiercing); } // assassinate [No longer used for regular assassinate 6-29-14] @@ -673,7 +673,7 @@ void Mob::RogueAssassinate(Mob* other) }else{ other->Damage(this, -5, SPELL_UNKNOWN, SkillBackstab); } - DoAnim(animPiercing); //piercing animation + DoAnim(anim1HPiercing); //piercing animation } void Client::RangedAttack(Mob* other, bool CanDoubleAttack) {