Add buff flags to item summary

ryzomclassic-develop
kaetemi 4 years ago
parent d512d10f18
commit be28e102ec

@ -209,6 +209,7 @@
<leaf name="QUALITY" type="I10" /> <leaf name="QUALITY" type="I10" />
<leaf name="QUANTITY" type="I10" /> <leaf name="QUANTITY" type="I10" />
<leaf name="USER_COLOR" type="I3" /> <leaf name="USER_COLOR" type="I3" />
<leaf name="CHARAC_BUFFS" type="I8" />
<leaf name="LOCKED" type="I10" /> <leaf name="LOCKED" type="I10" />
<leaf name="ACCESS" type="I2" /> <leaf name="ACCESS" type="I2" />
<leaf name="WEIGHT" type="I16" /> <leaf name="WEIGHT" type="I16" />
@ -241,6 +242,7 @@
<leaf name="QUALITY" type="I10" /> <leaf name="QUALITY" type="I10" />
<leaf name="QUANTITY" type="I10" /> <leaf name="QUANTITY" type="I10" />
<leaf name="USER_COLOR" type="I3" /> <leaf name="USER_COLOR" type="I3" />
<leaf name="CHARAC_BUFFS" type="I8" /> <!-- flags based on TCharacteristics -->
<!-- <leaf name="LOCKED" type="I10" /> --> <!-- <leaf name="LOCKED" type="I10" /> -->
<!-- <leaf name="ACCESS" type="I2" /> --> <!-- TGuildGrade access grade --> <!-- <leaf name="ACCESS" type="I2" /> --> <!-- TGuildGrade access grade -->
<leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE --> <leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE -->
@ -262,6 +264,7 @@
<leaf name="QUALITY" type="I10" /> <leaf name="QUALITY" type="I10" />
<leaf name="QUANTITY" type="I10" /> <leaf name="QUANTITY" type="I10" />
<leaf name="USER_COLOR" type="I3" /> <leaf name="USER_COLOR" type="I3" />
<leaf name="CHARAC_BUFFS" type="I8" /> <!-- flags based on TCharacteristics -->
<!-- <leaf name="LOCKED" type="I10" /> --> <!-- <leaf name="LOCKED" type="I10" /> -->
<!-- <leaf name="ACCESS" type="I2" /> --> <!-- TGuildGrade access grade --> <!-- <leaf name="ACCESS" type="I2" /> --> <!-- TGuildGrade access grade -->
<leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE --> <leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE -->
@ -295,6 +298,7 @@
<leaf name="QUALITY" type="I10" /> <leaf name="QUALITY" type="I10" />
<leaf name="QUANTITY" type="I10" /> <leaf name="QUANTITY" type="I10" />
<leaf name="USER_COLOR" type="I3" /> <leaf name="USER_COLOR" type="I3" />
<leaf name="CHARAC_BUFFS" type="I8" /> <!-- flags based on TCharacteristics -->
<leaf name="LOCKED" type="I10" /> <leaf name="LOCKED" type="I10" />
<leaf name="ACCESS" type="I2" /> <!-- TGuildGrade access grade --> <leaf name="ACCESS" type="I2" /> <!-- TGuildGrade access grade -->
<leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE --> <leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE -->
@ -317,6 +321,7 @@
<leaf name="QUALITY" type="I10" /> <leaf name="QUALITY" type="I10" />
<leaf name="QUANTITY" type="I10" /> <leaf name="QUANTITY" type="I10" />
<leaf name="USER_COLOR" type="I3" /> <leaf name="USER_COLOR" type="I3" />
<leaf name="CHARAC_BUFFS" type="I8" /> <!-- flags based on TCharacteristics -->
<leaf name="LOCKED" type="I10" /> <leaf name="LOCKED" type="I10" />
<leaf name="ACCESS" type="I2" /> <!-- TGuildGrade access grade --> <leaf name="ACCESS" type="I2" /> <!-- TGuildGrade access grade -->
<leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE --> <leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE -->
@ -349,6 +354,7 @@
<leaf name="QUALITY" type="I10" /> <leaf name="QUALITY" type="I10" />
<leaf name="QUANTITY" type="I10" /> <leaf name="QUANTITY" type="I10" />
<leaf name="USER_COLOR" type="I3" /> <leaf name="USER_COLOR" type="I3" />
<leaf name="CHARAC_BUFFS" type="I8" /> <!-- flags based on TCharacteristics -->
<!-- <leaf name="LOCKED" type="I10" /> --> <!-- <leaf name="LOCKED" type="I10" /> -->
<!-- <leaf name="ACCESS" type="I2" /> --> <!-- TGuildGrade access grade --> <!-- <leaf name="ACCESS" type="I2" /> --> <!-- TGuildGrade access grade -->
<leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE --> <leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE -->
@ -376,6 +382,7 @@
<leaf name="QUALITY" type="I10" /> <leaf name="QUALITY" type="I10" />
<leaf name="QUANTITY" type="I10" /> <leaf name="QUANTITY" type="I10" />
<leaf name="USER_COLOR" type="I3" /> <leaf name="USER_COLOR" type="I3" />
<leaf name="CHARAC_BUFFS" type="I8" /> <!-- flags based on TCharacteristics -->
<!-- <leaf name="LOCKED" type="I10" /> --> <!-- <leaf name="LOCKED" type="I10" /> -->
<!-- <leaf name="ACCESS" type="I2" /> --> <!-- TGuildGrade access grade --> <!-- <leaf name="ACCESS" type="I2" /> --> <!-- TGuildGrade access grade -->
<leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE --> <leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE -->
@ -413,6 +420,7 @@
<leaf name="QUALITY" type="I10" /> <leaf name="QUALITY" type="I10" />
<leaf name="QUANTITY" type="I10" /> <leaf name="QUANTITY" type="I10" />
<leaf name="USER_COLOR" type="I3" /> <leaf name="USER_COLOR" type="I3" />
<leaf name="CHARAC_BUFFS" type="I8" /> <!-- flags based on TCharacteristics -->
<leaf name="LOCKED" type="I10" /> <leaf name="LOCKED" type="I10" />
<leaf name="ACCESS" type="I2" /> <!-- TGuildGrade access grade --> <leaf name="ACCESS" type="I2" /> <!-- TGuildGrade access grade -->
<leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE --> <leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE -->
@ -545,6 +553,7 @@
<leaf name="QUALITY" type="I10" /> <leaf name="QUALITY" type="I10" />
<leaf name="QUANTITY" type="I10" /> <leaf name="QUANTITY" type="I10" />
<leaf name="USER_COLOR" type="I3" /> <leaf name="USER_COLOR" type="I3" />
<leaf name="CHARAC_BUFFS" type="I8" /> <!-- flags based on TCharacteristics -->
<!-- <leaf name="LOCKED" type="I10" /> --> <!-- <leaf name="LOCKED" type="I10" /> -->
<!-- <leaf name="ACCESS" type="I2" /> --> <!-- TGuildGrade access grade --> <!-- <leaf name="ACCESS" type="I2" /> --> <!-- TGuildGrade access grade -->
<leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE --> <leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE -->
@ -721,6 +730,7 @@
<leaf name="QUALITY" type="I10" /> <leaf name="QUALITY" type="I10" />
<leaf name="QUANTITY" type="I10" /> <leaf name="QUANTITY" type="I10" />
<leaf name="USER_COLOR" type="I3" /> <leaf name="USER_COLOR" type="I3" />
<leaf name="CHARAC_BUFFS" type="I8" /> <!-- flags based on TCharacteristics -->
<leaf name="LOCKED" type="I10" /> <leaf name="LOCKED" type="I10" />
<leaf name="ACCESS" type="I2" /> <!-- TGuildGrade access grade --> <leaf name="ACCESS" type="I2" /> <!-- TGuildGrade access grade -->
<leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE --> <leaf name="WEIGHT" type="I16" /> <!-- weight. see DB_WEIGHT_SCALE -->

@ -122,6 +122,6 @@ namespace INVENTORIES
const char *InfoVersionStr = "INFO_VERSION"; const char *InfoVersionStr = "INFO_VERSION";
const char *CItemSlot::ItemPropStr [NbItemPropId] = const char *CItemSlot::ItemPropStr [NbItemPropId] =
{ "SHEET", "QUALITY", "QUANTITY", "USER_COLOR", "LOCKED", "ACCESS", "WEIGHT", "NAMEID", "ENCHANT", "RM_CLASS_TYPE", "RM_FABER_STAT_TYPE", "PREREQUISIT_VALID", "PRICE", "RESALE_FLAG", "WORNED" }; { "SHEET", "QUALITY", "QUANTITY", "USER_COLOR", "BUFFS", "LOCKED", "ACCESS", "WEIGHT", "NAMEID", "ENCHANT", "RM_CLASS_TYPE", "RM_FABER_STAT_TYPE", "PREREQUISIT_VALID", "PRICE", "RESALE_FLAG", "WORNED" };
const uint CItemSlot::DataBitSize [NbItemPropId] = const uint CItemSlot::DataBitSize [NbItemPropId] =
{ 32, 10, 10, 3, 10, 2, 16, 32, 10, 3, 5, 1, 32, 2, 1, }; { 32, 10, 10, 3, 8, 10, 2, 16, 32, 10, 3, 5, 1, 32, 2, 1, };

@ -266,6 +266,7 @@ namespace INVENTORIES
Quality, Quality,
Quantity, Quantity,
UserColor, UserColor,
Buffs,
Locked, Locked,
Access, Access,
Weight, Weight,

@ -3171,6 +3171,26 @@ uint32 CGameItem::magicResistance(RESISTANCE_TYPE::TResistanceType resistanceTyp
} }
} }
// get craft buffs as flags
uint8 CGameItem::buffFlags()
{
if (_CraftParameters)
{
uint8_t res = 0;
if (_CraftParameters->HpBuff)
res |= (1 << CHARACTERISTICS::constitution);
if (_CraftParameters->SapBuff)
res |= (1 << CHARACTERISTICS::intelligence);
if (_CraftParameters->StaBuff)
res |= (1 << CHARACTERISTICS::strength);
if (_CraftParameters->FocusBuff)
res |= (1 << CHARACTERISTICS::dexterity);
// space is reserved for regen buffs
return res;
}
return 0;
}
//----------------------------------------------- //-----------------------------------------------
// armorHpBuff // armorHpBuff
//----------------------------------------------- //-----------------------------------------------

@ -462,6 +462,9 @@ public :
// get Hit points buff // get Hit points buff
sint32 focusBuff() const { return _CraftParameters == 0 ? 0 : _CraftParameters->FocusBuff; } sint32 focusBuff() const { return _CraftParameters == 0 ? 0 : _CraftParameters->FocusBuff; }
// get craft buffs as flags
uint8 buffFlags();
/// get the Hit points buff provided by armors /// get the Hit points buff provided by armors
/// it must be added to hpBuff() which does not include this bonus /// it must be added to hpBuff() which does not include this bonus
sint32 armorHpBuff() const; sint32 armorHpBuff() const;

@ -137,6 +137,7 @@ void CGuildInventoryView::updateClientSlot(uint32 slot)
itemSlot.setItemProp( INVENTORIES::Quality, item->quality() ); itemSlot.setItemProp( INVENTORIES::Quality, item->quality() );
itemSlot.setItemProp( INVENTORIES::Quantity, item->getStackSize() ); itemSlot.setItemProp( INVENTORIES::Quantity, item->getStackSize() );
itemSlot.setItemProp( INVENTORIES::UserColor, item->color() ); itemSlot.setItemProp( INVENTORIES::UserColor, item->color() );
itemSlot.setItemProp( INVENTORIES::Buffs, item->buffFlags() );
itemSlot.setItemProp( INVENTORIES::Locked, 0 ); itemSlot.setItemProp( INVENTORIES::Locked, 0 );
itemSlot.setItemProp( INVENTORIES::Access, item->getAccessGrade() ); itemSlot.setItemProp( INVENTORIES::Access, item->getAccessGrade() );
itemSlot.setItemProp( INVENTORIES::Weight, item->weight() / 10 ); itemSlot.setItemProp( INVENTORIES::Weight, item->weight() / 10 );

@ -1087,6 +1087,7 @@ void CCharacterInvView::updateClientSlot(uint32 slot, const CGameItemPtr item)
itemSlot.setItemProp( INVENTORIES::Quality, item->quality() ); itemSlot.setItemProp( INVENTORIES::Quality, item->quality() );
itemSlot.setItemProp( INVENTORIES::Quantity, item->getStackSize() ); itemSlot.setItemProp( INVENTORIES::Quantity, item->getStackSize() );
itemSlot.setItemProp( INVENTORIES::UserColor, item->color() ); itemSlot.setItemProp( INVENTORIES::UserColor, item->color() );
itemSlot.setItemProp( INVENTORIES::Buffs, item->buffFlags() );
itemSlot.setItemProp( INVENTORIES::Locked, item->getLockCount() ); itemSlot.setItemProp( INVENTORIES::Locked, item->getLockCount() );
itemSlot.setItemProp( INVENTORIES::Access, item->getAccessGrade() ); itemSlot.setItemProp( INVENTORIES::Access, item->getAccessGrade() );
itemSlot.setItemProp( INVENTORIES::Weight, item->weight() / 10 ); itemSlot.setItemProp( INVENTORIES::Weight, item->weight() / 10 );

Loading…
Cancel
Save