From 26985496d1177d69c0141029ac017644f87aa033 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Thu, 8 Dec 2016 22:36:47 -0500 Subject: [PATCH] Fix Shield Specialist related SPAs --- common/spdat.h | 4 ++-- zone/attack.cpp | 10 +++++----- zone/bonuses.cpp | 28 +++++----------------------- zone/common.h | 3 +-- zone/mob.cpp | 3 --- zone/spell_effects.cpp | 2 +- 6 files changed, 14 insertions(+), 36 deletions(-) diff --git a/common/spdat.h b/common/spdat.h index ab00451e0..6ca588f04 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -502,7 +502,7 @@ typedef enum { #define SE_HeadShotLevel 346 // implemented[AA] - HeadShot max level to kill #define SE_DoubleRangedAttack 347 // implemented - chance at an additional archery attack (consumes arrow) #define SE_LimitManaMin 348 // implemented -#define SE_ShieldEquipHateMod 349 // implemented[AA] Increase melee hate when wearing a shield. +#define SE_ShieldEquipDmgMod 349 // implemented[AA] Increase melee base damage (indirectly increasing hate) when wearing a shield. #define SE_ManaBurn 350 // implemented - Drains mana for damage/heal at a defined ratio up to a defined maximum amount of mana. //#define SE_PersistentEffect 351 // *not implemented. creates a trap/totem that casts a spell (spell id + base1?) when anything comes near it. can probably make a beacon for this //#define SE_IncreaseTrapCount 352 // *not implemented - looks to be some type of invulnerability? Test ITC (8755) @@ -519,7 +519,7 @@ typedef enum { #define SE_BandolierSlots 363 // *not implemented[AA] 'Battle Ready' expands the bandolier by one additional save slot per rank. #define SE_TripleAttackChance 364 // implemented #define SE_ProcOnSpellKillShot 365 // implemented - chance to trigger a spell on kill when the kill is caused by a specific spell with this effect in it (10470 Venin) -#define SE_ShieldEquipDmgMod 366 // implemented[AA] Damage modifier to melee if shield equiped. (base1 = dmg mod , base2 = ?) ie Shield Specialist AA +#define SE_GroupShielding 366 // *not implemented[AA] This gives you /shieldgroup #define SE_SetBodyType 367 // implemented - set body type of base1 so it can be affected by spells that are limited to that type (Plant, Animal, Undead, etc) //#define SE_FactionMod 368 // *not implemented - increases faction with base1 (faction id, live won't match up w/ ours) by base2 #define SE_CorruptionCounter 369 // implemented diff --git a/zone/attack.cpp b/zone/attack.cpp index 475aee7b3..40de941dc 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1072,6 +1072,11 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b //if weapon damage > 0 then we know we can hit the target with this weapon //otherwise we cannot and we set the damage to -5 later on if(weapon_damage > 0){ + auto shield_inc = spellbonuses.ShieldEquipDmgMod + itembonuses.ShieldEquipDmgMod + aabonuses.ShieldEquipDmgMod; + if (shield_inc > 0 && HasShieldEquiped() && Hand == EQEmu::inventory::slotPrimary) { + weapon_damage = weapon_damage * (100 + shield_inc) / 100; + hate = hate * (100 + shield_inc) / 100; + } //Berserker Berserk damage bonus if(IsBerserk() && GetClass() == BERSERKER){ @@ -2291,11 +2296,6 @@ void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, b // Spell Casting Subtlety etc int hatemod = 100 + other->spellbonuses.hatemod + other->itembonuses.hatemod + other->aabonuses.hatemod; - int32 shieldhatemod = other->spellbonuses.ShieldEquipHateMod + other->itembonuses.ShieldEquipHateMod + other->aabonuses.ShieldEquipHateMod; - - if (shieldhatemod && other->HasShieldEquiped()) - hatemod += shieldhatemod; - if(hatemod < 1) hatemod = 1; hate = ((hate * (hatemod))/100); diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 760ca52dc..beae3995d 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -940,12 +940,8 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) case SE_ShieldBlock: newbon->ShieldBlock += base1; break; - case SE_ShieldEquipHateMod: - newbon->ShieldEquipHateMod += base1; - break; case SE_ShieldEquipDmgMod: - newbon->ShieldEquipDmgMod[0] += base1; - newbon->ShieldEquipDmgMod[1] += base2; + newbon->ShieldEquipDmgMod += base1; break; case SE_SecondaryDmgInc: newbon->SecondaryDmgInc = true; @@ -2655,13 +2651,8 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne new_bonus->ShieldBlock += effect_value; break; - case SE_ShieldEquipHateMod: - new_bonus->ShieldEquipHateMod += effect_value; - break; - case SE_ShieldEquipDmgMod: - new_bonus->ShieldEquipDmgMod[0] += effect_value; - new_bonus->ShieldEquipDmgMod[1] += base2; + new_bonus->ShieldEquipDmgMod += effect_value; break; case SE_BlockBehind: @@ -4555,19 +4546,10 @@ void Mob::NegateSpellsBonuses(uint16 spell_id) itembonuses.DoubleRangedAttack = effect_value; break; - case SE_ShieldEquipHateMod: - spellbonuses.ShieldEquipHateMod = effect_value; - aabonuses.ShieldEquipHateMod = effect_value; - itembonuses.ShieldEquipHateMod = effect_value; - break; - case SE_ShieldEquipDmgMod: - spellbonuses.ShieldEquipDmgMod[0] = effect_value; - spellbonuses.ShieldEquipDmgMod[1] = effect_value; - aabonuses.ShieldEquipDmgMod[0] = effect_value; - aabonuses.ShieldEquipDmgMod[1] = effect_value; - itembonuses.ShieldEquipDmgMod[0] = effect_value; - itembonuses.ShieldEquipDmgMod[1] = effect_value; + spellbonuses.ShieldEquipDmgMod = effect_value; + aabonuses.ShieldEquipDmgMod = effect_value; + itembonuses.ShieldEquipDmgMod = effect_value; break; case SE_TriggerMeleeThreshold: diff --git a/zone/common.h b/zone/common.h index fd4ea0a89..e621c336b 100644 --- a/zone/common.h +++ b/zone/common.h @@ -457,8 +457,7 @@ struct StatBonuses { int32 ItemATKCap; // Raise item attack cap int32 FinishingBlow[2]; // Chance to do a finishing blow for specified damage amount. uint32 FinishingBlowLvl[2]; // Sets max level an NPC can be affected by FB. (base1 = lv, base2= ???) - int32 ShieldEquipHateMod; // Hate mod when shield equiped. - int32 ShieldEquipDmgMod[2]; // Damage mod when shield equiped. 0 = damage modifier 1 = Unknown + int32 ShieldEquipDmgMod; // Increases weapon's base damage by base1 % when shield is equipped (indirectly increasing hate) bool TriggerOnValueAmount; // Triggers off various different conditions, bool to check if client has effect. int8 StunBashChance; // chance to stun with bash. int8 IncreaseChanceMemwipe; // increases chance to memory wipe diff --git a/zone/mob.cpp b/zone/mob.cpp index a39dcfa99..c47788ee5 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -4668,9 +4668,6 @@ int16 Mob::GetMeleeDamageMod_SE(uint16 skill) dmg_mod += itembonuses.DamageModifier2[EQEmu::skills::HIGHEST_SKILL + 1] + spellbonuses.DamageModifier2[EQEmu::skills::HIGHEST_SKILL + 1] + aabonuses.DamageModifier2[EQEmu::skills::HIGHEST_SKILL + 1] + itembonuses.DamageModifier2[skill] + spellbonuses.DamageModifier2[skill] + aabonuses.DamageModifier2[skill]; - if (HasShieldEquiped() && !IsOffHandAtk()) - dmg_mod += itembonuses.ShieldEquipDmgMod[0] + spellbonuses.ShieldEquipDmgMod[0] + aabonuses.ShieldEquipDmgMod[0]; - if(dmg_mod < -100) dmg_mod = -100; diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index a2a66f9ae..43833328c 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -2982,8 +2982,8 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_FcHealAmtIncoming: case SE_LimitManaMax: case SE_DoubleRangedAttack: - case SE_ShieldEquipHateMod: case SE_ShieldEquipDmgMod: + case SE_GroupShielding: case SE_TriggerOnReqTarget: case SE_LimitRace: case SE_FcLimitUse: