diff --git a/common/spdat.h b/common/spdat.h index ddf5d4f39..1e4cb49cd 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -952,7 +952,7 @@ typedef enum { #define SE_IncreaseChanceMemwipe 242 // implemented - @Memblur, increases the chance to wipe hate with memory blurr, base: chance pct, limit: none, max: none, Note: Mods final blur chance after other bonuses added. #define SE_CharmBreakChance 243 // implemented - Total Domination #define SE_RootBreakChance 244 // implemented[AA] reduce the chance that your root will break. -#define SE_TrapCircumvention 245 // *not implemented[AA] - decreases the chance that you will set off a trap when opening a chest +#define SE_TrapCircumvention 245 // implemented, @Traps, decreases the chance that you will set off a trap when opening a chest or other similar container by percentage, base: chance modifer, limit: none, max: none #define SE_SetBreathLevel 246 // *not implemented as bonus #define SE_RaiseSkillCap 247 // implemented[AA] - adds skill over the skill cap. #define SE_SecondaryForte 248 // not implemented as bonus(gives you a 2nd specialize skill that can go past 50 to 100) diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 29a88bf32..8aef8452f 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -1773,6 +1773,10 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) break; } + case SE_TrapCircumvention: + newbon->TrapCircumvention += base_value; + break; + // to do case SE_PetDiscipline: break; @@ -1784,9 +1788,6 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) break; case SE_NimbleEvasion: break; - case SE_TrapCircumvention: - break; - // not handled here case SE_HastenedAASkill: @@ -3794,6 +3795,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne new_bonus->CompleteHealBuffBlocker = true; break; + case SE_TrapCircumvention: + new_bonus->TrapCircumvention += effect_value; + break; + //Special custom cases for loading effects on to NPC from 'npc_spels_effects' table if (IsAISpellEffect) { diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 59b2b76e1..99017d7ce 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -5464,8 +5464,11 @@ void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app) } else { + int fail_rate = 25; + int trap_circumvention = spellbonuses.TrapCircumvention + itembonuses.TrapCircumvention + aabonuses.TrapCircumvention; + fail_rate -= fail_rate * trap_circumvention / 100; MessageString(Chat::Skills, FAIL_DISARM_DETECTED_TRAP); - if (zone->random.Int(0, 99) < 25) { + if (zone->random.Int(0, 99) < fail_rate) { trap->Trigger(this); } } diff --git a/zone/common.h b/zone/common.h index 08cd81119..d3503c1b1 100644 --- a/zone/common.h +++ b/zone/common.h @@ -561,6 +561,7 @@ struct StatBonuses { bool CompleteHealBuffBlocker; // Use in SPA 101 to prevent recast of complete heal from this effect till blocker buff is removed. // AAs + int32 TrapCircumvention; // reduce chance to trigger a trap. uint16 SecondaryForte; // allow a second skill to be specialized with a cap of this value. int32 ShieldDuration; // extends duration of /shield ability int32 ExtendedShielding; // extends range of /shield ability