diff --git a/zone/client.h b/zone/client.h index 0e73370c3..c20c9057c 100644 --- a/zone/client.h +++ b/zone/client.h @@ -889,7 +889,7 @@ public: void SendClearAA(); inline uint32 GetAAXP() const { return m_pp.expAA; } inline uint32 GetAAPercent() const { return m_epp.perAA; } - int16 CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id); + int32 CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id); void SetAATitle(const char *Title); void SetTitleSuffix(const char *txt); void MemorizeSpell(uint32 slot, uint32 spellid, uint32 scribing); @@ -1602,7 +1602,7 @@ protected: void MakeBuffFadePacket(uint16 spell_id, int slot_id, bool send_message = true); bool client_data_loaded; - int16 GetFocusEffect(focusType type, uint16 spell_id); + int32 GetFocusEffect(focusType type, uint16 spell_id); uint16 GetSympatheticFocusEffect(focusType type, uint16 spell_id); void FinishAlternateAdvancementPurchase(AA::Rank *rank, bool ignore_cost); diff --git a/zone/merc.cpp b/zone/merc.cpp index 62b02c8a0..a24809418 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -2552,11 +2552,11 @@ bool Merc::CheckAENuke(Merc* caster, Mob* tar, uint16 spell_id, uint8 &numTarget return false; } -int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) { +int32 Merc::GetFocusEffect(focusType type, uint16 spell_id) { - int16 realTotal = 0; - int16 realTotal2 = 0; - int16 realTotal3 = 0; + int32 realTotal = 0; + int32 realTotal2 = 0; + int32 realTotal3 = 0; bool rand_effectiveness = false; //Improved Healing, Damage & Mana Reduction are handled differently in that some are random percentages @@ -2572,10 +2572,10 @@ int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) { const EQ::ItemData* TempItem = nullptr; const EQ::ItemData* UsedItem = nullptr; - uint16 UsedFocusID = 0; - int16 Total = 0; - int16 focus_max = 0; - int16 focus_max_real = 0; + int32 UsedFocusID = 0; + int32 Total = 0; + int32 focus_max = 0; + int32 focus_max_real = 0; //item focus for (int x = EQ::invslot::EQUIPMENT_BEGIN; x <= EQ::invslot::EQUIPMENT_END; ++x) @@ -2623,14 +2623,14 @@ int16 Merc::GetFocusEffect(focusType type, uint16 spell_id) { if (spellbonuses.FocusEffects[type]){ //Spell Focus - int16 Total2 = 0; - int16 focus_max2 = 0; - int16 focus_max_real2 = 0; + int32 Total2 = 0; + int32 focus_max2 = 0; + int32 focus_max_real2 = 0; int buff_tracker = -1; int buff_slot = 0; - uint16 focusspellid = 0; - uint16 focusspell_tracker = 0; + int32 focusspellid = 0; + int32 focusspell_tracker = 0; uint32 buff_max = GetMaxTotalSlots(); for (buff_slot = 0; buff_slot < buff_max; buff_slot++) { focusspellid = buffs[buff_slot].spellid; diff --git a/zone/merc.h b/zone/merc.h index d8feeab4f..44ea7dda9 100644 --- a/zone/merc.h +++ b/zone/merc.h @@ -272,7 +272,7 @@ protected: void AddItemBonuses(const EQ::ItemData *item, StatBonuses* newbon); int CalcRecommendedLevelBonus(uint8 level, uint8 reclevel, int basestat); - int16 GetFocusEffect(focusType type, uint16 spell_id); + int32 GetFocusEffect(focusType type, uint16 spell_id); std::vector merc_spells; std::map timers; diff --git a/zone/mob.h b/zone/mob.h index ee3801833..aadeb6645 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -770,7 +770,7 @@ public: void QuestJournalledSay(Client *QuestInitiator, const char *str, Journal::Options &opts); int32 GetItemStat(uint32 itemid, const char *identifier); - int16 CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, bool best_focus=false, uint16 casterid=0); + int32 CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, bool best_focus=false, uint16 casterid=0); uint8 IsFocusEffect(uint16 spellid, int effect_index, bool AA=false,uint32 aa_effect=0); void SendIllusionPacket(uint16 in_race, uint8 in_gender = 0xFF, uint8 in_texture = 0xFF, uint8 in_helmtexture = 0xFF, uint8 in_haircolor = 0xFF, uint8 in_beardcolor = 0xFF, uint8 in_eyecolor1 = 0xFF, uint8 in_eyecolor2 = 0xFF, @@ -839,9 +839,9 @@ public: int32 GetSpellStat(uint32 spell_id, const char *identifier, uint8 slot = 0); bool HarmonySpellLevelCheck(int32 spell_id, Mob* target = nullptr); - void CastSpellOnLand(Mob* caster, uint32 spell_id); + void CastSpellOnLand(Mob* caster, int32 spell_id); void FocusProcLimitProcess(); - bool ApplyFocusProcLimiter(uint32 spell_id, int buffslot = -1); + bool ApplyFocusProcLimiter(int32 spell_id, int buffslot = -1); void ModSkillDmgTaken(EQ::skills::SkillType skill_num, int value); int16 GetModSkillDmgTaken(const EQ::skills::SkillType skill_num); @@ -1383,7 +1383,7 @@ protected: virtual #endif int GetBaseSkillDamage(EQ::skills::SkillType skill, Mob *target = nullptr); - virtual int16 GetFocusEffect(focusType type, uint16 spell_id) { return 0; } + virtual int32 GetFocusEffect(focusType type, uint16 spell_id) { return 0; } void CalculateNewFearpoint(); float FindGroundZ(float new_x, float new_y, float z_offset=0.0); float FindDestGroundZ(glm::vec3 dest, float z_offset=0.0); diff --git a/zone/npc.h b/zone/npc.h index d75fe67f7..f28394b9b 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -544,7 +544,7 @@ protected: virtual bool AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes, bool bInnates = false); virtual bool AIDoSpellCast(uint8 i, Mob* tar, int32 mana_cost, uint32* oDontDoAgainBefore = 0); AISpellsVar_Struct AISpellVar; - int16 GetFocusEffect(focusType type, uint16 spell_id); + int32 GetFocusEffect(focusType type, uint16 spell_id); uint16 innate_proc_spell_id; uint32 npc_spells_effects_id; diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 18cd28117..d64af2f19 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -4421,11 +4421,11 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) CalcBonuses(); } -int16 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) +int32 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) { const SPDat_Spell_Struct &spell = spells[spell_id]; - int16 value = 0; + int32 value = 0; int lvlModifier = 100; int spell_level = 0; int lvldiff = 0; @@ -4927,7 +4927,7 @@ int16 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) //given an item/spell's focus ID and the spell being cast, determine the focus ammount, if any //assumes that spell_id is not a bard spell and that both ids are valid spell ids -int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, bool best_focus, uint16 casterid) +int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, bool best_focus, uint16 casterid) { /* 'this' is always the caster of the spell_id, most foci check for effects on the caster, however some check for effects on the target. @@ -4940,11 +4940,11 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo const SPDat_Spell_Struct &focus_spell = spells[focus_id]; const SPDat_Spell_Struct &spell = spells[spell_id]; - int16 value = 0; + int32 value = 0; int lvlModifier = 100; int spell_level = 0; int lvldiff = 0; - uint32 Caston_spell_id = 0; + int32 Caston_spell_id = 0; bool LimitInclude[MaxLimitInclude] = {false}; /* Certain limits require only one of several Include conditions to be true. Ie. Add damage to fire OR ice @@ -5625,7 +5625,7 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) { return 0; } -int16 Client::GetFocusEffect(focusType type, uint16 spell_id) +int32 Client::GetFocusEffect(focusType type, uint16 spell_id) { if (IsBardSong(spell_id) && type != focusFcBaseEffects && type != focusSpellDuration) return 0; @@ -5633,9 +5633,9 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) if (spells[spell_id].not_focusable) return 0; - int16 realTotal = 0; - int16 realTotal2 = 0; - int16 realTotal3 = 0; + int32 realTotal = 0; + int32 realTotal2 = 0; + int32 realTotal3 = 0; bool rand_effectiveness = false; //Improved Healing, Damage & Mana Reduction are handled differently in that some are random percentages @@ -5649,9 +5649,9 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) const EQ::ItemData* TempItem = nullptr; const EQ::ItemData* UsedItem = nullptr; uint16 UsedFocusID = 0; - int16 Total = 0; - int16 focus_max = 0; - int16 focus_max_real = 0; + int32 Total = 0; + int32 focus_max = 0; + int32 focus_max_real = 0; //item focus for (int x = EQ::invslot::EQUIPMENT_BEGIN; x <= EQ::invslot::EQUIPMENT_END; x++) @@ -5812,14 +5812,14 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) if (spellbonuses.FocusEffects[type]){ //Spell Focus - int16 Total2 = 0; - int16 focus_max2 = 0; - int16 focus_max_real2 = 0; + int32 Total2 = 0; + int32 focus_max2 = 0; + int32 focus_max_real2 = 0; int buff_tracker = -1; int buff_slot = 0; - uint16 focusspellid = 0; - uint16 focusspell_tracker = 0; + int32 focusspellid = 0; + int32 focusspell_tracker = 0; int buff_max = GetMaxTotalSlots(); for (buff_slot = 0; buff_slot < buff_max; buff_slot++) { focusspellid = buffs[buff_slot].spellid; @@ -5865,7 +5865,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) // AA Focus if (aabonuses.FocusEffects[type]){ - int16 Total3 = 0; + int32 Total3 = 0; for (const auto &aa : aa_ranks) { auto ability_rank = zone->GetAlternateAdvancementAbilityAndRank(aa.first, aa.second.first); @@ -5895,20 +5895,20 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) //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) - int16 worneffect_bonus = 0; + int32 worneffect_bonus = 0; if (RuleB(Spells, UseAdditiveFocusFromWornSlot)) worneffect_bonus = itembonuses.FocusEffectsWorn[type]; return realTotal + realTotal2 + realTotal3 + worneffect_bonus; } -int16 NPC::GetFocusEffect(focusType type, uint16 spell_id) { +int32 NPC::GetFocusEffect(focusType type, uint16 spell_id) { if (spells[spell_id].not_focusable) return 0; - int16 realTotal = 0; - int16 realTotal2 = 0; + int32 realTotal = 0; + int32 realTotal2 = 0; bool rand_effectiveness = false; //Improved Healing, Damage & Mana Reduction are handled differently in that some are random percentages @@ -5921,9 +5921,9 @@ int16 NPC::GetFocusEffect(focusType type, uint16 spell_id) { const EQ::ItemData* TempItem = nullptr; const EQ::ItemData* UsedItem = nullptr; uint16 UsedFocusID = 0; - int16 Total = 0; - int16 focus_max = 0; - int16 focus_max_real = 0; + int32 Total = 0; + int32 focus_max = 0; + int32 focus_max_real = 0; //item focus for (int i = EQ::invslot::EQUIPMENT_BEGIN; i <= EQ::invslot::EQUIPMENT_END; i++){ @@ -5969,14 +5969,14 @@ int16 NPC::GetFocusEffect(focusType type, uint16 spell_id) { if (RuleB(Spells, NPC_UseFocusFromSpells) && spellbonuses.FocusEffects[type]){ //Spell Focus - int16 Total2 = 0; - int16 focus_max2 = 0; - int16 focus_max_real2 = 0; + int32 Total2 = 0; + int32 focus_max2 = 0; + int32 focus_max_real2 = 0; int buff_tracker = -1; int buff_slot = 0; - uint16 focusspellid = 0; - uint16 focusspell_tracker = 0; + int32 focusspellid = 0; + int32 focusspell_tracker = 0; int buff_max = GetMaxTotalSlots(); for (buff_slot = 0; buff_slot < buff_max; buff_slot++) { focusspellid = buffs[buff_slot].spellid; @@ -7179,7 +7179,7 @@ void Mob::TryTriggerThreshHold(int32 damage, int effect_id, Mob* attacker){ } } -void Mob::CastSpellOnLand(Mob* caster, uint32 spell_id) +void Mob::CastSpellOnLand(Mob* caster, int32 spell_id) { /* This function checks for incoming spells on a mob, if they meet the criteria for focus SE_Fc_Cast_Spell_on_Land then @@ -7193,7 +7193,7 @@ void Mob::CastSpellOnLand(Mob* caster, uint32 spell_id) if (!caster) return; - uint32 trigger_spell_id = 0; + int32 trigger_spell_id = 0; //Step 1: Check this focus effect exists on the mob. if (spellbonuses.FocusEffects[focusFcCastSpellOnLand]) { @@ -7230,7 +7230,7 @@ void Mob::CastSpellOnLand(Mob* caster, uint32 spell_id) } } -bool Mob::ApplyFocusProcLimiter(uint32 spell_id, int buffslot) +bool Mob::ApplyFocusProcLimiter(int32 spell_id, int buffslot) { if (buffslot < 0) return false;