Metin2 EP, Valorant VP dahil tüm oyun ürünlerini en uygun fiyatlarla bulabilir, Item ve Karakterlerinizi hızlıca satabilirsiniz. HEMEN TIKLA!
int CItem::AddNewStyleAttribute(BYTE* bValues)
{
int iAttributeSet = GetAttributeSetIndex();
if (iAttributeSet < 0)
return 1;
// 1 = unknown attribute
// 2 = not enough attribute size
// 3 = success
bool have_addon = false;
TItemTable const* pProto = GetProto();
if (pProto && pProto->sAddonType)
have_addon = true;
for (int apply = 0; apply < MAX_APPLY_NUM; ++apply)
{
const TItemAttrTable& r = g_map_itemAttr[apply];
for (int i = 0; i < (have_addon ? 3 : 5); ++i)
{
if (!r.bMaxLevelBySet[iAttributeSet] && (apply == bValues[i]))
{
sys_err("Trying to add unknown attribute to item: bValue: %d", bValues[i]);
return 1;
}
}
}
std::vector<BYTE> vec_bTypes;
for (int i = 0; i < (have_addon ? 3 : 5); ++i)
vec_bTypes.push_back(bValues[i]);
std::sort(vec_bTypes.begin(), vec_bTypes.end());
vec_bTypes.erase(std::unique(vec_bTypes.begin(), vec_bTypes.end()), vec_bTypes.end());
if (have_addon && vec_bTypes.size() == 3)
{
ClearAttribute(false);
ApplyAddon(pProto->sAddonType);
AddAttr(vec_bTypes[0], number(1, 5));
AddAttr(vec_bTypes[1], number(1, 5));
AddAttr(vec_bTypes[2], number(1, 5));
sys_log(0, "CItem::AddNewStyleAttribute(vec_bTypes[0]: %d, vec_bTypes[1]: %d, vec_bTypes[2]: %d, vec_bTypes[3]: %d, vec_bTypes[4]: %d)", vec_bTypes[0], vec_bTypes[1], vec_bTypes[2], vec_bTypes[3], vec_bTypes[4]);
return 3;
}
bool bNormSucc = false;
if (vec_bTypes.size() == 5)
{
ClearAttribute(false);
for (itertype(vec_bTypes) it = vec_bTypes.begin(); it != vec_bTypes.end(); ++it)
{
AddAttr(*it, number(1, 5));
}
sys_log(0, "CItem::AddNewStyleAttribute(vec_bTypes[0]: %d, vec_bTypes[1]: %d, vec_bTypes[2]: %d, vec_bTypes[3]: %d, vec_bTypes[4]: %d)", vec_bTypes[0], vec_bTypes[1], vec_bTypes[2], vec_bTypes[3], vec_bTypes[4]);
bNormSucc = true;
}
else { return 2; }
sys_log(0, "CItem::AddNewStyleAttribute(bNormSucc: %d", bNormSucc);
if (bNormSucc)
return 3;
return 1;
}
bool CHARACTER::UseItemNewAttribute(TItemPos source_pos, TItemPos target_pos, BYTE* bValues)
{
LPITEM item;
LPITEM item_target;
for (int i = 0; i < 5; ++i)
{
if (bValues[i] < 0 || bValues[i] > 255)
return false;
}
if (!CanHandleItem())
return false;
if (!IsValidItemPosition(source_pos) || !(item = GetItem(source_pos)))
return false;
if (!IsValidItemPosition(target_pos) || !(item_target = GetItem(target_pos)))
return false;
if (item->GetVnum() != 71051)
return false;
if (item->IsExchanging())
return false;
if (item_target->IsExchanging())
return false;
if (item_target->IsEquipped())
return false;
if (ITEM_COSTUME == item_target->GetType())
return false;
if (item_target->GetVnum() == 50201 || item_target->GetVnum() == 50202 || item_target->GetVnum() == 11901 || item_target->GetVnum() == 11902 || item_target->GetVnum() == 11903 || item_target->GetVnum() == 11904 || item_target->GetVnum() == 11911 || item_target->GetVnum() == 11912 || item_target->GetVnum() == 11913 || item_target->GetVnum() == 11914)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't apply this attribute on this item."));
return false;
}
int processNewAttr = item_target->AddNewStyleAttribute(bValues);
if (processNewAttr == 1)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't apply this attribute on this item."));
return false;
}
else if (processNewAttr == 2)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't apply an attribute twice."));
return false;
}
else if (processNewAttr == 3)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Attributes has been added successfully!"));
item->SetCount(item->GetCount() - 1);
return true;
}
//sys_log(0, "%s: UseItemNewAttribute %s (inven %d, cell: %d)", GetName(), item->GetName(), window_type, wCell);
return false;
}
Yapacağınız şeyi kısaca açıklayım döngüde var olan efsunları alıp efsun ortalama veya beceri ise o efsuna döngü geldiğinde orayı atlatmak olmalı. Veya birçok serverin başvurduğu gibi o itemlere kadim efsun attırmamanız lazım.++++++++++++++
Yapacağınız şeyi kısaca açıklayım döngüde var olan efsunları alıp efsun ortalama veya beceri ise o efsuna döngü geldiğinde orayı atlatmak olmalı. Veya birçok serverin başvurduğu gibi o itemlere kadim efsun attırmamanız lazım.++++++++++++++
cevap için teşekkürler işte sorun c++ bilgim olmadığı için tamamlayamıyorumYapacağınız şeyi kısaca açıklayım döngüde var olan efsunları alıp efsun ortalama veya beceri ise o efsuna döngü geldiğinde orayı atlatmak olmalı. Veya birçok serverin başvurduğu gibi o itemlere kadim efsun attırmamanız lazım.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?