Jump to content

Add bonus on costumes


Recommended Posts

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

14 hours ago, Chief said:

Database player.item_proto for all Costume -> magic_pct set from 0 to 100.

Hm, i know that, but i want to put add when i didnt have bns, i fixed with costume and hair but still doesn't work with costume_weapon
When i put add on costume weapon, take my 76043 but didnt put or show bonus.

 

#ifdef __COSTUME_ATTR_SYSTEM__
case USE_COSTUME_ENCHANT:
case USE_COSTUME_TRANSFORM:
{
LPITEM item2;
if (!IsValidItemPosition(DestCell) || !(item2 = GetItem(DestCell)))
return false;

if (item2->IsEquipped())
{
BuffOnAttr_RemoveBuffsFromItem(item2);
}

if (item2->IsExchanging() || item2->IsEquipped())
return false;

// if (item2->GetType() != ITEM_COSTUME)
if (item2->GetType() != ITEM_COSTUME || item2->GetSubType() == COSTUME_SASH)
{
ChatPacket(CHAT_TYPE_INFO,("Acest item nu este un costum."));
return false;
}

// if (item2->GetAttributeCount() == 0)
// {
// ChatPacket(CHAT_TYPE_INFO,("<Sistem>Pe acest costum nu poti adauga bonusuri!"));
// return false;
// }

switch (item->GetSubType())
{
case USE_COSTUME_ENCHANT:
{
int aiChangeProb[ITEM_ATTRIBUTE_MAX_LEVEL] = {100, 10, 5, 0, 0};
item2->ChangeAttribute(aiChangeProb);
ChatPacket(CHAT_TYPE_INFO,("Bonusul a fost schimbat."));
{
char buf[21];
snprintf(buf, sizeof(buf), "%u", item2->GetID());
LogManager::instance().ItemLog(this, item, "USE_COSTUME_ENCHANT", buf);
}

item->SetCount(item->GetCount() - 1);
}
break;

// case USE_COSTUME_TRANSFORM:
// {
// item2->ClearAttribute();
case USE_COSTUME_TRANSFORM:
{
if (item2->GetAttributeCount() == 4)
{
ChatPacket(CHAT_TYPE_INFO,("Nu poti adauga bonus pe acest costum."));
return false;
}

item2->ClearAttribute();

int iCostumePercent = number(1, 3);
for (int i = 0; i < iCostumePercent; ++i)
{
item2->AddAttribute();
}

int aiChangeProb[ITEM_ATTRIBUTE_MAX_LEVEL] = {100, 10, 5, 0, 0};
item2->ChangeAttribute(aiChangeProb);
ChatPacket(CHAT_TYPE_INFO,("Bonusul a fost inlocuit cu succes."));
{
char buf[21];
snprintf(buf, sizeof(buf), "%u", item2->GetID());
LogManager::instance().ItemLog(this, item, "USE_COSTUME_TRANSFORM", buf);
}

item->SetCount(item->GetCount() - 1);
}
break;
}
}
break;
#endif

Edited by FALLEN1
char
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.