From 8caac162b2e19c99cf4ac7257aa595e053001205 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Wed, 26 Feb 2014 00:09:59 -0500 Subject: [PATCH] Spell effect addition / fixes --- changelog.txt | 5 +++++ common/spdat.h | 4 ++-- zone/aggro.cpp | 2 +- zone/attack.cpp | 3 +++ zone/bonuses.cpp | 20 +++++++++++++++++++- zone/common.h | 5 +++-- zone/spell_effects.cpp | 3 +-- 7 files changed, 34 insertions(+), 8 deletions(-) diff --git a/changelog.txt b/changelog.txt index 9bde9fe75..7cd8ace08 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,10 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- + +== 02/26/2014 == +Kayen: Implemented SE_FrenziedDevestation - increase critical spell chacnce and 2x mana cost for DD spells +Kayen: Fixed SE_SpellProcChance - Now works on spell dervived procs + == 02/24/2014 == Sorvani: Updated GetUnusedInstanceID to not recycle instance ID's unless it has reached max (65535) diff --git a/common/spdat.h b/common/spdat.h index 56de446d2..347da070b 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -359,7 +359,7 @@ typedef enum { #define SE_DispelBeneficial 209 // implemented //#define SE_PetShield 210 // *not implemented #define SE_AEMelee 211 // implemented -//#define SE_CastingSkills 212 // *not implemented -Include/Exclude Casting Skill type. (*no longer used on live) +#define SE_FrenziedDevastation 212 // implemented - increase spell criticals + all DD spells cast 2x mana. #define SE_PetMaxHP 213 // implemented[AA] - increases the maximum hit points of your pet #define SE_MaxHPChange 214 // implemented #define SE_PetAvoidance 215 // implemented[AA] - increases pet ability to avoid melee damage @@ -397,7 +397,7 @@ typedef enum { #define SE_RaiseSkillCap 247 // *not 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) #define SE_SecondaryDmgInc 249 // implemented[AA] Allows off hand weapon to recieve a damage bonus (Sinister Strikes) -#define SE_SpellProcChance 250 // implemented - Increase chance to sympathetic proc by % +#define SE_SpellProcChance 250 // implemented - Increase chance to proc from melee proc spells (ie Spirit of Panther) #define SE_ConsumeProjectile 251 // implemented[AA] - chance to not consume an arrow (ConsumeProjectile = 100) #define SE_FrontalBackstabChance 252 // implemented[AA] - chance to perform a full damage backstab from front. #define SE_FrontalBackstabMinDmg 253 // implemented[AA] - allow a frontal backstab for mininum damage. diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 326e320c0..d9c50a430 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -1414,7 +1414,7 @@ bool Mob::PassCharismaCheck(Mob* caster, Mob* spellTarget, uint16 spell_id) { if (caster->IsClient()) { //3: At maxed ability, Total Domination has a 50% chance of preventing the charm break that otherwise would have occurred. - uint16 TotalDominationBonus = caster->aabonuses.CharmBreakChance + caster->spellbonuses.CharmBreakChance + caster->itembonuses.CharmBreakChance; + int16 TotalDominationBonus = caster->aabonuses.CharmBreakChance + caster->spellbonuses.CharmBreakChance + caster->itembonuses.CharmBreakChance; if (MakeRandomInt(0, 99) < TotalDominationBonus) return true; diff --git a/zone/attack.cpp b/zone/attack.cpp index 4467d6320..5e7b21a93 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -4149,6 +4149,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct* weapon, Mob *on } } + int16 SpellProcChance = spellbonuses.SpellProcChance + itembonuses.SpellProcChance + aabonuses.SpellProcChance; uint32 i; for(i = 0; i < MAX_PROCS; i++) { if (PermaProcs[i].spellID != SPELL_UNKNOWN) { @@ -4169,6 +4170,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct* weapon, Mob *on else { int chance = ProcChance * (SpellProcs[i].chance); + chance += chance*SpellProcChance/100; if(MakeRandomInt(0, 100) < chance) { mlog(COMBAT__PROCS, "Spell proc %d procing spell %d (%d percent chance)", i, SpellProcs[i].spellID, chance); ExecWeaponProc(nullptr, SpellProcs[i].spellID, on); @@ -4180,6 +4182,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct* weapon, Mob *on } if (bRangedAttack) { int chance = ProcChance * RangedProcs[i].chance; + chance += chance*SpellProcChance/100; if(MakeRandomInt(0, 100) < chance) { mlog(COMBAT__PROCS, "Ranged proc %d procing spell %d", i, RangedProcs[i].spellID, RangedProcs[i].chance); ExecWeaponProc(nullptr, RangedProcs[i].spellID, on); diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index eb5cad582..743c5d250 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -1228,6 +1228,14 @@ void Client::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon) break; } + case SE_FrenziedDevastation: + newbon->FrenziedDevastation += base2; + break; + + case SE_SpellProcChance: + newbon->SpellProcChance += base1; + break; + } } } @@ -2524,6 +2532,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne newbon->DistanceRemoval = true; break; + case SE_FrenziedDevastation: + newbon->FrenziedDevastation += spells[spell_id].base2[i]; + break; + } } } @@ -3866,7 +3878,13 @@ void Mob::NegateSpellsBonuses(uint16 spell_id) spellbonuses.ImprovedTaunt[0] = effect_value; spellbonuses.ImprovedTaunt[1] = effect_value; spellbonuses.ImprovedTaunt[2] = -1; - + break; + + case SE_FrenziedDevastation: + spellbonuses.FrenziedDevastation += effect_value; + aabonuses.FrenziedDevastation += effect_value; + itembonuses.FrenziedDevastation += effect_value; + break; } } } diff --git a/zone/common.h b/zone/common.h index a832657e3..39f766794 100644 --- a/zone/common.h +++ b/zone/common.h @@ -311,8 +311,8 @@ struct StatBonuses { //uint16 BlockSpellEffect[EFFECT_COUNT]; // Prevents spells with certain effects from landing on you *no longer used bool ImmuneToFlee; // Bypass the fleeing flag uint16 VoiceGraft; // Stores the ID of the mob with which to talk through - uint16 SpellProcChance; // chance to proc from sympathetic spell effects - uint16 CharmBreakChance; // chance to break charm + int16 SpellProcChance; // chance to proc from sympathetic spell effects + int16 CharmBreakChance; // chance to break charm int16 SongRange; // increases range of beneficial bard songs uint16 HPToManaConvert; // Uses HP to cast spells at specific conversion uint16 FocusEffects[HIGHEST_FOCUS+1]; // Stores the focus effectid for each focustype you have. @@ -335,6 +335,7 @@ struct StatBonuses { bool DivineAura; // invulnerability bool DistanceRemoval; // Check if Cancle if Moved effect is present int16 ImprovedTaunt[3]; // 0 = Max Level 1 = Aggro modifier 2 = buffid + int16 FrenziedDevastation; // base1= AArank(used) base2= chance increase spell criticals + all DD spells 2x mana. //bool AbsorbMagicAtt; // Magic Rune *Need to be implemented for NegateEffect //bool MeleeRune; // Melee Rune *Need to be implemented for NegateEffect diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 5deb29e14..bdc3bbc68 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -2826,6 +2826,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) case SE_CriticalMend: case SE_LimitCastTimeMax: case SE_TriggerOnReqCaster: + case SE_FrenziedDevastation: { break; } @@ -5396,14 +5397,12 @@ bool Mob::AffectedBySpellExcludingSlot(int slot, int effect) float Mob::GetSympatheticProcChances(float &ProcBonus, float &ProcChance, int32 cast_time, int16 ProcRateMod) { - ProcBonus = spellbonuses.SpellProcChance + itembonuses.SpellProcChance; ProcChance = 0; if(cast_time > 0) { ProcChance = ((float)cast_time * RuleR(Casting, AvgSpellProcsPerMinute) / 60000.0f); ProcChance = ProcChance * (float)(ProcRateMod/100); - ProcChance = ProcChance+(ProcChance*ProcBonus/100); } return ProcChance; }