Skill to equip Item ?

Tio Akima

New member
Messages
349
Points
0
Age
36
Discord
TioAkima#0636
Github
Tio Akima
Emulator
 
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!
 
 
 
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)

 
yes practically this ...
 
I want to know which to use function.
 
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...
 
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.

 
@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..

default_ani_meow.gif


 
Last edited by a moderator:
@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..

default_ani_meow.gif

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!
 
default_biggrin.png

 
hmm..just use the code 'if(sd){//all of it}' then fix missing directives just in case compiler start nagging...

default_ani_meow.gif


 
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:
 
gear.jpg

 
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!]
 
Last edited by a moderator:
u mean visual like a "costume item"?

sxLnXtb.png


LnmpVL4.png


or u wanna EQUIP BUT only visual visual with out Slot in General/Costume....

 
hmm..just use the code 'if(sd){//all of it}' then fix missing directives just in case compiler start nagging...

default_ani_meow.gif
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

 
hmm..just use the code 'if(sd){//all of it}' then fix missing directives just in case compiler start nagging...

default_ani_meow.gif
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

 
Back
Top