keough 36 Posted November 19, 2020 (edited) I want to request a plugin @itemdestroy just like in EAMOD! When you use @itemdestroy it will destroy the item in the whole server whether it is in Inventory / Cart Inventory / Storage / Mail usage: @itemdestroy <Item ID or Item Name> It will totally destroy the item and vanish it from the server and no one will have it in an instant once you use this command just like in eaMOD Link - https://github.com/zephyrus-cr/eamod/search?q=itemdestroy This will be useful to everyone when there is a limited event. Edited November 19, 2020 by keough Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted December 3, 2020 On 11/20/2020 at 4:02 AM, keough said: I want to request a plugin @itemdestroy just like in EAMOD! eamod's `@itemdestroy` doesn't include cards so `@itemdestroy 4001` will not destroy the poring card that already slot into the equipment the purpose of this mod is just to remove certain ... event related items I guess .... hmmm .... upon reading the code, I don't really think this will work ... let me test #include "common/hercules.h" #include "map/pc.h" #include "map/itemdb.h" #include "map/storage.h" #include "common/nullpo.h" #include "plugins/HPMHooking.h" #include "common/HPMDataCheck.h" HPExport struct hplugin_info pinfo = { "itemdestroy", SERVER_TYPE_MAP, "0.1", HPM_VERSION, }; ACMD(itemdestroy) { int nameid = atoi(message); if (itemdb->exists(nameid) == 0) { clif->message(fd, "Enter a Valid Item ID. Usage: @itemdestroy <itemid>"); return false; } int i; struct map_session_data *psd; struct s_mapiterator *iter = mapit_getallusers(); for (psd = BL_UCAST(BL_PC, mapit->first(iter)); mapit->exists(iter); psd = BL_UCAST(BL_PC, mapit->next(iter))) { for (i = 0; i < MAX_INVENTORY; ++i) { // Inventory Removal if (psd->status.inventory[i].nameid != nameid) continue; pc->delitem(psd, i, psd->status.inventory[i].amount, 0, 0, LOG_TYPE_COMMAND); } for (i = 0; i < MAX_CART; ++i) { // Cart Removal if (psd->status.cart[i].nameid != nameid) continue; pc->cart_delitem(psd, i, psd->status.cart[i].amount, 0, LOG_TYPE_COMMAND); } for (i = 0; i < VECTOR_LENGTH(psd->storage.item); ++i) { // Storage Removal struct item *sitem = &VECTOR_INDEX(psd->storage.item, i); nullpo_ret(sitem); if (sitem->nameid == nameid) storage->delitem(psd, i, sitem->amount); } storage->close(psd); if (psd->status.guild_id > 0) { // Guild Storage Removal gstorage->open(sd); struct guild_storage *stor; nullpo_ret(stor=idb_get(gstorage->db, psd->status.guild_id)); for (i = 0; i < MAX_GUILD_STORAGE; ++i) { if (stor->items[i].nameid != nameid) continue; gstorage->delitem(psd, stor, i, stor->items[i].amount); } gstorage->close(psd); } } mapit->free(iter); return true; } HPExport void plugin_init(void) { addAtcommand("itemdestroy", itemdestroy); } yup doesn't work, the guild storage opens up, and there are delay between map-server and char-server when determine the client actually accessing the guild storage or not in fact, eamod's item destroy doesn't even include guild storage or mail removal /*========================================== Item Removal *------------------------------------------*/ void pc_item_remove4all(int nameid, bool char_server) { if( char_server ) chrif_item_remove4all(nameid); else { struct map_session_data *sd; struct s_mapiterator* iter; int index; iter = mapit_getallusers(); for( sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter) ) { for( index = 0; index < MAX_INVENTORY; index++ ) { // Inventory Removal if( sd->status.inventory[index].nameid != nameid ) continue; pc_delitem(sd, index, sd->status.inventory[index].amount, 0, 0, LOG_TYPE_COMMAND); } for( index = 0; index < MAX_CART; index++ ) { // Cart Removal if( sd->status.cart[index].nameid != nameid ) continue; pc_cart_delitem(sd, index, sd->status.cart[index].amount, 0, LOG_TYPE_COMMAND); } for( index = 0; index < MAX_STORAGE; index++ ) { // Storage Removal if( sd->status.storage.items[index].nameid != nameid ) continue; storage_delitem(sd, index, sd->status.storage.items[index].amount); } for( index = 0; index < MAX_EXTRA_STORAGE; index++ ) { // Extra Storage if( sd->status.ext_storage.items[index].nameid != nameid ) continue; ext_storage_delitem(sd, index, sd->status.ext_storage.items[index].amount); } } mapit_free(iter); } } this idea is fantastic, only in theory, but doesn't work on live server better just run DELETE syntax from MySQL and remove the item when server is offline 1 Neffletics reacted to this Quote Share this post Link to post Share on other sites
I want to request a plugin @itemdestroy just like in EAMOD!
When you use @itemdestroy it will destroy the item in the whole server whether it is in Inventory / Cart Inventory / Storage / Mail
usage: @itemdestroy <Item ID or Item Name>
It will totally destroy the item and vanish it from the server and no one will have it in an instant once you use this command just like in eaMOD
Link - https://github.com/zephyrus-cr/eamod/search?q=itemdestroy
This will be useful to everyone when there is a limited event.
Edited by keoughShare this post
Link to post
Share on other sites