mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
Fix the math so berserkers aren't left out in spell related checks.
This commit is contained in:
parent
a14b3117e9
commit
31b6346f03
16
zone/bot.cpp
16
zone/bot.cpp
@ -5463,7 +5463,7 @@ int32 Bot::CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint32 points, uint16
|
||||
LimitFound = true;
|
||||
break;
|
||||
case SE_LimitMaxLevel:
|
||||
spell_level = spell.classes[(GetClass() % 16) - 1];
|
||||
spell_level = spell.classes[(GetClass() % 17) - 1];
|
||||
lvldiff = spell_level - base1;
|
||||
//every level over cap reduces the effect by base2 percent unless from a clicky when ItemCastsUseFocus is true
|
||||
if(lvldiff > 0 && (spell_level <= RuleI(Character, MaxLevel) || RuleB(Character, ItemCastsUseFocus) == false)) {
|
||||
@ -5477,7 +5477,7 @@ int32 Bot::CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint32 points, uint16
|
||||
}
|
||||
break;
|
||||
case SE_LimitMinLevel:
|
||||
if((spell.classes[(GetClass() % 16) - 1]) < base1)
|
||||
if((spell.classes[(GetClass() % 17) - 1]) < base1)
|
||||
LimitFound = true;
|
||||
break;
|
||||
case SE_LimitCastTimeMin:
|
||||
@ -5915,7 +5915,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
|
||||
case SE_LimitMaxLevel:{
|
||||
if (IsNPC())
|
||||
break;
|
||||
spell_level = spell.classes[(GetClass() % 16) - 1];
|
||||
spell_level = spell.classes[(GetClass() % 17) - 1];
|
||||
lvldiff = (spell_level - focus_spell.base[i]);
|
||||
if(lvldiff > 0 && (spell_level <= RuleI(Character, MaxLevel) || RuleB(Character, ItemCastsUseFocus) == false)) {
|
||||
if(focus_spell.base2[i] > 0) {
|
||||
@ -5931,7 +5931,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
|
||||
case SE_LimitMinLevel:
|
||||
if (IsNPC())
|
||||
break;
|
||||
if (spell.classes[(GetClass() % 16) - 1] < focus_spell.base[i])
|
||||
if (spell.classes[(GetClass() % 17) - 1] < focus_spell.base[i])
|
||||
return 0;
|
||||
break;
|
||||
|
||||
@ -7083,7 +7083,7 @@ int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
|
||||
|
||||
value -= GetBotFocusEffect(BotfocusFcDamageAmt, spell_id);
|
||||
|
||||
if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass() % 16) - 1] >= GetLevel() - 5)
|
||||
if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5)
|
||||
value += (GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value) * ratio / 100);
|
||||
|
||||
entity_list.MessageClose(this, false, 100, MT_SpellCrits, "%s delivers a critical blast! (%d)", GetName(), -value);
|
||||
@ -7102,7 +7102,7 @@ int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
|
||||
|
||||
value -= GetBotFocusEffect(BotfocusFcDamageAmtCrit, spell_id);
|
||||
value -= GetBotFocusEffect(BotfocusFcDamageAmt, spell_id);
|
||||
if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass() % 16) - 1] >= GetLevel() - 5)
|
||||
if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5)
|
||||
value += GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value);
|
||||
|
||||
return value;
|
||||
@ -7135,7 +7135,7 @@ int32 Bot::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
|
||||
value += GetBotFocusEffect(BotfocusFcHealAmt, spell_id);
|
||||
value += target->GetFocusIncoming(focusFcHealAmtIncoming, SE_FcHealAmtIncoming, this, spell_id);
|
||||
|
||||
if(itembonuses.HealAmt && spells[spell_id].classes[(GetClass() % 16) - 1] >= GetLevel() - 5)
|
||||
if(itembonuses.HealAmt && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5)
|
||||
value += (GetExtraSpellAmt(spell_id, itembonuses.HealAmt, value) * modifier);
|
||||
|
||||
value += (value * target->GetHealRate(spell_id, this) / 100);
|
||||
@ -7239,7 +7239,7 @@ int32 Bot::GetActSpellCasttime(uint16 spell_id, int32 casttime) {
|
||||
}
|
||||
|
||||
int32 Bot::GetActSpellCost(uint16 spell_id, int32 cost) {
|
||||
if(this->itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5) {
|
||||
if(this->itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%17) - 1] >= GetLevel() - 5) {
|
||||
int32 mana_back = (this->itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100);
|
||||
if(mana_back > cost)
|
||||
mana_back = cost;
|
||||
|
||||
@ -112,7 +112,7 @@ int32 Mob::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
|
||||
value -= GetFocusEffect(focusFcDamageAmt, spell_id);
|
||||
value -= GetFocusEffect(focusFcDamageAmt2, spell_id);
|
||||
|
||||
if(!spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
|
||||
if(!spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg && spells[spell_id].classes[(GetClass()%17) - 1] >= GetLevel() - 5)
|
||||
value -= GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value)*ratio/100;
|
||||
|
||||
else if (IsNPC() && CastToNPC()->GetSpellScale())
|
||||
@ -145,7 +145,7 @@ int32 Mob::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
|
||||
value -= GetFocusEffect(focusFcDamageAmt, spell_id);
|
||||
value -= GetFocusEffect(focusFcDamageAmt2, spell_id);
|
||||
|
||||
if(!spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
|
||||
if(!spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg && spells[spell_id].classes[(GetClass()%17) - 1] >= GetLevel() - 5)
|
||||
value -= GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value);
|
||||
|
||||
if (IsNPC() && CastToNPC()->GetSpellScale())
|
||||
@ -290,7 +290,7 @@ int32 Mob::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
|
||||
value += GetFocusEffect(focusFcHealAmt, spell_id);
|
||||
value += target->GetFocusIncoming(focusFcHealAmtIncoming, SE_FcHealAmtIncoming, this, spell_id);
|
||||
|
||||
if(!spells[spell_id].no_heal_damage_item_mod && itembonuses.HealAmt && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
|
||||
if(!spells[spell_id].no_heal_damage_item_mod && itembonuses.HealAmt && spells[spell_id].classes[(GetClass()%17) - 1] >= GetLevel() - 5)
|
||||
value += GetExtraSpellAmt(spell_id, itembonuses.HealAmt, value) * modifier;
|
||||
|
||||
value += value*target->GetHealRate(spell_id, this)/100;
|
||||
@ -339,7 +339,7 @@ int32 Client::GetActSpellCost(uint16 spell_id, int32 cost)
|
||||
cost *= 2;
|
||||
|
||||
// Formula = Unknown exact, based off a random percent chance up to mana cost(after focuses) of the cast spell
|
||||
if(itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
|
||||
if(itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%17) - 1] >= GetLevel() - 5)
|
||||
{
|
||||
int16 mana_back = itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100;
|
||||
// Doesnt generate mana, so best case is a free spell
|
||||
|
||||
@ -2678,7 +2678,7 @@ int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) {
|
||||
int32 Merc::GetActSpellCost(uint16 spell_id, int32 cost)
|
||||
{
|
||||
// Formula = Unknown exact, based off a random percent chance up to mana cost(after focuses) of the cast spell
|
||||
if(this->itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
|
||||
if(this->itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%17) - 1] >= GetLevel() - 5)
|
||||
{
|
||||
int16 mana_back = this->itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100;
|
||||
// Doesnt generate mana, so best case is a free spell
|
||||
|
||||
@ -5117,7 +5117,7 @@ int8 Mob::GetDecayEffectValue(uint16 spell_id, uint16 spelleffect) {
|
||||
if (!IsValidSpell(spell_id))
|
||||
return false;
|
||||
|
||||
int spell_level = spells[spell_id].classes[(GetClass()%16) - 1];
|
||||
int spell_level = spells[spell_id].classes[(GetClass()%17) - 1];
|
||||
int effect_value = 0;
|
||||
int lvlModifier = 100;
|
||||
|
||||
|
||||
@ -1082,11 +1082,11 @@ int32 Client::GenericFocus(uint16 spell_id, uint16 modspellid)
|
||||
switch( spells[modspellid].effectid[i] )
|
||||
{
|
||||
case SE_LimitMaxLevel:
|
||||
if (spell.classes[(GetClass()%16) - 1] > modspell.base[i])
|
||||
if (spell.classes[(GetClass()%17) - 1] > modspell.base[i])
|
||||
return 100;
|
||||
break;
|
||||
case SE_LimitMinLevel:
|
||||
if (spell.classes[(GetClass()%16) - 1] < modspell.base[i])
|
||||
if (spell.classes[(GetClass()%17) - 1] < modspell.base[i])
|
||||
return 100;
|
||||
break;
|
||||
case SE_IncreaseRange:
|
||||
|
||||
@ -4227,7 +4227,7 @@ int16 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id)
|
||||
break;
|
||||
|
||||
case SE_LimitMaxLevel:
|
||||
spell_level = spell.classes[(GetClass() % 16) - 1];
|
||||
spell_level = spell.classes[(GetClass() % 17) - 1];
|
||||
lvldiff = spell_level - base1;
|
||||
// every level over cap reduces the effect by base2 percent unless from a clicky when
|
||||
// ItemCastsUseFocus is true
|
||||
@ -4243,7 +4243,7 @@ int16 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id)
|
||||
break;
|
||||
|
||||
case SE_LimitMinLevel:
|
||||
if ((spell.classes[(GetClass() % 16) - 1]) < base1)
|
||||
if ((spell.classes[(GetClass() % 17) - 1]) < base1)
|
||||
LimitFailure = true;
|
||||
break;
|
||||
|
||||
@ -4661,7 +4661,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
|
||||
case SE_LimitMaxLevel:
|
||||
if (IsNPC())
|
||||
break;
|
||||
spell_level = spell.classes[(GetClass() % 16) - 1];
|
||||
spell_level = spell.classes[(GetClass() % 17) - 1];
|
||||
lvldiff = spell_level - focus_spell.base[i];
|
||||
// every level over cap reduces the effect by focus_spell.base2[i] percent unless from a clicky
|
||||
// when ItemCastsUseFocus is true
|
||||
@ -4679,7 +4679,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
|
||||
case SE_LimitMinLevel:
|
||||
if (IsNPC())
|
||||
break;
|
||||
if (spell.classes[(GetClass() % 16) - 1] < focus_spell.base[i])
|
||||
if (spell.classes[(GetClass() % 17) - 1] < focus_spell.base[i])
|
||||
return (0);
|
||||
break;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user