uint32 Item::GetSocketsCount() { if (IsContainer()) // no sockets on containers. return 0; uint32 c = 0; for (uint32 x = 0; x < 3; x++) if (GetProto()->Sockets[x].SocketColor) c++; //prismatic socket if (GetEnchantment(PRISMATIC_ENCHANTMENT_SLOT) != NULL) c++; return c; }
uint32 Item::CountGemsWithLimitId(uint32 LimitId) { uint32 result = 0; for(uint32 count = 0; count < GetMaxSocketsCount(); count++) { EnchantmentInstance* ei = GetEnchantment(SOCK_ENCHANTMENT_SLOT1 + count); if(ei && ei->Enchantment->GemEntry ) { ItemPrototype* ip = ItemPrototypeStorage.LookupEntry(ei->Enchantment->GemEntry); if(ip && ip->ItemLimitCategory == LimitId) result++; } } return result; }
uint32 Item::CountGemsWithLimitId(uint32 LimitId) { uint32 result = 0; for( uint32 count = 0; count < GetSocketsCount(); count++ ) { EnchantmentInstance *ei = GetEnchantment( 2 + count ); if (ei && ei->Enchantment->GemEntry //huh ? Gem without entry ? ) { ItemPrototype * ip = ItemPrototypeStorage.LookupEntry(ei->Enchantment->GemEntry); if( ip && ip->ItemLimitCategory == LimitId ) result++; } } return result; }
m_pEnchantPoints->SetValue(Points); } /*=========================================================================== * End of Class Method CSrItem2Record::SetEnchantPoints() *=========================================================================*/ /*=========================================================================== * * Begin CSrItem2Record Get Field Methods * *=========================================================================*/ BEGIN_SRGETFIELD(CSrItem2Record::GetFieldEnchantment) if (m_pParent != NULL) return m_pParent->GetEditorID(String, GetEnchantment()); String.Format("0x%08X", GetEnchantment()); END_SRGETFIELD() DEFINE_SRGETFIELD(CSrItem2Record::GetFieldEnchantmentID, GetEnchantment() ? String.Format("0x%08X", GetEnchantment()) : String.Empty() ) BEGIN_SRGETFIELD(CSrItem2Record::GetFieldEnchantPoints) if (m_pEnchantPoints == NULL) { String.Empty(); } else { String.Format("%u", (dword) GetEnchantPoints()); }