ytrid8r 5 Posted February 19, 2018 Share Posted February 19, 2018 When I use item.remove () I delete all items. How do I remove one object? Link to comment Share on other sites More sharing options...
RonnieBreathe 0 Posted February 19, 2018 Share Posted February 19, 2018 item.remove(VNUM, HOWMUCH) Google Link to comment Share on other sites More sharing options...
ytrid8r 5 Posted February 21, 2018 Author Share Posted February 21, 2018 La 2/19/2018 la 9:43, RonnieBreathe a spus: item.remove(VNUM, HOWMUCH) Google Delete all items. Link to comment Share on other sites More sharing options...
Premium North 1188 Posted February 21, 2018 Premium Share Posted February 21, 2018 using the inventory purge already made for the chat commands isn't enough? Link to comment Share on other sites More sharing options...
Active Member hachiwari 138 Posted February 21, 2018 Active Member Share Posted February 21, 2018 pc.remove_item(vnum, count) Link to comment Share on other sites More sharing options...
ytrid8r 5 Posted February 21, 2018 Author Share Posted February 21, 2018 Acum 46 minute, hachiwari a spus: pc.remove_item(vnum, count) when 20023.take with item.vnum == 50300 and game.get_event_flag("book") == 1 begin local num = number(1,54) local tomes = {50401,50402,50403,50404,50405,50406,50416,50417,50418,50419,50420,50421,50431,50432,50433,50434,50435,50436,50446,50447,50448,50449,50450,50451,50461,50462,50463,50464,50465,50466,50476,50477,50478,50479,50480,50481,50496,50495,50494,50493,50492,50491,50506,50507,50508,50509,50510,50511,50530,50531,50532,50533,50534,50535} pc.remove_item(50300, 1) pc.give_item2(tonumber(tomes[num]),1) Function pc.remove_item() delete the first item in inventory. Function item.remove delete all items. I don't speak English. Link to comment Share on other sites More sharing options...
Endymion 323 Posted February 21, 2018 Share Posted February 21, 2018 int item_remove_count(lua_State * L) { LPITEM pkItem = CQuestManager::instance().GetCurrentItem(); BYTE bCount = (BYTE)(lua_tonumber(L, 1); if (pkItem && CQuestManager::instance().GetCurrentCharacterPtr() == pkItem->GetOwner() && (pkItem->GetCount() - bCount) >= 0) pkItem->SetCount(pkItem->GetCount() - bCount); CQuestManager::instance().ClearCurrentItem(); return 0; } { "remove_count", item_remove_count }, item.remove_count(10) Link to comment Share on other sites More sharing options...
ytrid8r 5 Posted February 21, 2018 Author Share Posted February 21, 2018 Acum 15 minute, Endymion a spus: int item_remove_count(lua_State * L) { LPITEM pkItem = CQuestManager::instance().GetCurrentItem(); BYTE bCount = (BYTE)(lua_tonumber(L, 1); if (pkItem && CQuestManager::instance().GetCurrentCharacterPtr() == pkItem->GetOwner() && (pkItem->GetCount() - bCount) >= 0) pkItem->SetCount(pkItem->GetCount() - bCount); CQuestManager::instance().ClearCurrentItem(); return 0; } { "remove_count", item_remove_count }, item.remove_count(10) Where add? Link to comment Share on other sites More sharing options...
Active Member hachiwari 138 Posted February 21, 2018 Active Member Share Posted February 21, 2018 26 minut temu, ytrid8r napisał: In questlua_item.cpp Link to comment Share on other sites More sharing options...
ytrid8r 5 Posted February 21, 2018 Author Share Posted February 21, 2018 (edited) Acum 56 minute, hachiwari a spus: In questlua_item.cpp Edited August 24, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Honorable Member xP3NG3Rx 19746 Posted February 21, 2018 Honorable Member Share Posted February 21, 2018 Don't you see the problem? 1 Link to comment Share on other sites More sharing options...
ytrid8r 5 Posted February 21, 2018 Author Share Posted February 21, 2018 Acum 45 minute, xP3NG3Rx a spus: Don't you see the problem? Solved. Thanks. //item.remove_count int item_remove_count(lua_State * L) { LPITEM pkItem = CQuestManager::instance().GetCurrentItem(); //BYTE bCount = (BYTE) (lua_tonumber(L, 1); DWORD bCount = (DWORD) lua_tonumber(L, 1); if (pkItem && CQuestManager::instance().GetCurrentCharacterPtr() == pkItem->GetOwner() && (pkItem->GetCount() - bCount) >= 0) pkItem->SetCount(pkItem->GetCount() - bCount); CQuestManager::instance().ClearCurrentItem(); return 0; } //item.remove_count 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