Emistry 145 Posted January 17, 2016 File Name: Usable Enchant Item File Submitter: Emistry File Submitted: 18 Jan 2016 File Category: Utility Description : Players are able to click on the Enchant items to provide custom bonus to the selected equipment. Varies of bonus could be done especially use together with a *getequippedon script command to provide a wide range of bonuses. The current items and bonuses display in the video is just a sample for demo. The origin of the idea come from Diablo and 張阿神. Preview : Click here to download this file 7 Jezu, Skyline, Prourhildr and 4 others reacted to this Quote Share this post Link to post Share on other sites
REKT 10 Posted January 17, 2016 Interesting.. Quote Share this post Link to post Share on other sites
Jezu 25 Posted January 18, 2016 +1 for this! love this! <3 Quote Share this post Link to post Share on other sites
minx123 2 Posted January 19, 2016 thank you.. very useful.. Quote Share this post Link to post Share on other sites
Fizik 2 Posted January 30, 2019 [Error]: script error in file 'pre-re/item_db.conf' item ID 6624 parse_line: need ';' * 6625: 6624: .@eqp = getequippedon(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ * 6623: * 6622: if (.@eqp & EQP_ARMOR) { * 6621: bonus bVit,100; I don't understand why i have this error, Can you help? { Id: 6625 AegisName: "High_Purity_Energy_Xtal" Name: "High Purity Energy Xtal" Buy: 6 Weight: 10 BuyingStore: true Script: <" .@eqp = getequippedon(); if (.@eqp & EQP_ARMOR) { bonus bVit,100; } if (.@eqp & EQP_HEAD_TOP) { bonus bInt,100; } if (.@eqp & EQP_SHOES) { bonus bAgi,100; } "> }, Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted January 30, 2019 (edited) plugin #include "common/hercules.h" #include "map/pc.h" #include "common/HPMDataCheck.h" HPExport struct hplugin_info pinfo = { "getequippedon", SERVER_TYPE_MAP, "x_O", HPM_VERSION, }; BUILDIN(getequippedon) { int i = status->current_equip_item_index; struct map_session_data *sd = script->rid2sd(st); if ( sd == NULL ) return true; if ( i == EQI_HAND_L ) script_pushint( st, sd->inventory_data[i]->type == IT_ARMOR ? EQP_SHIELD : EQP_WEAPON ); else script_pushint( st, sd->status.inventory[i].equip ); return true; } HPExport void plugin_init (void) { addScriptCommand( "getequippedon", "", getequippedon ); } seems to be working, although in the example given, the jellopy supposed only give bonus to armor, headgear and shoes but I can enchant my jellopy to shields, it doesn't give any bonus and waste my item perhaps the scripting part should add another check and add 3rd argument EQP_ check to only allow those area Edited January 30, 2019 by AnnieRuru Quote Share this post Link to post Share on other sites
4144 364 Posted January 30, 2019 Error in plugin. i can be -1. and this is invalid index. 1 AnnieRuru reacted to this Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted January 31, 2019 (edited) well theoretically, yes but I read the script, then no, because IF this custom script command is only specially made for this purpose, then it never get -1 but ... might as well just fix it #include "common/hercules.h" #include "map/pc.h" #include "common/HPMDataCheck.h" HPExport struct hplugin_info pinfo = { "getequippedon", SERVER_TYPE_MAP, "x_O", HPM_VERSION, }; BUILDIN(getequippedon) { int i = status->current_equip_item_index; struct map_session_data *sd = script->rid2sd(st); if ( sd == NULL ) return true; if ( i < 0 || sd->inventory_data[i] == NULL ) script_pushint( st, 0 ); else if ( i == EQI_HAND_L ) script_pushint( st, sd->inventory_data[i]->type == IT_ARMOR ? EQP_SHIELD : EQP_WEAPON ); else script_pushint( st, sd->status.inventory[i].equip ); return true; } HPExport void plugin_init (void) { addScriptCommand( "getequippedon", "", getequippedon ); } Edited January 31, 2019 by AnnieRuru Quote Share this post Link to post Share on other sites