diff --git a/common/spdat.h b/common/spdat.h index 30def8598..f076c7ae2 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -809,13 +809,13 @@ typedef enum { #define SE_PC_Pet_Rampage 464 // implemented - Base1 % chance to do rampage for base2 % of damage each melee round //#define SE_PC_Pet_AE_Rampage 465 // Would assume as above but need to confirm. #define SE_PC_Pet_Flurry_Chance 466 // implemented - Base1 % chance to do flurry from double attack hit. -//#define SE_DS_Mitigation_Amount 467 // -//#define SE_DS_Mitigation_Percentage 468 // +#define SE_DS_Mitigation_Amount 467 // +#define SE_DS_Mitigation_Percentage 468 // //#define SE_Chance_Best_in_Spell_Grp 469 // //#define SE_Trigger_Best_in_Spell Grp 470 // //#define SE_Double_Melee_Round 471 // //#define SE_Buy_AA_Rank 472 // -//#define SE_Double_Backstab_Front 473 // +#define SE_Double_Backstab_Front 473 // //#define SE_Pet_Crit_Melee_Damage_Pct_Owner 474 // //#define SE_Trigger_Spell_Non_Item 475 // //#define SE_Weapon_Stance 476 // diff --git a/zone/attack.cpp b/zone/attack.cpp index cd0f6104f..13f614020 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -2902,6 +2902,10 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) { DS += aabonuses.DamageShield; //Live AA - coat of thistles. (negative value) DS -= itembonuses.DamageShield; //+Damage Shield should only work when you already have a DS spell + DS -= attacker->aabonuses.DS_Mitigation_Amount + attacker->itembonuses.DS_Mitigation_Amount + attacker->spellbonuses.DS_Mitigation_Amount; //Negative value to reduce + //Do not allow flat amount reductions to reduce past 0. + if (DS >= 0) + return; //Spell data for damage shield mitigation shows a negative value for spells for clients and positive //value for spells that effect pets. Unclear as to why. For now will convert all positive to be consistent. @@ -2911,7 +2915,11 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) { attacker->aabonuses.DSMitigationOffHand; DS -= DS*mitigation / 100; } - DS -= DS * attacker->itembonuses.DSMitigation / 100; + + int mitigation_pct = attacker->aabonuses.DS_Mitigation_Percentage + attacker->itembonuses.DS_Mitigation_Percentage + attacker->spellbonuses.DS_Mitigation_Percentage; //Negative value to reduce + + // Subtract mitigations b/c mitigation_pct is a negative value when reducing total DS + DS -= DS * ((attacker->itembonuses.DSMitigation - mitigation_pct) / 100); } attacker->Damage(this, -DS, spellid, EQ::skills::SkillAbjuration/*hackish*/, false); //we can assume there is a spell now diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index b0bdeb843..bc8075275 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -978,6 +978,9 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) case SE_FrontalBackstabChance: newbon->FrontalBackstabChance += base1; break; + case SE_Double_Backstab_Front: + newbon->Double_Backstab_Front += base1; + break; case SE_BlockBehind: newbon->BlockBehind += base1; break; @@ -1535,6 +1538,14 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) break; } + case SE_DS_Mitigation_Amount: + newbon->DS_Mitigation_Amount += base1; + break; + + case SE_DS_Mitigation_Percentage: + newbon->DS_Mitigation_Percentage += base1; + break; + // to do case SE_PetDiscipline: @@ -2833,6 +2844,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne new_bonus->FrontalBackstabChance += effect_value; break; + case SE_Double_Backstab_Front: + new_bonus->Double_Backstab_Front += effect_value; + break; + case SE_ConsumeProjectile: new_bonus->ConsumeProjectile += effect_value; break; @@ -3363,6 +3378,14 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne break; } + case SE_DS_Mitigation_Amount: + new_bonus->DS_Mitigation_Amount += effect_value; + break; + + case SE_DS_Mitigation_Percentage: + new_bonus->DS_Mitigation_Percentage += effect_value; + break; + //Special custom cases for loading effects on to NPC from 'npc_spels_effects' table @@ -4557,6 +4580,12 @@ void Mob::NegateSpellsBonuses(uint16 spell_id) itembonuses.FrontalBackstabChance = effect_value; break; + case SE_Double_Backstab_Front: + spellbonuses.Double_Backstab_Front = effect_value; + aabonuses.Double_Backstab_Front = effect_value; + itembonuses.Double_Backstab_Front = effect_value; + break; + case SE_ConsumeProjectile: spellbonuses.ConsumeProjectile = effect_value; aabonuses.ConsumeProjectile = effect_value; @@ -4918,6 +4947,37 @@ void Mob::NegateSpellsBonuses(uint16 spell_id) aabonuses.AC_Avoidance_Max_Percent = effect_value; break; + case SE_Melee_Damage_Position_Mod: + spellbonuses.Melee_Damage_Position_Mod[0] = effect_value; + aabonuses.Melee_Damage_Position_Mod[0] = effect_value; + itembonuses.Melee_Damage_Position_Mod[0] = effect_value; + spellbonuses.Melee_Damage_Position_Mod[1] = effect_value; + aabonuses.Melee_Damage_Position_Mod[1] = effect_value; + itembonuses.Melee_Damage_Position_Mod[1] = effect_value; + break; + + case SE_Damage_Taken_Position_Mod: + spellbonuses.Damage_Taken_Position_Mod[0] = effect_value; + aabonuses.Damage_Taken_Position_Mod[0] = effect_value; + itembonuses.Damage_Taken_Position_Mod[0] = effect_value; + spellbonuses.Damage_Taken_Position_Mod[1] = effect_value; + aabonuses.Damage_Taken_Position_Mod[1] = effect_value; + itembonuses.Damage_Taken_Position_Mod[1] = effect_value; + break; + + + case SE_DS_Mitigation_Amount: + spellbonuses.DS_Mitigation_Amount = effect_value; + itembonuses.DS_Mitigation_Amount = effect_value; + aabonuses.DS_Mitigation_Amount = effect_value; + break; + + case SE_DS_Mitigation_Percentage: + spellbonuses.DS_Mitigation_Percentage = effect_value; + itembonuses.DS_Mitigation_Percentage = effect_value; + aabonuses.DS_Mitigation_Percentage = effect_value; + break; + case SE_SkillProcSuccess:{ for(int e = 0; e < MAX_SKILL_PROCS; e++) { diff --git a/zone/common.h b/zone/common.h index bcb86f531..01c074b11 100644 --- a/zone/common.h +++ b/zone/common.h @@ -530,6 +530,9 @@ struct StatBonuses { int32 AC_Avoidance_Max_Percent; // Increase AC avoidance by percent int32 Damage_Taken_Position_Mod[2]; // base = percent melee damage reduction base2 0=back 1=front. [0]Back[1]Front int32 Melee_Damage_Position_Mod[2]; // base = percent melee damage increase base2 0=back 1=front. [0]Back[1]Front + int32 Double_Backstab_Front; // base = percent chance to double back stab front + int32 DS_Mitigation_Amount; // base = flat amt DS mitigation. Negative value to reduce + int32 DS_Mitigation_Percentage; // base = percent amt of DS mitigation. Negative value to reduce // AAs int8 Packrat; //weight reduction for items, 1 point = 10% diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 717bc4fbf..be3408c81 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -585,6 +585,10 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) { if(IsClient()) CastToClient()->CheckIncreaseSkill(EQ::skills::SkillBackstab, other, 10); m_specialattacks = eSpecialAttacks::None; + + int double_bs_front = aabonuses.Double_Backstab_Front + itembonuses.Double_Backstab_Front + spellbonuses.Double_Backstab_Front; + if (double_bs_front && other->GetHP() > 0 && zone->random.Roll(double_bs_front)) + RogueBackstab(other, false, ReuseTime); } else { //We do a single regular attack if we attack from the front without chaotic stab Attack(other, EQ::invslot::slotPrimary); diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 03b929d8b..801700bd5 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -3128,6 +3128,9 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_Critical_Melee_Damage_Mod_Max: case SE_Melee_Damage_Position_Mod: case SE_Damage_Taken_Position_Mod: + case SE_DS_Mitigation_Amount: + case SE_DS_Mitigation_Percentage: + case SE_Double_Backstab_Front: { break; }