Tio Akima 74 Posted January 5, 2015 Skill to equip an item? Anyone know how to do a skill to equip an item? NOTE: the player does not need to have the item ... so do not need to do this check! Quote Share this post Link to post Share on other sites
0 exchisu 3 Posted January 5, 2015 U mean like... the Reins of Mount, have a skill for all the players like a platinum skill ? u just use the Skill and dont need to Use the Item (reins of mount) Quote Share this post Link to post Share on other sites
0 Tio Akima 74 Posted January 5, 2015 yes practically this ... I want to know which to use function. Quote Share this post Link to post Share on other sites
0 exchisu 3 Posted January 5, 2015 yes practically this ... I want to know which to use function. is a custom command @aura by Amod Quote Share this post Link to post Share on other sites
0 Tio Akima 74 Posted January 5, 2015 I think you do not know what I want ... want to make a skill to equip an item! to make a skill that ... I need a function that does it! but thanks for trying to help... Quote Share this post Link to post Share on other sites
0 GmOcean 92 Posted January 6, 2015 In order for a skill to equip an item, it must be in their inventory. You could have the skill create the item, and then equip it. But regardless of the choice, it must be in the inventory. Quote Share this post Link to post Share on other sites
0 malufett 247 Posted January 6, 2015 @skill.c int skill_castend_nodamage_id(struc ...case CUSTOM_WEAR_ARMOR:if ( sd ) { struct item_data *item_data; int itemid = 2301; // cotton shirt if ( (item_data = itemdb->exists(itemid)) != NULL ) { struct item it; memset(&it, 0, sizeof(it)); it.nameid = itemid; it.identify = 1; item_data->flag.autoequip = 1; clif->skill_nodamage(src, bl, skill_id, skill_lv, !pc->additem(sd, &it, 1, LOG_TYPE_NONE)); }}break; just add on the 'OnUnequipScript' to delete the item when taken off.. Quote Share this post Link to post Share on other sites
0 Tio Akima 74 Posted January 6, 2015 @skill.c int skill_castend_nodamage_id(struc ...case CUSTOM_WEAR_ARMOR:if ( sd ) { struct item_data *item_data; int itemid = 2301; // cotton shirt if ( (item_data = itemdb->exists(itemid)) != NULL ) { struct item it; memset(&it, 0, sizeof(it)); it.nameid = itemid; it.identify = 1; item_data->flag.autoequip = 1; clif->skill_nodamage(src, bl, skill_id, skill_lv, !pc->additem(sd, &it, 1, LOG_TYPE_NONE)); }}break; just add on the 'OnUnequipScript' to delete the item when taken off.. Nice Maluffet! thanks you much! if I want to put this code in Clif.c file need to change something? the variables are the same? because I will this code in various skills ... so putting in a function in clif.c file .... I just use the function. would be more automated and much easier! Quote Share this post Link to post Share on other sites
0 malufett 247 Posted January 6, 2015 hmm..just use the code 'if(sd){//all of it}' then fix missing directives just in case compiler start nagging... Quote Share this post Link to post Share on other sites
0 Tio Akima 74 Posted January 6, 2015 (edited) Look, I'm trying this: clif.h void (*equipitem_on) (int id_item); clif.c void clif_equipitem_on(int id_item){ if ( sd ) { struct item_data *item_data; int itemid = id_item; // cotton shirt if ( (item_data = itemdb->exists(itemid)) != NULL ) { struct item it; memset(&it, 0, sizeof(it)); it.nameid = itemid; it.identify = 1; item_data->flag.autoequip = 1; clif->skill_nodamage(src, bl, skill_id, skill_lv, !pc->additem(sd, &it, 1, LOG_TYPE_NONE)); } } break; } but the build error of several undeclared variables ... @EDIT: actually I do not want the player to receive an item. when using the Skill, is equipped in the player an item that he has not. and use the skill again, this item disappears. A purely visual item: look at this: the player with a hat equipped but no slot used. the skill is to equip and unequip this item ... what I'm trying to do! [NOTE:This skill I want to do is to add an item in the player ... but only visual item ... through skill!] Edited January 7, 2015 by akima Quote Share this post Link to post Share on other sites
0 exchisu 3 Posted January 7, 2015 u mean visual like a "costume item"? or u wanna EQUIP BUT only visual visual with out Slot in General/Costume.... Quote Share this post Link to post Share on other sites
0 Tio Akima 74 Posted January 9, 2015 hmm..just use the code 'if(sd){//all of it}' then fix missing directives just in case compiler start nagging... so can equip the item without creating it ... if(sd){ struct item_data *id; id = itemdb->exists(ItemId); sd->status.head_top = id->look; clif->changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top); } now I need to cut it Quote Share this post Link to post Share on other sites
0 reds09 1 Posted February 19, 2015 hmm..just use the code 'if(sd){//all of it}' then fix missing directives just in case compiler start nagging... so can equip the item without creating it ... if(sd){ struct item_data *id; id = itemdb->exists(ItemId); sd->status.head_top = id->look; clif->changelook(&sd->bl,LOOK_HEAD_TOP,sd->status.head_top); } now I need to cut it if succeeded, could teach me how to do this, use a skill and equip a team? would be grateful Quote Share this post Link to post Share on other sites
Share this post
Link to post
Share on other sites