diff --git a/changelog.txt b/changelog.txt index ac53a761b..26da2b13c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) == 07/2/2014 == Kayen: Implemented SE_Sanctuary - Places caster at bottom hate list, effect fades if caster cast spell on targets other than self. Kayen: Implemented SE_ResourceTap - Coverts a percent of dmg from dmg spells(DD/DoT) to hp/mana/end. +Kayen: Implemented SE_FactionModPct - Modifies faction gains and losses by percent. == 06/25/2014 == Kayen: Updated SE_Hate (Renamed from SE_Hate2) to now properly work for instant +/- hate spells. diff --git a/common/spdat.h b/common/spdat.h index 3b9d88995..c579a1af7 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -605,7 +605,7 @@ typedef enum { #define SE_AddHatePct 455 // implemented Modify total hate by % #define SE_AddHateOverTimePct 456 // implemented Modify total hate by % over time. #define SE_ResourceTap 457 // implemented Coverts a percent of dmg from dmg spells(DD/DoT) to hp/mana/end. -//#define SE_FactionModPct 458 // not used +#define SE_FactionModPct 458 // implemented Modifies faction gains and losses by percent. #define SE_DamageModifier2 459 // implemented - Modifies melee damage by skill type // LAST diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 0e521a6db..e27378207 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -1315,6 +1315,16 @@ void Client::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon) newbon->PetMeleeMitigation += base1; break; + case SE_FactionModPct: + { + if((base1 < 0) && (newbon->FactionModPct > base1)) + newbon->FactionModPct = base1; + + else if(newbon->FactionModPct < base1) + newbon->FactionModPct = base1; + break; + } + } } } @@ -2860,6 +2870,16 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne newbon->Sanctuary = true; break; + case SE_FactionModPct: + { + if((effect_value < 0) && (newbon->FactionModPct > effect_value)) + newbon->FactionModPct = effect_value; + + else if(newbon->FactionModPct < effect_value) + newbon->FactionModPct = effect_value; + break; + } + //Special custom cases for loading effects on to NPC from 'npc_spels_effects' table if (IsAISpellEffect) { @@ -4338,6 +4358,12 @@ void Mob::NegateSpellsBonuses(uint16 spell_id) spellbonuses.Sanctuary = effect_value; break; + case SE_FactionModPct: + spellbonuses.FactionModPct = effect_value; + itembonuses.FactionModPct = effect_value; + aabonuses.FactionModPct = effect_value; + break; + } } } diff --git a/zone/client.cpp b/zone/client.cpp index 4ec3ce2d7..12a9ada67 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -7629,6 +7629,9 @@ void Client::SetFactionLevel(uint32 char_id, uint32 npc_id, uint8 char_class, ui if(npc_value[i] != 0) { tmpValue = current_value + mod + npc_value[i]; + int16 FactionModPct = spellbonuses.FactionModPct + itembonuses.FactionModPct + aabonuses.FactionModPct; + tmpValue += (tmpValue * FactionModPct) / 100; + // Make sure faction hits don't go to GMs... if (m_pp.gm==1 && (tmpValue < current_value)) { tmpValue = current_value; diff --git a/zone/common.h b/zone/common.h index 0768a0835..9cb80211a 100644 --- a/zone/common.h +++ b/zone/common.h @@ -373,6 +373,7 @@ struct StatBonuses { bool BerserkSPA; // berserk effect int16 Metabolism; // Food/drink consumption rates. bool Sanctuary; // Sanctuary effect, lowers place on hate list until cast on others. + int16 FactionModPct; // Modifies amount of faction gained. // AAs int8 Packrat; //weight reduction for items, 1 point = 10%