diff --git a/zone/bot.cpp b/zone/bot.cpp index b5628ecb4..ccb3e99df 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -5234,7 +5234,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b return false; } -int32 Bot::CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint32 points, uint16 spell_id) +int32 Bot::CalcBotAAFocus(focusType type, uint32 aa_ID, uint32 points, uint16 spell_id) { const SPDat_Spell_Struct &spell = spells[spell_id]; int32 value = 0; @@ -5557,8 +5557,8 @@ int32 Bot::CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint32 points, uint16 return (value * lvlModifier / 100); } -int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) { - if (IsBardSong(spell_id) && bottype != BotfocusFcBaseEffects) +int32 Bot::GetBotFocusEffect(focusType bottype, uint16 spell_id) { + if (IsBardSong(spell_id) && bottype != focusFcBaseEffects) return 0; int32 realTotal = 0; @@ -5567,7 +5567,7 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) { bool rand_effectiveness = false; //Improved Healing, Damage & Mana Reduction are handled differently in that some are random percentages //In these cases we need to find the most powerful effect, so that each piece of gear wont get its own chance - if((bottype == BotfocusManaCost || bottype == BotfocusImprovedHeal || bottype == BotfocusImprovedDamage) && RuleB(Spells, LiveLikeFocusEffects)) + if((bottype == focusManaCost || bottype == focusImprovedHeal || bottype == focusImprovedDamage) && RuleB(Spells, LiveLikeFocusEffects)) rand_effectiveness = true; //Check if item focus effect exists for the client. @@ -5708,16 +5708,16 @@ int32 Bot::GetBotFocusEffect(BotfocusType bottype, uint16 spell_id) { } } - if(bottype == BotfocusReagentCost && IsSummonPetSpell(spell_id) && GetAA(aaElementalPact)) + if(bottype == focusReagentCost && IsSummonPetSpell(spell_id) && GetAA(aaElementalPact)) return 100; - if(bottype == BotfocusReagentCost && (IsEffectInSpell(spell_id, SE_SummonItem) || IsSacrificeSpell(spell_id))) + if(bottype == focusReagentCost && (IsEffectInSpell(spell_id, SE_SummonItem) || IsSacrificeSpell(spell_id))) return 0; return (realTotal + realTotal2); } -int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spell_id, bool best_focus) { +int32 Bot::CalcBotFocusEffect(focusType bottype, uint16 focus_id, uint16 spell_id, bool best_focus) { if(!IsValidSpell(focus_id) || !IsValidSpell(spell_id)) return 0; @@ -5847,7 +5847,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel return 0; break; case SE_ImprovedDamage: - if (bottype == BotfocusImprovedDamage) { + if (bottype == focusImprovedDamage) { if(best_focus) { if (focus_spell.base2[i] != 0) value = focus_spell.base2[i]; @@ -5861,7 +5861,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel } break; case SE_ImprovedHeal: - if (bottype == BotfocusImprovedHeal) { + if (bottype == focusImprovedHeal) { if(best_focus) { if (focus_spell.base2[i] != 0) value = focus_spell.base2[i]; @@ -5875,7 +5875,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel } break; case SE_ReduceManaCost: - if (bottype == BotfocusManaCost) { + if (bottype == focusManaCost) { if(best_focus) { if (focus_spell.base2[i] != 0) value = focus_spell.base2[i]; @@ -5889,39 +5889,39 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel } break; case SE_IncreaseSpellHaste: - if (bottype == BotfocusSpellHaste && focus_spell.base[i] > value) + if (bottype == focusSpellHaste && focus_spell.base[i] > value) value = focus_spell.base[i]; break; case SE_IncreaseSpellDuration: - if (bottype == BotfocusSpellDuration && focus_spell.base[i] > value) + if (bottype == focusSpellDuration && focus_spell.base[i] > value) value = focus_spell.base[i]; break; case SE_SpellDurationIncByTic: - if (bottype == BotfocusSpellDurByTic && focus_spell.base[i] > value) + if (bottype == focusSpellDurByTic && focus_spell.base[i] > value) value = focus_spell.base[i]; break; case SE_SwarmPetDuration: - if (bottype == BotfocusSwarmPetDuration && focus_spell.base[i] > value) + if (bottype == focusSwarmPetDuration && focus_spell.base[i] > value) value = focus_spell.base[i]; break; case SE_IncreaseRange: - if (bottype == BotfocusRange && focus_spell.base[i] > value) + if (bottype == focusRange && focus_spell.base[i] > value) value = focus_spell.base[i]; break; case SE_ReduceReagentCost: - if (bottype == BotfocusReagentCost && focus_spell.base[i] > value) + if (bottype == focusReagentCost && focus_spell.base[i] > value) value = focus_spell.base[i]; break; case SE_PetPowerIncrease: - if (bottype == BotfocusPetPower && focus_spell.base[i] > value) + if (bottype == focusPetPower && focus_spell.base[i] > value) value = focus_spell.base[i]; break; case SE_SpellResistReduction: - if (bottype == BotfocusResistRate && focus_spell.base[i] > value) + if (bottype == focusResistRate && focus_spell.base[i] > value) value = focus_spell.base[i]; break; case SE_SpellHateMod: - if (bottype == BotfocusSpellHateMod) { + if (bottype == focusSpellHateMod) { if(value != 0) { if(value > 0) { if(focus_spell.base[i] > value) @@ -5936,12 +5936,12 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel } break; case SE_ReduceReuseTimer: { - if(bottype == BotfocusReduceRecastTime) + if(bottype == focusReduceRecastTime) value = (focus_spell.base[i] / 1000); break; } case SE_TriggerOnCast: { - if(bottype == BotfocusTriggerOnCast) { + if(bottype == focusTriggerOnCast) { if(zone->random.Int(0, 100) <= focus_spell.base[i]) value = focus_spell.base2[i]; else @@ -5950,24 +5950,24 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel break; } case SE_FcSpellVulnerability: { - if(bottype == BotfocusSpellVulnerability) + if(bottype == focusSpellVulnerability) value = focus_spell.base[i]; break; } case SE_BlockNextSpellFocus: { - if(bottype == BotfocusBlockNextSpell) { + if(bottype == focusBlockNextSpell) { if(zone->random.Int(1, 100) <= focus_spell.base[i]) value = 1; } break; } case SE_FcTwincast: { - if(bottype == BotfocusTwincast) + if(bottype == focusTwincast) value = focus_spell.base[i]; break; } case SE_SympatheticProc: { - if(bottype == BotfocusSympatheticProc) { + if(bottype == focusSympatheticProc) { float ProcChance = GetSympatheticProcChances(spell_id, focus_spell.base[i]); if(zone->random.Real(0, 1) <= ProcChance) value = focus_id; @@ -5977,49 +5977,49 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel break; } case SE_FcDamageAmt: { - if(bottype == BotfocusFcDamageAmt) + if(bottype == focusFcDamageAmt) value = focus_spell.base[i]; break; } case SE_FcDamageAmtCrit: { - if(bottype == BotfocusFcDamageAmtCrit) + if(bottype == focusFcDamageAmtCrit) value = focus_spell.base[i]; break; } case SE_FcHealAmtIncoming: - if(bottype == BotfocusFcHealAmtIncoming) + if(bottype == focusFcHealAmtIncoming) value = focus_spell.base[i]; break; case SE_FcHealPctCritIncoming: - if (bottype == BotfocusFcHealPctCritIncoming) + if (bottype == focusFcHealPctCritIncoming) value = focus_spell.base[i]; break; case SE_FcHealAmtCrit: - if(bottype == BotfocusFcHealAmtCrit) + if(bottype == focusFcHealAmtCrit) value = focus_spell.base[i]; break; case SE_FcHealAmt: - if(bottype == BotfocusFcHealAmt) + if(bottype == focusFcHealAmt) value = focus_spell.base[i]; break; case SE_FcHealPctIncoming: - if(bottype == BotfocusFcHealPctIncoming) + if(bottype == focusFcHealPctIncoming) value = focus_spell.base[i]; break; case SE_FcBaseEffects: { - if (bottype == BotfocusFcBaseEffects) + if (bottype == focusFcBaseEffects) value = focus_spell.base[i]; break; } case SE_FcDamagePctCrit: { - if(bottype == BotfocusFcDamagePctCrit) + if(bottype == focusFcDamagePctCrit) value = focus_spell.base[i]; break; } case SE_FcIncreaseNumHits: { - if(bottype == BotfocusIncreaseNumHits) + if(bottype == focusIncreaseNumHits) value = focus_spell.base[i]; break; @@ -6559,14 +6559,14 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) { int32 Bot::CheckAggroAmount(uint16 spellid) { int32 AggroAmount = Mob::CheckAggroAmount(spellid, nullptr); - int32 focusAggro = GetBotFocusEffect(BotfocusSpellHateMod, spellid); + int32 focusAggro = GetBotFocusEffect(focusSpellHateMod, spellid); AggroAmount = (AggroAmount * (100 + focusAggro) / 100); return AggroAmount; } int32 Bot::CheckHealAggroAmount(uint16 spellid, Mob *target, uint32 heal_possible) { int32 AggroAmount = Mob::CheckHealAggroAmount(spellid, target, heal_possible); - int32 focusAggro = GetBotFocusEffect(BotfocusSpellHateMod, spellid); + int32 focusAggro = GetBotFocusEffect(focusSpellHateMod, spellid); AggroAmount = (AggroAmount * (100 + focusAggro) / 100); return AggroAmount; } @@ -6840,7 +6840,7 @@ int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) { bool Critical = false; int32 value_BaseEffect = 0; - value_BaseEffect = (value + (value*GetBotFocusEffect(BotfocusFcBaseEffects, spell_id) / 100)); + value_BaseEffect = (value + (value*GetBotFocusEffect(focusFcBaseEffects, spell_id) / 100)); // Need to scale HT damage differently after level 40! It no longer scales by the constant value in the spell file. It scales differently, instead of 10 more damage per level, it does 30 more damage per level. So we multiply the level minus 40 times 20 if they are over level 40. if ( (spell_id == SPELL_HARM_TOUCH || spell_id == SPELL_HARM_TOUCH2 || spell_id == SPELL_IMP_HARM_TOUCH ) && GetLevel() > 40) value -= ((GetLevel() - 40) * 20); @@ -6868,16 +6868,16 @@ int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) { ratio += RuleI(Spells, WizCritRatio); if (Critical) { value = (value_BaseEffect * ratio / 100); - value += (value_BaseEffect * GetBotFocusEffect(BotfocusImprovedDamage, spell_id) / 100); - value += (int(value_BaseEffect * GetBotFocusEffect(BotfocusFcDamagePctCrit, spell_id) / 100) * ratio / 100); + value += (value_BaseEffect * GetBotFocusEffect(focusImprovedDamage, spell_id) / 100); + value += (int(value_BaseEffect * GetBotFocusEffect(focusFcDamagePctCrit, spell_id) / 100) * ratio / 100); if (target) { value += (int(value_BaseEffect * target->GetVulnerability(this, spell_id, 0) / 100) * ratio / 100); value -= target->GetFcDamageAmtIncoming(this, spell_id); } - value -= (GetBotFocusEffect(BotfocusFcDamageAmtCrit, spell_id) * ratio / 100); + value -= (GetBotFocusEffect(focusFcDamageAmtCrit, spell_id) * ratio / 100); - value -= GetBotFocusEffect(BotfocusFcDamageAmt, spell_id); + value -= GetBotFocusEffect(focusFcDamageAmt, spell_id); if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5) value += (GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value) * ratio / 100); @@ -6889,15 +6889,15 @@ int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) { } value = value_BaseEffect; - value += (value_BaseEffect * GetBotFocusEffect(BotfocusImprovedDamage, spell_id) / 100); - value += (value_BaseEffect * GetBotFocusEffect(BotfocusFcDamagePctCrit, spell_id) / 100); + value += (value_BaseEffect * GetBotFocusEffect(focusImprovedDamage, spell_id) / 100); + value += (value_BaseEffect * GetBotFocusEffect(focusFcDamagePctCrit, spell_id) / 100); if (target) { value += (value_BaseEffect * target->GetVulnerability(this, spell_id, 0) / 100); value -= target->GetFcDamageAmtIncoming(this, spell_id); } - value -= GetBotFocusEffect(BotfocusFcDamageAmtCrit, spell_id); - value -= GetBotFocusEffect(BotfocusFcDamageAmt, spell_id); + value -= GetBotFocusEffect(focusFcDamageAmtCrit, spell_id); + value -= GetBotFocusEffect(focusFcDamageAmt, spell_id); if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5) value += GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value); @@ -6912,9 +6912,9 @@ int32 Bot::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { int32 chance = 0; int8 modifier = 1; bool Critical = false; - value_BaseEffect = (value + (value*GetBotFocusEffect(BotfocusFcBaseEffects, spell_id) / 100)); + value_BaseEffect = (value + (value*GetBotFocusEffect(focusFcBaseEffects, spell_id) / 100)); value = value_BaseEffect; - value += int(value_BaseEffect*GetBotFocusEffect(BotfocusImprovedHeal, spell_id) / 100); + value += int(value_BaseEffect*GetBotFocusEffect(focusImprovedHeal, spell_id) / 100); if(spells[spell_id].buffduration < 1) { chance += (itembonuses.CriticalHealChance + spellbonuses.CriticalHealChance + aabonuses.CriticalHealChance); chance += target->GetFocusIncoming(focusFcHealPctCritIncoming, SE_FcHealPctCritIncoming, this, spell_id); @@ -6927,8 +6927,8 @@ int32 Bot::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { } value *= modifier; - value += (GetBotFocusEffect(BotfocusFcHealAmtCrit, spell_id) * modifier); - value += GetBotFocusEffect(BotfocusFcHealAmt, spell_id); + value += (GetBotFocusEffect(focusFcHealAmtCrit, spell_id) * modifier); + value += GetBotFocusEffect(focusFcHealAmt, spell_id); value += target->GetFocusIncoming(focusFcHealAmtIncoming, SE_FcHealAmtIncoming, this, spell_id); if(itembonuses.HealAmt && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5) @@ -6953,7 +6953,7 @@ int32 Bot::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { int32 Bot::GetActSpellCasttime(uint16 spell_id, int32 casttime) { int32 cast_reducer = 0; - cast_reducer += GetBotFocusEffect(BotfocusSpellHaste, spell_id); + cast_reducer += GetBotFocusEffect(focusSpellHaste, spell_id); uint8 botlevel = GetLevel(); uint8 botclass = GetClass(); if (botlevel >= 51 && casttime >= 3000 && !BeneficialSpell(spell_id) && (botclass == SHADOWKNIGHT || botclass == RANGER || botclass == PALADIN || botclass == BEASTLORD )) @@ -7088,7 +7088,7 @@ int32 Bot::GetActSpellCost(uint16 spell_id, int32 cost) { } } - int32 focus_redux = GetBotFocusEffect(BotfocusManaCost, spell_id); + int32 focus_redux = GetBotFocusEffect(focusManaCost, spell_id); if(focus_redux > 0) PercentManaReduction += zone->random.Real(1, (double)focus_redux); @@ -7115,14 +7115,14 @@ int32 Bot::GetActSpellCost(uint16 spell_id, int32 cost) { float Bot::GetActSpellRange(uint16 spell_id, float range) { float extrange = 100; - extrange += GetBotFocusEffect(BotfocusRange, spell_id); + extrange += GetBotFocusEffect(focusRange, spell_id); return ((range * extrange) / 100); } int32 Bot::GetActSpellDuration(uint16 spell_id, int32 duration) { int increase = 100; - increase += GetBotFocusEffect(BotfocusSpellDuration, spell_id); - int tic_inc = 0; tic_inc = GetBotFocusEffect(BotfocusSpellDurByTic, spell_id); + increase += GetBotFocusEffect(focusSpellDuration, spell_id); + int tic_inc = 0; tic_inc = GetBotFocusEffect(focusSpellDurByTic, spell_id); if(IsBeneficialSpell(spell_id)) { switch (GetAA(aaSpellCastingReinforcement)) { diff --git a/zone/bot.h b/zone/bot.h index 97bb6892c..b456fd77f 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -99,40 +99,6 @@ class Bot : public NPC { friend class Mob; public: // Class enums - enum BotfocusType { //focus types - BotfocusSpellHaste = 1, - BotfocusSpellDuration, - BotfocusRange, - BotfocusReagentCost, - BotfocusManaCost, - BotfocusImprovedHeal, - BotfocusImprovedDamage, - BotfocusImprovedDOT, //i dont know about this... - BotfocusFcDamagePctCrit, - BotfocusImprovedUndeadDamage, - BotfocusPetPower, - BotfocusResistRate, - BotfocusSpellHateMod, - BotfocusTriggerOnCast, - BotfocusSpellVulnerability, - BotfocusTwincast, - BotfocusSympatheticProc, - BotfocusFcDamageAmt, - BotfocusFcDamageAmtCrit, - BotfocusSpellDurByTic, - BotfocusSwarmPetDuration, - BotfocusReduceRecastTime, - BotfocusBlockNextSpell, - BotfocusFcHealPctIncoming, - BotfocusFcDamageAmtIncoming, - BotfocusFcHealAmtIncoming, - BotfocusFcBaseEffects, - BotfocusIncreaseNumHits, - BotfocusFcHealPctCritIncoming, - BotfocusFcHealAmt, - BotfocusFcHealAmtCrit, - }; - enum BotTradeType { // types of trades a bot can do BotTradeClientNormal, BotTradeClientNoDropNoTrade @@ -636,9 +602,9 @@ protected: virtual void PetAIProcess(); virtual void BotMeditate(bool isSitting); virtual bool CheckBotDoubleAttack(bool Triple = false); - virtual int32 GetBotFocusEffect(BotfocusType bottype, uint16 spell_id); - virtual int32 CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spell_id, bool best_focus=false); - virtual int32 CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint32 points, uint16 spell_id); + virtual int32 GetBotFocusEffect(focusType bottype, uint16 spell_id); + virtual int32 CalcBotFocusEffect(focusType bottype, uint16 focus_id, uint16 spell_id, bool best_focus=false); + virtual int32 CalcBotAAFocus(focusType type, uint32 aa_ID, uint32 points, uint16 spell_id); virtual void PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* client); virtual bool AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0); diff --git a/zone/pets.cpp b/zone/pets.cpp index 438509b77..b4897940a 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -199,7 +199,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, } #ifdef BOTS else if (this->IsBot()) - act_power = CastToBot()->GetBotFocusEffect(Bot::BotfocusPetPower, spell_id); + act_power = CastToBot()->GetBotFocusEffect(focusPetPower, spell_id); #endif } else if (petpower > 0)