Meister Posted April 17, 2013 Group: Members Topic Count: 280 Topics Per Day: 0.06 Content Count: 841 Reputation: 17 Joined: 04/16/12 Last Seen: March 4, 2024 Share Posted April 17, 2013 How to change downrefitem to 3? instead of decreasing the failed refine to 1 to become to 3? is this the one? BUILDIN_FUNC(downrefitem) { int i = -3,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-3]); 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; } Quote Link to comment Share on other sites More sharing options...
Jarek Posted April 17, 2013 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 143 Reputation: 30 Joined: 12/23/11 Last Seen: March 9 Share Posted April 17, 2013 «You are doing it wrong». (= Try this: 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 if(sd->status.inventory[i].refine < 4) clif_refine(sd->fd,2,i,sd->status.inventory[i].refine = 0); else clif_refine(sd->fd,2,i,sd->status.inventory[i].refine = sd->status.inventory[i].refine - 4); 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; } Or you could run the command 3 times...Yeah, that's more simple >.< Quote Link to comment Share on other sites More sharing options...
Euphy Posted April 17, 2013 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted April 17, 2013 Or you could run the command 3 times... Quote Link to comment Share on other sites More sharing options...
Meister Posted April 18, 2013 Group: Members Topic Count: 280 Topics Per Day: 0.06 Content Count: 841 Reputation: 17 Joined: 04/16/12 Last Seen: March 4, 2024 Author Share Posted April 18, 2013 Ohhh. Lol. a simple solution by running it 3 Quote Link to comment Share on other sites More sharing options...
Question
Meister
How to change downrefitem to 3? instead of decreasing the failed refine to 1 to become to 3?
is this the one?
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.