mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 17:38:26 +00:00
[Feature] Additive Spell Focus from Worn slot with Limit Checks (#4208)
* [Feature] Additive Spell Focus from Worn slot with limits New rule (UseAdditiveFocusFromWornSlotWithLimits) allows you place to focus effects in worn slots which will apply the focus additively and perform normal limit checks on those focus. This differs from regular focus behavior that only takes highest value. This is a new version of an old rule "UseAdditiveFocusFromWornSlot" which allowed similar behavior but ignored focus limits. Thus hindering its full potential for itemization. * Update spell_effects.cpp --------- Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
This commit is contained in:
+46
-2
@@ -6801,9 +6801,53 @@ int64 Mob::GetFocusEffect(focusType type, uint16 spell_id, Mob *caster, bool fro
|
||||
//Summon Spells that require reagents are typically imbue type spells, enchant metal, sacrifice and shouldn't be affected
|
||||
//by reagent conservation for obvious reasons.
|
||||
|
||||
//Non-Live like feature to allow for an additive focus bonus to be applied from foci that are placed in worn slot. (No limit checks)
|
||||
|
||||
int32 worneffect_bonus = 0;
|
||||
if (RuleB(Spells, UseAdditiveFocusFromWornSlot)) {
|
||||
//Non-Live like feature to allow for an additive focus bonus to be applied from foci that are placed in worn slot. (Limit Checks)
|
||||
if (RuleB(Spells, UseAdditiveFocusFromWornSlotWithLimits)) {
|
||||
//Check if item focus effect exists for the mob.
|
||||
if (itembonuses.FocusEffectsWornWithLimits[type]) {
|
||||
const EQ::ItemData* temporary_item = nullptr;
|
||||
const EQ::ItemData* used_item = nullptr;
|
||||
|
||||
//item focus
|
||||
for (int x = EQ::invslot::EQUIPMENT_BEGIN; x <= EQ::invslot::EQUIPMENT_END; x++) {
|
||||
temporary_item = nullptr;
|
||||
EQ::ItemInstance* ins = GetInv().GetItem(x);
|
||||
if (!ins) {
|
||||
continue;
|
||||
}
|
||||
|
||||
temporary_item = ins->GetItem();
|
||||
if (temporary_item && IsValidSpell(temporary_item->Worn.Effect)) {
|
||||
if (rand_effectiveness) {
|
||||
worneffect_bonus += CalcFocusEffect(type, temporary_item->Worn.Effect, spell_id, true);
|
||||
}
|
||||
else {
|
||||
worneffect_bonus += CalcFocusEffect(type, temporary_item->Worn.Effect, spell_id);
|
||||
}
|
||||
}
|
||||
|
||||
for (int y = EQ::invaug::SOCKET_BEGIN; y <= EQ::invaug::SOCKET_END; ++y) {
|
||||
EQ::ItemInstance* aug = nullptr;
|
||||
aug = ins->GetAugment(y);
|
||||
if (aug) {
|
||||
const EQ::ItemData* temporary_item_augment = aug->GetItem();
|
||||
if (temporary_item_augment && IsValidSpell(temporary_item_augment->Worn.Effect)) {
|
||||
if (rand_effectiveness) {
|
||||
worneffect_bonus += CalcFocusEffect(type, temporary_item_augment->Worn.Effect, spell_id, true);
|
||||
}
|
||||
else {
|
||||
worneffect_bonus += CalcFocusEffect(type, temporary_item_augment->Worn.Effect, spell_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//Non-Live like feature to allow for an additive focus bonus to be applied from foci that are placed in worn slot. (No limit checks)
|
||||
else if (RuleB(Spells, UseAdditiveFocusFromWornSlot)) {
|
||||
worneffect_bonus = itembonuses.FocusEffectsWorn[type];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user