[Rules] Classic Spell Data SPA Calc variability (#3931)

* [Rules] Classic Spell Data SPA Calc variability

When  using lucy imports of older more classic data, they lack the limit values which provides Focus Random Effectiveness.

Example:

Bazu Plauge (6472) went from a 40 limit to 0 limit on the 2006 lucy import.

Lucy does have limit value data, but it appears the affected SPAs sony handled in source vs in spell data.

* Requested Changes
This commit is contained in:
Fryguy 2024-01-09 05:49:10 -05:00 committed by GitHub
parent d0e069f4f8
commit 62b5f8a488
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 18 deletions

View File

@ -482,6 +482,7 @@ RULE_BOOL(Spells, RequireMnemonicRetention, true, "Enabling will require spell s
RULE_BOOL(Spells, EvacClearCharmPet, false, "Enable to have evac in zone clear charm from charm pets and detach buffs.") RULE_BOOL(Spells, EvacClearCharmPet, false, "Enable to have evac in zone clear charm from charm pets and detach buffs.")
RULE_BOOL(Spells, ManaTapsRequireNPCMana, false, "Enabling will require target to have mana to tap. Default off as many npc's are caster class with 0 mana and need fixed.") RULE_BOOL(Spells, ManaTapsRequireNPCMana, false, "Enabling will require target to have mana to tap. Default off as many npc's are caster class with 0 mana and need fixed.")
RULE_INT(Spells, HarmTouchCritRatio, 200, "Harmtouch crit bonus, on top of BaseCritRatio") RULE_INT(Spells, HarmTouchCritRatio, 200, "Harmtouch crit bonus, on top of BaseCritRatio")
RULE_BOOL(Spells, UseClassicSpellFocus, false, "Enabling will tell the server to handle random focus damage as classic spell imports lack the limit values.")
RULE_CATEGORY_END() RULE_CATEGORY_END()
RULE_CATEGORY(Combat) RULE_CATEGORY(Combat)

View File

@ -5892,16 +5892,19 @@ int64 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
// handle effects // handle effects
case SE_ImprovedDamage: case SE_ImprovedDamage:
if (type == focusImprovedDamage) {
value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus);
}
break;
case SE_ImprovedDamage2: case SE_ImprovedDamage2:
if (type == focusImprovedDamage2) { if (!RuleB(Spells, UseClassicSpellFocus)) {
if (type == focusImprovedDamage || type == focusImprovedDamage2) {
value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus); value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus);
} }
break; break;
} else {
if (best_focus) {
value = focus_spell.base_value[i];
} else {
value = zone->random.Int(1, focus_spell.base_value[i]);
}
}
case SE_Fc_Amplify_Mod: case SE_Fc_Amplify_Mod:
if (type == focusFcAmplifyMod && focus_spell.base_value[i] > value) { if (type == focusFcAmplifyMod && focus_spell.base_value[i] > value) {
@ -5910,14 +5913,18 @@ int64 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
break; break;
case SE_ImprovedHeal: case SE_ImprovedHeal:
if (type == focusImprovedHeal) { case SE_ReduceManaCost:
if (!RuleB(Spells, UseClassicSpellFocus)) {
if (type == focusImprovedHeal || type == focusManaCost) {
value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus); value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus);
} }
break; break;
}
case SE_ReduceManaCost: if (best_focus) {
if (type == focusManaCost) { value = focus_spell.base_value[i];
value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus); } else {
value = zone->random.Int(1, focus_spell.base_value[i]);
} }
break; break;
@ -5967,10 +5974,17 @@ int64 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
break; break;
case SE_ReduceReagentCost: case SE_ReduceReagentCost:
if (!RuleB(Spells, UseClassicSpellFocus)) {
if (type == focusReagentCost) { if (type == focusReagentCost) {
value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus); value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus);
} }
break; break;
}
if (type == focusReagentCost && focus_spell.base_value[i] > value) {
value = focus_spell.base_value[i];
}
break;
case SE_PetPowerIncrease: case SE_PetPowerIncrease:
if (type == focusPetPower && focus_spell.base_value[i] > value) { if (type == focusPetPower && focus_spell.base_value[i] > value) {
@ -5991,10 +6005,21 @@ int64 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
break; break;
case SE_SpellHateMod: case SE_SpellHateMod:
if (!RuleB(Spells, UseClassicSpellFocus)) {
if (type == focusSpellHateMod) { if (type == focusSpellHateMod) {
value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus); value = GetFocusRandomEffectivenessValue(focus_spell.base_value[i], focus_spell.limit_value[i], best_focus);
} }
break; break;
}
if (type == focusSpellHateMod) {
if (best_focus) {
value = focus_spell.base_value[i];
} else {
value = zone->random.Int(1, focus_spell.base_value[i]);
}
}
break;
case SE_ReduceReuseTimer: case SE_ReduceReuseTimer:
if (type == focusReduceRecastTime) { if (type == focusReduceRecastTime) {