Jump to content
  • 0

BUILDIN_FUNC(downrefitem) Script


jingcleovil

Question


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   3
  • Joined:  04/24/12
  • Last Seen:  

Hi

Currently I am using 16084 revision. I am not upgrading my current version because its quite stable in our end. Players enjoy playing smoothly. Now I merged BUILDIN_FUNC(downrefitem) to my current svn but it says "equip" is undeclared. If anyone have an idea what part did I missed.

Here is the code I manually put in.

../src/map/script.c


BUILDIN_DEF(downrefitem,"i"),


/*==========================================
* Downgrades an Equipment Part by -1 . [Masao]
*------------------------------------------*/
BUILDIN_FUNC(downrefitem)
{
int i = -1,num,ep;
TBL_PC *sd;
num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
 return 0;
if (num > 0 && num <= ARRAYLENGTH(equip))
 i = pc_checkequip(sd,equip[num-1]);
if(i >= 0) {
 ep = sd->status.inventory[i].equip;
 //Logs items, got from (N)PC scripts [Lupus]
 log_pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i]);
 sd->status.inventory[i].refine++;
 pc_unequipitem(sd,i,2); // status calc will happen in pc_equipitem() below
 clif_refine(sd->fd,2,i,sd->status.inventory[i].refine = sd->status.inventory[i].refine - 2);
 clif_delitem(sd,i,1,3);
 //Logs items, got from (N)PC scripts [Lupus]
 log_pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory[i]);
 clif_additem(sd,i,1,0);
 pc_equipitem(sd,i,ep);
 clif_misceffect(&sd->bl,2);
}
return 0;
}

I just want to know what part is missing.

Edited by AnnieRuru
Please use [CODEBOX] for long contents.
Link to comment
Share on other sites

6 answers to this question

Recommended Posts


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

i dont think it's source problem...

r16126 this is the only changeset i found that related with downrefitem() command

i think it's your script problem....

if you are lookiing supports for your script...show your script.....

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Now I merged BUILDIN_FUNC(downrefitem) to my current svn

Have you recompile your server after you merge the downrefitem command?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   3
  • Joined:  04/24/12
  • Last Seen:  

Sorry for not giving the exact details of errors. During compilation the error says

script.c: In function ‘buildin_downrefitem’:
script.c:4095:24: error: ‘equip’ undeclared (first use in this function)
script.c:4095:24: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [obj_sql/script.o] Error 1
make[1]: Leaving directory `/home/$USER/Ragnarok/SERVERS/16084_trunk/src/map'
make: *** [map_sql] Error 2

I dont want to upgrade to the latest one. I am happy with the current version. None of our players complaining about the current setup.

Edited by AnnieRuru
move to source modification support, as this is a src modification
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Recheck if you have this line in your script.c

static unsigned int equip[] = {EQP_HEAD_TOP,EQP_ARMOR,EQP_HAND_L,EQP_HAND_R,EQP_GARMENT,EQP_SHOES,EQP_ACC_L,EQP_ACC_R,EQP_HEAD_MID,EQP_HEAD_LOW};

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   3
  • Joined:  04/24/12
  • Last Seen:  

@nanakiwurtz

It happened I paste the code above that line. Moving the line of codes on that variable declaration. Problem solved.

Thank you so much.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Glad to see it has been solved, now don't forget to edit your post and add a "Solved" tag /ok

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