Premium EnKor 42 Posted January 6, 2017 Premium Share Posted January 6, 2017 (edited) Hi there. I have installed this system in my server, but i have one crazy bug. if i add same costume to transfer bonus from SLOT2 to SLOT1 (but with same costume), my core go down. print can any one help me to make a function to return if item from SLOT2 have same id as item in SLOT1? i have to add that function in here. But have no ideia how to do it. void AttrTransfer_add_item(LPCHARACTER ch, int w_index, int i_index) { LPITEM item; LPITEM *attr_transfer_item; RETURN_IF_ATTR_TRANSFER_IS_NOT_OPENED(ch); if (i_index < 0 || INVENTORY_MAX_NUM <= i_index || w_index < 0 || MAX_ATTR_TRANSFER_SLOT <= w_index) return; item = ch->GetInventoryItem(i_index); if (item == NULL) return; if (w_index == 0 && item->GetType() != ITEM_TRANSFER_SCROLL) return; if ((w_index == 1 && item->GetType() != ITEM_COSTUME )|| (w_index == 2 && item->GetType() != ITEM_COSTUME)) return; if (gAttrTransferLimit != 1 && item->GetSubType() != COSTUME_BODY) return; attr_transfer_item = ch->GetAttrTransferItem(); for (int i = 0; i < MAX_ATTR_TRANSFER_SLOT; ++i) { if (item == attr_transfer_item[i]) { attr_transfer_item[i] = NULL; break; } } if (w_index != 0 && attr_transfer_item[0] == NULL) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<Attr Transfer> For do this, you must add the Transfer Scroll into their slot.")); return; } else if (w_index == 2 && item->GetSubType() != attr_transfer_item[1]->GetSubType()) { return; } if (w_index == 2) { ch->ChatPacket(CHAT_TYPE_COMMAND, "AttrTransferMessage"); } attr_transfer_item[w_index] = item; if (test_server) ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<Attr Transfer> attach from inventory slot number [%d] to attr transfer slot number [%d]."), i_index, w_index); return; } ACMD(do_attr_transfer) { sys_log(1, "%s has used an Attr Transfer command: %s.", ch->GetName(), argument); int w_index = 0, i_index = 0; const char *line; char arg1[256], arg2[256], arg3[256]; line = two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2)); one_argument(line, arg3, sizeof(arg3)); if (0 == arg1[0]) { ch->ChatPacket(CHAT_TYPE_INFO, "Usage:"); ch->ChatPacket(CHAT_TYPE_INFO, "- attrtransfer open"); ch->ChatPacket(CHAT_TYPE_INFO, "- attrtransfer close"); ch->ChatPacket(CHAT_TYPE_INFO, "- attrtransfer add <attr_transfer_slot> <inventory_slot>"); ch->ChatPacket(CHAT_TYPE_INFO, "- attrtransfer delete <attr_transfer_slot>"); return; } const std::string& strArg1 = std::string(arg1); if (strArg1 == "open") { AttrTransfer_open(ch); return; } else if (strArg1 == "close") { AttrTransfer_close(ch); return; } else if (strArg1 == "make") { AttrTransfer_make(ch); return; } else if (strArg1 == "add") { if (0 == arg2[0] || !isdigit(*arg2) || 0 == arg3[0] || !isdigit(*arg3)) return; str_to_number(w_index, arg2); str_to_number(i_index, arg3); AttrTransfer_add_item(ch, w_index, i_index); return; } else if (strArg1 == "delete") { if (0 == arg2[0] || !isdigit(*arg2)) return; str_to_number(w_index, arg2); AttrTransfer_delete_item(ch, w_index); return; } switch (LOWER(arg1[0])) { case 'o': AttrTransfer_open(ch); break; case 'c': AttrTransfer_close(ch); break; case 'm': AttrTransfer_make(ch); break; case 'a': { if (0 == arg2[0] || !isdigit(*arg2) || 0 == arg3[0] || !isdigit(*arg3)) return; str_to_number(w_index, arg2); str_to_number(i_index, arg3); AttrTransfer_add_item(ch, w_index, i_index); } break; case 'd': { if (0 == arg2[0] || !isdigit(*arg2)) return; str_to_number(w_index, arg2); AttrTransfer_delete_item(ch, w_index); } break; default: return; } } Edited August 24, 2022 by Metin2 Dev Core X - External 2 Internal if pc.get_sex() == true and npc.get_sex() == false then npc.purge() end Link to comment Share on other sites More sharing options...
cekaskartos8 1 Posted June 18, 2018 Share Posted June 18, 2018 same bug Link to comment Share on other sites More sharing options...
cekaskartos8 1 Posted June 19, 2018 Share Posted June 19, 2018 up Link to comment Share on other sites More sharing options...
Driguezgames 5 Posted June 19, 2018 Share Posted June 19, 2018 Cmd_general.cpp i think Link to comment Share on other sites More sharing options...
cekaskartos8 1 Posted June 19, 2018 Share Posted June 19, 2018 up Link to comment Share on other sites More sharing options...
Premium EnKor 42 Posted April 14, 2019 Author Premium Share Posted April 14, 2019 up if pc.get_sex() == true and npc.get_sex() == false then npc.purge() end Link to comment Share on other sites More sharing options...
avertuss 48 Posted April 19, 2019 Share Posted April 19, 2019 Same problem. Any ideas? Link to comment Share on other sites More sharing options...
avertuss 48 Posted April 26, 2019 Share Posted April 26, 2019 up Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now