Jump to content
  • 0
Tio Akima

Skill to equip Item ?

Question

 
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!
 
 

Share this post


Link to post
Share on other sites

12 answers to this question

Recommended Posts

  • 0

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)

Share this post


Link to post
Share on other sites
  • 0
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...

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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

 

:meow:

Share this post


Link to post
Share on other sites
  • 0

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

 

:meow:

 

 

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!
 
:D

Share this post


Link to post
Share on other sites
  • 0

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!]
Edited by akima

Share this post


Link to post
Share on other sites
  • 0

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

 

:meow:

 

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

Share this post


Link to post
Share on other sites
  • 0

 

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

 

:meow:

 

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.