Jump to content
  • 0

I have problem with new script command


Mechomorph XD

Question


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  71
  • Reputation:   1
  • Joined:  03/06/12
  • Last Seen:  

I want to do a new script command, It's can return value of refinable.

Syntax : getcanrefine(item_id), It'll return 1 when that item can refine or 0 when can't

But in itemdb.h on item_data structure, no have about refinable variable. How to add it and where?

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  2
  • Reputation:   0
  • Joined:  01/07/12
  • Last Seen:  

BUILDIN_FUNC(getcanrefine)

{

int itemid;

struct item_data* i_data;

TBL_PC *sd;

sd = script_rid2sd(st);

if( sd == NULL )

return 0;

itemid = script_getnum(st,2);

i_data = itemdb_exists(itemid);

if( i_data <= 0) {

return 0;

}

script_pushint(st,i_data->flag.no_refine);

return 0;

}

Edited by zxb329622888
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  71
  • Reputation:   1
  • Joined:  03/06/12
  • Last Seen:  

Thank You, Girl :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  71
  • Reputation:   1
  • Joined:  03/06/12
  • Last Seen:  

[Warning]: Unexpected type for argument 1. Expected string.
[Debug]: Data: number value=1
[Debug]: Function: mes

above code had warning :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   104
  • Joined:  11/19/11
  • Last Seen:  

mes ""+getcanrefine(itemid);

red part convert int to string

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  71
  • Reputation:   1
  • Joined:  03/06/12
  • Last Seen:  

thank you girl :)

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

huh ? why add a new 1 when we already have this ?

*getequipisenableref(<equipment slot>)

Will return 1 if the item equipped on the invoking character in the specified 
equipment slot is refinable, and 0 if it isn't. For a list of equipment slots 
see 'getequipid'.

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...