mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-14 11:31:30 +00:00
Add MainAmmo slot check for AddItemBonuses - only includes skill mods
This commit is contained in:
parent
63cce6875f
commit
abedfd3918
@ -1,5 +1,8 @@
|
||||
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||
-------------------------------------------------------
|
||||
== 02/29/2016 ==
|
||||
Uleat: Change in AddItemBonuses - now includes ammo slot for skill mods only. Defined SoD- client SkillModMax packet property (client does not show..but, does enforce.)
|
||||
|
||||
== 02/11/2016 ==
|
||||
Hateborne: Added IgnoreSpellDmgLvlRestriction rule (boolean) to ignore the 5 level spread when checking to add SpellDmg
|
||||
|
||||
|
||||
@ -2230,11 +2230,12 @@ void ItemInst::ScaleItem() {
|
||||
m_scaledItem->Mana = (int32)((float)m_item->Mana*Mult);
|
||||
m_scaledItem->AC = (int32)((float)m_item->AC*Mult);
|
||||
|
||||
m_scaledItem->SkillModValue = (int32)((float)m_item->SkillModValue*Mult);
|
||||
m_scaledItem->BaneDmgAmt = (int8)((float)m_item->BaneDmgAmt*Mult);
|
||||
m_scaledItem->BardValue = (int32)((float)m_item->BardValue*Mult);
|
||||
m_scaledItem->ElemDmgAmt = (uint8)((float)m_item->ElemDmgAmt*Mult);
|
||||
m_scaledItem->Damage = (uint32)((float)m_item->Damage*Mult);
|
||||
// check these..some may not need to be modified (really need to check all stats/bonuses)
|
||||
//m_scaledItem->SkillModValue = (int32)((float)m_item->SkillModValue*Mult);
|
||||
//m_scaledItem->BaneDmgAmt = (int8)((float)m_item->BaneDmgAmt*Mult); // watch (10 entries with charmfileid)
|
||||
m_scaledItem->BardValue = (int32)((float)m_item->BardValue*Mult); // watch (no entries with charmfileid)
|
||||
m_scaledItem->ElemDmgAmt = (uint8)((float)m_item->ElemDmgAmt*Mult); // watch (no entries with charmfileid)
|
||||
m_scaledItem->Damage = (uint32)((float)m_item->Damage*Mult); // watch
|
||||
|
||||
m_scaledItem->CombatEffects = (int8)((float)m_item->CombatEffects*Mult);
|
||||
m_scaledItem->Shielding = (int8)((float)m_item->Shielding*Mult);
|
||||
|
||||
@ -3661,7 +3661,7 @@ namespace SoD
|
||||
ibs.Races = item->Races;
|
||||
ibs.Deity = item->Deity;
|
||||
ibs.SkillModValue = item->SkillModValue;
|
||||
ibs.unknown6 = 0;
|
||||
ibs.SkillModMax = item->SkillModMax;
|
||||
ibs.SkillModType = item->SkillModType;
|
||||
ibs.BaneDmgRace = item->BaneDmgRace;
|
||||
ibs.BaneDmgBody = item->BaneDmgBody;
|
||||
|
||||
@ -4006,7 +4006,7 @@ struct ItemBodyStruct
|
||||
uint32 Races;
|
||||
uint32 Deity;
|
||||
int32 SkillModValue;
|
||||
uint32 unknown6;
|
||||
uint32 SkillModMax;
|
||||
uint32 SkillModType;
|
||||
uint32 BaneDmgRace;
|
||||
uint32 BaneDmgBody;
|
||||
|
||||
@ -2983,7 +2983,7 @@ namespace SoF
|
||||
ibs.Races = item->Races;
|
||||
ibs.Deity = item->Deity;
|
||||
ibs.SkillModValue = item->SkillModValue;
|
||||
ibs.unknown6 = 0;
|
||||
ibs.SkillModMax = item->SkillModMax;
|
||||
ibs.SkillModType = item->SkillModType;
|
||||
ibs.BaneDmgRace = item->BaneDmgRace;
|
||||
ibs.BaneDmgBody = item->BaneDmgBody;
|
||||
|
||||
@ -3861,7 +3861,7 @@ struct ItemBodyStruct
|
||||
uint32 Races;
|
||||
uint32 Deity;
|
||||
int32 SkillModValue;
|
||||
uint32 unknown6;
|
||||
uint32 SkillModMax;
|
||||
uint32 SkillModType;
|
||||
uint32 BaneDmgRace;
|
||||
uint32 BaneDmgBody;
|
||||
|
||||
@ -39,7 +39,7 @@ These fields must be in the order of how they are serialized!
|
||||
/* 030 */ I(AC)
|
||||
/* 031 */ I(Deity)
|
||||
/* 032 */ I(SkillModValue)
|
||||
/* 033 */ C("0")
|
||||
/* 033 */ I(SkillModMax)
|
||||
/* 034 */ I(SkillModType)
|
||||
/* 035 */ I(BaneDmgRace)
|
||||
/* 036 */ I(BaneDmgAmt)
|
||||
|
||||
@ -144,12 +144,12 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
|
||||
SetTwoHanderEquipped(false);
|
||||
|
||||
unsigned int i;
|
||||
//should not include 21 (SLOT_AMMO)
|
||||
for (i = MainCharm; i < MainAmmo; i++) {
|
||||
// Update: MainAmmo should only calc skill mods (TODO: Check for other cases)
|
||||
for (i = MainCharm; i <= MainAmmo; i++) {
|
||||
const ItemInst* inst = m_inv[i];
|
||||
if(inst == 0)
|
||||
continue;
|
||||
AddItemBonuses(inst, newbon);
|
||||
AddItemBonuses(inst, newbon, false, false, 0, (i == MainAmmo));
|
||||
|
||||
//These are given special flags due to how often they are checked for various spell effects.
|
||||
const Item_Struct *item = inst->GetItem();
|
||||
@ -207,7 +207,7 @@ void Client::ProcessItemCaps()
|
||||
itembonuses.ATK = std::min(itembonuses.ATK, CalcItemATKCap());
|
||||
}
|
||||
|
||||
void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAug, bool isTribute, int rec_override)
|
||||
void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAug, bool isTribute, int rec_override, bool ammo_slot_item)
|
||||
{
|
||||
if (!inst || !inst->IsType(ItemClassCommon)) {
|
||||
return;
|
||||
@ -231,6 +231,8 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAu
|
||||
// So there isn't a very nice way to get the real rec level from the aug's inst, so we just pass it in, only
|
||||
// used for augs
|
||||
auto rec_level = isAug ? rec_override : inst->GetItemRecommendedLevel(true);
|
||||
|
||||
if (!ammo_slot_item) {
|
||||
if (GetLevel() >= rec_level) {
|
||||
newbon->AC += item->AC;
|
||||
newbon->HP += item->HP;
|
||||
@ -280,7 +282,8 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAu
|
||||
newbon->HeroicDR += item->HeroicDR;
|
||||
newbon->HeroicCorrup += item->HeroicSVCorrup;
|
||||
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
int lvl = GetLevel();
|
||||
|
||||
newbon->AC += CalcRecommendedLevelBonus(lvl, rec_level, item->AC);
|
||||
@ -436,7 +439,6 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAu
|
||||
|
||||
switch (item->BardType) {
|
||||
case 51: /* All (e.g. Singing Short Sword) */
|
||||
{
|
||||
if (item->BardValue > newbon->singingMod)
|
||||
newbon->singingMod = item->BardValue;
|
||||
if (item->BardValue > newbon->brassMod)
|
||||
@ -448,73 +450,58 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAu
|
||||
if (item->BardValue > newbon->windMod)
|
||||
newbon->windMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
case 50: /* Singing */
|
||||
{
|
||||
if (item->BardValue > newbon->singingMod)
|
||||
newbon->singingMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
case 23: /* Wind */
|
||||
{
|
||||
if (item->BardValue > newbon->windMod)
|
||||
newbon->windMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
case 24: /* stringed */
|
||||
{
|
||||
if (item->BardValue > newbon->stringedMod)
|
||||
newbon->stringedMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
case 25: /* brass */
|
||||
{
|
||||
if (item->BardValue > newbon->brassMod)
|
||||
newbon->brassMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
case 26: /* Percussion */
|
||||
{
|
||||
if (item->BardValue > newbon->percussionMod)
|
||||
newbon->percussionMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (item->SkillModValue != 0 && item->SkillModType <= HIGHEST_SKILL) {
|
||||
if ((item->SkillModValue > 0 && newbon->skillmod[item->SkillModType] < item->SkillModValue) ||
|
||||
(item->SkillModValue < 0 && newbon->skillmod[item->SkillModType] > item->SkillModValue)) {
|
||||
newbon->skillmod[item->SkillModType] = item->SkillModValue;
|
||||
newbon->skillmodmax[item->SkillModType] = item->SkillModMax;
|
||||
}
|
||||
}
|
||||
|
||||
// Add Item Faction Mods
|
||||
if (item->FactionMod1) {
|
||||
if (item->FactionAmt1 > 0 && item->FactionAmt1 > GetItemFactionBonus(item->FactionMod1)) {
|
||||
AddItemFactionBonus(item->FactionMod1, item->FactionAmt1);
|
||||
} else if (item->FactionAmt1 < 0 && item->FactionAmt1 < GetItemFactionBonus(item->FactionMod1)) {
|
||||
}
|
||||
else if (item->FactionAmt1 < 0 && item->FactionAmt1 < GetItemFactionBonus(item->FactionMod1)) {
|
||||
AddItemFactionBonus(item->FactionMod1, item->FactionAmt1);
|
||||
}
|
||||
}
|
||||
if (item->FactionMod2) {
|
||||
if (item->FactionAmt2 > 0 && item->FactionAmt2 > GetItemFactionBonus(item->FactionMod2)) {
|
||||
AddItemFactionBonus(item->FactionMod2, item->FactionAmt2);
|
||||
} else if (item->FactionAmt2 < 0 && item->FactionAmt2 < GetItemFactionBonus(item->FactionMod2)) {
|
||||
}
|
||||
else if (item->FactionAmt2 < 0 && item->FactionAmt2 < GetItemFactionBonus(item->FactionMod2)) {
|
||||
AddItemFactionBonus(item->FactionMod2, item->FactionAmt2);
|
||||
}
|
||||
}
|
||||
if (item->FactionMod3) {
|
||||
if (item->FactionAmt3 > 0 && item->FactionAmt3 > GetItemFactionBonus(item->FactionMod3)) {
|
||||
AddItemFactionBonus(item->FactionMod3, item->FactionAmt3);
|
||||
} else if (item->FactionAmt3 < 0 && item->FactionAmt3 < GetItemFactionBonus(item->FactionMod3)) {
|
||||
}
|
||||
else if (item->FactionAmt3 < 0 && item->FactionAmt3 < GetItemFactionBonus(item->FactionMod3)) {
|
||||
AddItemFactionBonus(item->FactionMod3, item->FactionAmt3);
|
||||
}
|
||||
}
|
||||
if (item->FactionMod4) {
|
||||
if (item->FactionAmt4 > 0 && item->FactionAmt4 > GetItemFactionBonus(item->FactionMod4)) {
|
||||
AddItemFactionBonus(item->FactionMod4, item->FactionAmt4);
|
||||
} else if (item->FactionAmt4 < 0 && item->FactionAmt4 < GetItemFactionBonus(item->FactionMod4)) {
|
||||
}
|
||||
else if (item->FactionAmt4 < 0 && item->FactionAmt4 < GetItemFactionBonus(item->FactionMod4)) {
|
||||
AddItemFactionBonus(item->FactionMod4, item->FactionAmt4);
|
||||
}
|
||||
}
|
||||
@ -526,10 +513,21 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAu
|
||||
else
|
||||
newbon->SkillDamageAmount[item->ExtraDmgSkill] += item->ExtraDmgAmt;
|
||||
}
|
||||
}
|
||||
|
||||
// Process when ammo_slot_item = true or false
|
||||
if (item->SkillModValue != 0 && item->SkillModType <= HIGHEST_SKILL) {
|
||||
if ((item->SkillModValue > 0 && newbon->skillmod[item->SkillModType] < item->SkillModValue) ||
|
||||
(item->SkillModValue < 0 && newbon->skillmod[item->SkillModType] > item->SkillModValue)) {
|
||||
|
||||
newbon->skillmod[item->SkillModType] = item->SkillModValue;
|
||||
newbon->skillmodmax[item->SkillModType] = item->SkillModMax;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isAug) {
|
||||
for (int i = 0; i < EmuConstants::ITEM_COMMON_SIZE; i++)
|
||||
AddItemBonuses(inst->GetAugment(i), newbon, true, false, rec_level);
|
||||
AddItemBonuses(inst->GetAugment(i), newbon, true, false, rec_level, ammo_slot_item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1303,7 +1303,7 @@ public:
|
||||
protected:
|
||||
friend class Mob;
|
||||
void CalcItemBonuses(StatBonuses* newbon);
|
||||
void AddItemBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAug = false, bool isTribute = false, int rec_override = 0);
|
||||
void AddItemBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAug = false, bool isTribute = false, int rec_override = 0, bool ammo_slot_item = false);
|
||||
void AdditiveWornBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAug = false);
|
||||
int CalcRecommendedLevelBonus(uint8 level, uint8 reclevel, int basestat);
|
||||
void CalcEdibleBonuses(StatBonuses* newbon);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user