diff --git a/changelog.txt b/changelog.txt index 9d66bcfd8..4e5866474 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,9 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) Secrets: Identified the opcode/struct for guild ranks in Rain of Fear+ clients. Secrets: Implemented a work-around for Rain of Fear clients to have all guild permissions until proper database support is added for newer ranks. +== 05/14/2014 == +Kayen: Rooted NPC's will no longer target players with Divine Aura effect if they are the closest target and other targets exist on the hate list. + == 05/12/2014 == Uleat: Re-arranged functions in Item.cpp to somewhat match the order they are declared in Item.h. Should make finding their location a little easier when using declarations as a guide. (This will facilitate readability of an upcoming change...) diff --git a/utils/sql/git/optional/2014_04_23_FocusComabtProcs.sql b/utils/sql/git/optional/2014_04_23_FocusComabtProcs.sql new file mode 100644 index 000000000..76f9c157a --- /dev/null +++ b/utils/sql/git/optional/2014_04_23_FocusComabtProcs.sql @@ -0,0 +1 @@ +INSERT INTO `rule_values` (`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES (1, 'Spells:FocusCombatProcs', 'false', 'Allow all combat procs to receive focus (ignores focus limit).'); diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index db0f81115..4699bfef1 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -2151,28 +2151,40 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne case SE_LimitHPPercent: { - if(newbon->HPPercCap != 0 && newbon->HPPercCap > effect_value) - newbon->HPPercCap = effect_value; - else if(newbon->HPPercCap == 0) - newbon->HPPercCap = effect_value; - + if(newbon->HPPercCap[0] != 0 && newbon->HPPercCap[0] > effect_value){ + newbon->HPPercCap[0] = effect_value; + newbon->HPPercCap[1] = base2; + } + else if(newbon->HPPercCap[0] == 0){ + newbon->HPPercCap[0] = effect_value; + newbon->HPPercCap[1] = base2; + } break; } case SE_LimitManaPercent: { - if(newbon->ManaPercCap != 0 && newbon->ManaPercCap > effect_value) - newbon->ManaPercCap = effect_value; - else if(newbon->ManaPercCap == 0) - newbon->ManaPercCap = effect_value; + if(newbon->ManaPercCap[0] != 0 && newbon->ManaPercCap[0] > effect_value){ + newbon->ManaPercCap[0] = effect_value; + newbon->ManaPercCap[1] = base2; + } + else if(newbon->ManaPercCap[0] == 0) { + newbon->ManaPercCap[0] = effect_value; + newbon->ManaPercCap[1] = base2; + } break; } case SE_LimitEndPercent: { - if(newbon->EndPercCap != 0 && newbon->EndPercCap > effect_value) - newbon->EndPercCap = effect_value; - else if(newbon->EndPercCap == 0) - newbon->EndPercCap = effect_value; + if(newbon->EndPercCap[0] != 0 && newbon->EndPercCap[0] > effect_value) { + newbon->EndPercCap[0] = effect_value; + newbon->EndPercCap[1] = base2; + } + + else if(newbon->EndPercCap[0] == 0){ + newbon->EndPercCap[0] = effect_value; + newbon->EndPercCap[1] = base2; + } break; } diff --git a/zone/bot.cpp b/zone/bot.cpp index 1526beddc..3b996e7a8 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -10649,10 +10649,10 @@ int32 Bot::CalcMaxHP() { if (cur_hp > max_hp) cur_hp = max_hp; - int hp_perc_cap = spellbonuses.HPPercCap; + int hp_perc_cap = spellbonuses.HPPercCap[0]; if(hp_perc_cap) { int curHP_cap = (max_hp * hp_perc_cap) / 100; - if (cur_hp > curHP_cap) + if (cur_hp > curHP_cap || (spellbonuses.HPPercCap[1] && cur_hp > spellbonuses.HPPercCap[1])) cur_hp = curHP_cap; } @@ -10671,10 +10671,10 @@ int32 Bot::CalcMaxEndurance() cur_end = max_end; } - int end_perc_cap = spellbonuses.EndPercCap; + int end_perc_cap = spellbonuses.EndPercCap[0]; if(end_perc_cap) { int curEnd_cap = (max_end * end_perc_cap) / 100; - if (cur_end > curEnd_cap) + if (cur_end > curEnd_cap || (spellbonuses.EndPercCap[1] && cur_end > spellbonuses.EndPercCap[1])) cur_end = curEnd_cap; } diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index 8c29f05eb..955a29d38 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -255,10 +255,10 @@ int32 Client::CalcMaxHP() { if (cur_hp > max_hp) cur_hp = max_hp; - int hp_perc_cap = spellbonuses.HPPercCap; + int hp_perc_cap = spellbonuses.HPPercCap[0]; if(hp_perc_cap) { int curHP_cap = (max_hp * hp_perc_cap) / 100; - if (cur_hp > curHP_cap) + if (cur_hp > curHP_cap || (spellbonuses.HPPercCap[1] && cur_hp > spellbonuses.HPPercCap[1])) cur_hp = curHP_cap; } @@ -950,10 +950,10 @@ int32 Client::CalcMaxMana() cur_mana = max_mana; } - int mana_perc_cap = spellbonuses.ManaPercCap; + int mana_perc_cap = spellbonuses.ManaPercCap[0]; if(mana_perc_cap) { int curMana_cap = (max_mana * mana_perc_cap) / 100; - if (cur_mana > curMana_cap) + if (cur_mana > curMana_cap || (spellbonuses.ManaPercCap[1] && cur_mana > spellbonuses.ManaPercCap[1])) cur_mana = curMana_cap; } @@ -1890,10 +1890,10 @@ void Client::CalcMaxEndurance() cur_end = max_end; } - int end_perc_cap = spellbonuses.EndPercCap; + int end_perc_cap = spellbonuses.EndPercCap[0]; if(end_perc_cap) { int curEnd_cap = (max_end * end_perc_cap) / 100; - if (cur_end > curEnd_cap) + if (cur_end > curEnd_cap || (spellbonuses.EndPercCap[1] && cur_end > spellbonuses.EndPercCap[1])) cur_end = curEnd_cap; } } diff --git a/zone/common.h b/zone/common.h index d720f3d43..d2737e4a5 100644 --- a/zone/common.h +++ b/zone/common.h @@ -310,9 +310,9 @@ struct StatBonuses { int16 IncreaseBlockChance; // overall block chance modifier uint16 PersistantCasting; // chance to continue casting through a stun int XPRateMod; //i - int HPPercCap; //Spell effect that limits you to being healed/regening beyond a % of your max - int ManaPercCap; // ^^ - int EndPercCap; // ^^ + int HPPercCap[2]; //Spell effect that limits you to being healed/regening beyond a % of your max + int ManaPercCap[2]; // ^^ 0 = % Cap 1 = Flat Amount Cap + int EndPercCap[2]; // ^^ bool BlockNextSpell; // Indicates whether the client can block a spell or not //uint16 BlockSpellEffect[EFFECT_COUNT]; // Prevents spells with certain effects from landing on you *no longer used bool ImmuneToFlee; // Bypass the fleeing flag diff --git a/zone/hate_list.cpp b/zone/hate_list.cpp index d83ed4d12..538abac61 100644 --- a/zone/hate_list.cpp +++ b/zone/hate_list.cpp @@ -163,7 +163,7 @@ Mob* HateList::GetClosest(Mob *hater) { ++iterator; } - if (close == 0 && hater->IsNPC()) + if (close == 0 && hater->IsNPC() || close->DivineAura()) close = hater->CastToNPC()->GetHateTop(); return close; diff --git a/zone/merc.cpp b/zone/merc.cpp index c8c8da6fa..8b2f9ce90 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -917,10 +917,10 @@ int32 Merc::CalcMaxHP() { if (cur_hp > max_hp) cur_hp = max_hp; - int hp_perc_cap = spellbonuses.HPPercCap; + int hp_perc_cap = spellbonuses.HPPercCap[0]; if(hp_perc_cap) { int curHP_cap = (max_hp * hp_perc_cap) / 100; - if (cur_hp > curHP_cap) + if (cur_hp > curHP_cap || (spellbonuses.HPPercCap[1] && cur_hp > spellbonuses.HPPercCap[1])) cur_hp = curHP_cap; } @@ -959,10 +959,10 @@ int32 Merc::CalcMaxMana() cur_mana = max_mana; } - int mana_perc_cap = spellbonuses.ManaPercCap; + int mana_perc_cap = spellbonuses.ManaPercCap[0]; if(mana_perc_cap) { int curMana_cap = (max_mana * mana_perc_cap) / 100; - if (cur_mana > curMana_cap) + if (cur_mana > curMana_cap || (spellbonuses.ManaPercCap[1] && cur_mana > spellbonuses.ManaPercCap[1])) cur_mana = curMana_cap; } @@ -1054,10 +1054,10 @@ void Merc::CalcMaxEndurance() cur_end = max_end; } - int end_perc_cap = spellbonuses.EndPercCap; + int end_perc_cap = spellbonuses.EndPercCap[0]; if(end_perc_cap) { int curEnd_cap = (max_end * end_perc_cap) / 100; - if (cur_end > curEnd_cap) + if (cur_end > curEnd_cap || (spellbonuses.EndPercCap[1] && cur_end > spellbonuses.EndPercCap[1])) cur_end = curEnd_cap; } }