Jump to content
  • 0

Help in downrefineitem system


paolokupal

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  49
  • Reputation:   4
  • Joined:  02/04/12
  • Last Seen:  

A little help here ..

this downrefitem decreases by 1, what i want is if the refine rate was 10 -13 and when it fails the refine will downgrade to +10.

Refine=Decrease

10 - 13= 10

14 -17= 14

18 -19= 18

Thank you .. :)

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;
}

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

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  60
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   219
  • Joined:  11/22/11
  • Last Seen:  

http://rathena.org/board/forum/35-source-support/

---

I don't think need to use source

set .@startlevel, .... record this weapon refining level before refine

if fail{ getitem2 .@startlevel <-- re-get that level weapon again }

Edited by goddameit
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  49
  • Reputation:   4
  • Joined:  02/04/12
  • Last Seen:  

But what i want is a continues refining and i do have the unbound and bound script for the equips that's why there is a chance for equip2 to equip unbound to bound or bound to unbound of the same kind..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  60
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   219
  • Joined:  11/22/11
  • Last Seen:  

But what i want is a continues refining and i do have the unbound and bound script for the equips that's why there is a chance for equip2 to equip unbound to bound or bound to unbound of the same kind..

what?

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:  

you can also do it like this..

when failed in refine.....

change your

downrefitem <equipment slot>;

into

while( getequiprefinerycnt( <equipment slot> ) > 10 )
   downrefitem <equipment slot>;

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  49
  • Reputation:   4
  • Joined:  02/04/12
  • Last Seen:  

Thanks for the replies i just did follow your suggestions ..

---------------------------------

This what i just did.

if (getequiprefinerycnt(.@part) > 9 && getequiprefinerycnt(.@part) < 14 && getequiprefinerycnt(.@part) != 10) {

do {

downrefitem .@part;

}while (getequiprefinerycnt(.@part) != 10);

}else if (getequiprefinerycnt(.@part) > 13 && getequiprefinerycnt(.@part) < 18 && getequiprefinerycnt(.@part) != 14) {

do {

downrefitem .@part;

}while (getequiprefinerycnt(.@part) != 14);

}else if (getequiprefinerycnt(.@part) > 17 && getequiprefinerycnt(.@part) < 20 && getequiprefinerycnt(.@part) != 18) {

do {

downrefitem .@part;

}while (getequiprefinerycnt(.@part) != 18);

}

Edited by paolokupal
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

i do have the unbound and bound script for the equips ...

there is a chance for equip2 to equip unbound to bound or bound to unbound of the same kind..

can you explain what is this equipment bounding system ?

seems like new to me

or maybe I'm just outdated ?

me and goddameit doesn't understand what is this equipment bounding system

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:  

@Annie & Goddameit

maybe he using eAmod / rAmod ...or he applied Xantara's work..

http://rathena.org/b...page__hl__bound

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

while ( <true> ) { <loop indefinitely> }

@paolokupal

I'm pretty sure your code there doesn't work because your while (<condition>) is started with false

and it will break outside the loop immediately

should be more like

.@ref_cnt = getequiprefinerycnt(.@part); // do you know some script commands are very messy if you read script.c ... this runs pc_checkequip function everytime in pc.c
if ( .@ref_cnt == 10 || .@ref_cnt == 14 || .@ref_cnt == 18 ) {
   specialeffect2 eff_refinefail;
} else if ( .@ref_cnt >= 11 && .@ref_cnt <= 13 ) { // well more understandable
   while ( getequiprefinerycnt(.@part) > 10 )
       downrefitem .@part;
} else if ( .@ref_cnt >= 15 ...

seems like emistry really improve a lot @_@ same code with him

rep_up.png up his post <3

Edited by AnnieRuru
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:  

seems like emistry really improve a lot @_@

really ? xD hope so ~

( happy-ing......( ~^ o ^ ~ ) )

erm..i would do like this..xD

if( getequiprefinerycnt(.@part) > 18 ) set .@Reduce,18;
else if( getequiprefinerycnt(.@part) > 14 ) set .@Reduce,14;
else if( getequiprefinerycnt(.@part) > 10 ) set .@Reduce,10;
else set .@Reduce,0;

if( .@Reduce )
while( getequiprefinerycnt(.@part) > .@Reduce )
 downrefitem .@part;

Edited by Emistry
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  49
  • Reputation:   4
  • Joined:  02/04/12
  • Last Seen:  

yeah i am talking about xantara's work.

and my script works smoothly :D

thanks for the suggestions .. /no1

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