diff --git a/ryzom/common/data_common/database.xml b/ryzom/common/data_common/database.xml index 07dafdff1..42f06afe2 100644 --- a/ryzom/common/data_common/database.xml +++ b/ryzom/common/data_common/database.xml @@ -209,6 +209,7 @@ + @@ -241,6 +242,7 @@ + @@ -262,6 +264,7 @@ + @@ -295,6 +298,7 @@ + @@ -317,6 +321,7 @@ + @@ -349,6 +354,7 @@ + @@ -376,6 +382,7 @@ + @@ -413,6 +420,7 @@ + @@ -545,6 +553,7 @@ + @@ -721,6 +730,7 @@ + diff --git a/ryzom/common/src/game_share/inventories.cpp b/ryzom/common/src/game_share/inventories.cpp index 2ac41313d..446b9db38 100644 --- a/ryzom/common/src/game_share/inventories.cpp +++ b/ryzom/common/src/game_share/inventories.cpp @@ -122,6 +122,6 @@ namespace INVENTORIES const char *InfoVersionStr = "INFO_VERSION"; 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] = - { 32, 10, 10, 3, 10, 2, 16, 32, 10, 3, 5, 1, 32, 2, 1, }; \ No newline at end of file + { 32, 10, 10, 3, 8, 10, 2, 16, 32, 10, 3, 5, 1, 32, 2, 1, }; diff --git a/ryzom/common/src/game_share/inventories.h b/ryzom/common/src/game_share/inventories.h index 6c7d0673d..ce86d215d 100644 --- a/ryzom/common/src/game_share/inventories.h +++ b/ryzom/common/src/game_share/inventories.h @@ -266,6 +266,7 @@ namespace INVENTORIES Quality, Quantity, UserColor, + Buffs, Locked, Access, Weight, diff --git a/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp b/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp index ff4abc76e..e0dc3cd6e 100644 --- a/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp +++ b/ryzom/server/src/entities_game_service/game_item_manager/game_item.cpp @@ -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 //----------------------------------------------- diff --git a/ryzom/server/src/entities_game_service/game_item_manager/game_item.h b/ryzom/server/src/entities_game_service/game_item_manager/game_item.h index dab160a0a..aefbb1257 100644 --- a/ryzom/server/src/entities_game_service/game_item_manager/game_item.h +++ b/ryzom/server/src/entities_game_service/game_item_manager/game_item.h @@ -462,6 +462,9 @@ public : // get Hit points buff sint32 focusBuff() const { return _CraftParameters == 0 ? 0 : _CraftParameters->FocusBuff; } + // get craft buffs as flags + uint8 buffFlags(); + /// get the Hit points buff provided by armors /// it must be added to hpBuff() which does not include this bonus sint32 armorHpBuff() const; diff --git a/ryzom/server/src/entities_game_service/game_item_manager/guild_inv.cpp b/ryzom/server/src/entities_game_service/game_item_manager/guild_inv.cpp index 9f9378b03..369472864 100644 --- a/ryzom/server/src/entities_game_service/game_item_manager/guild_inv.cpp +++ b/ryzom/server/src/entities_game_service/game_item_manager/guild_inv.cpp @@ -137,6 +137,7 @@ void CGuildInventoryView::updateClientSlot(uint32 slot) itemSlot.setItemProp( INVENTORIES::Quality, item->quality() ); itemSlot.setItemProp( INVENTORIES::Quantity, item->getStackSize() ); itemSlot.setItemProp( INVENTORIES::UserColor, item->color() ); + itemSlot.setItemProp( INVENTORIES::Buffs, item->buffFlags() ); itemSlot.setItemProp( INVENTORIES::Locked, 0 ); itemSlot.setItemProp( INVENTORIES::Access, item->getAccessGrade() ); itemSlot.setItemProp( INVENTORIES::Weight, item->weight() / 10 ); diff --git a/ryzom/server/src/entities_game_service/game_item_manager/player_inventory.cpp b/ryzom/server/src/entities_game_service/game_item_manager/player_inventory.cpp index 7cdf2e095..df028744b 100644 --- a/ryzom/server/src/entities_game_service/game_item_manager/player_inventory.cpp +++ b/ryzom/server/src/entities_game_service/game_item_manager/player_inventory.cpp @@ -1087,6 +1087,7 @@ void CCharacterInvView::updateClientSlot(uint32 slot, const CGameItemPtr item) itemSlot.setItemProp( INVENTORIES::Quality, item->quality() ); itemSlot.setItemProp( INVENTORIES::Quantity, item->getStackSize() ); itemSlot.setItemProp( INVENTORIES::UserColor, item->color() ); + itemSlot.setItemProp( INVENTORIES::Buffs, item->buffFlags() ); itemSlot.setItemProp( INVENTORIES::Locked, item->getLockCount() ); itemSlot.setItemProp( INVENTORIES::Access, item->getAccessGrade() ); itemSlot.setItemProp( INVENTORIES::Weight, item->weight() / 10 );