Jump to content
  • 0

Refine NPC equip in wrong positions


agamanaros

Question


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  41
  • Reputation:   0
  • Joined:  03/26/16
  • Last Seen:  

Good day! Im seeking for your kindest assistance regarding my refine NPC. I'm using a refine NPC I just got of from rathena. As you can you in the image below. Im using a refine script from the link below. It works fine but the npc is reading the equip position wrong. Thank you and more power!

//=====================================================================================
// Refine from +5 to +10
//=====================================================================================
skycity,127,240,5	script	HD Refiner	826,{
callfunc	"refinenew2","Safety Upgrade",0;
OnInit:
waitingroom " HD Refiner",0;
end;
}

//============================================================
//= To allow auto safe refining/multiple refining set the
//= second argument to '1' in the function call.
//============================================================
function	script	refinenew2	{

set .@features,getarg(1);
mes "[" + getarg(0) + "]";
mes "I'm Bestri brother.";
mes "I can refine all kinds of weapons, armor and equipment, so let me";
mes "know what you want me to refine.";
next;

setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
set .@menu$,"";
for( set .@i,1; .@i <= 7; set .@i,.@i+1 )
{
if( getequipisequiped(.@i) )
set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";

set .@menu$, .@menu$ + ":";
}
set .@part,select(.@menu$);
if(!getequipisequiped(.@part)) {
mes "[" + getarg(0) + "]";
mes "You're not wearing";
mes "anything there that";
mes "I can refine.";
close;
}
//Check if the item is refinable...
if(!getequipisenableref(.@part)) {
mes "[" + getarg(0) + "]";
mes "I don't think I can";
mes "refine this item at all...";
close;
}
//Check to see if the items is between +5 and +10
if(getequiprefinerycnt(.@part) >= 10) {
mes "[" + getarg(0) + "]";
mes "I can't refine this";
mes "any more. This is as";
mes "refined as it gets!";
close;
}
if(getequiprefinerycnt(.@part) <= 3) {
mes "[" + getarg(0) + "]";
mes "I can't refine this yet.";
mes "Upgrade it to ^0000FFatleast +4^000000";
mes "before you bring it to me.";
close;
}
set .@refineitemid, getequipid(.@part); // save id of the item
set .@refinerycnt, getequiprefinerycnt(.@part); //save refinery count
switch(getequipweaponlv(.@part)){
case 0: //Refine Armor
set .@price,20000;
set .@material,30205;
set .@safe,4;
break;
case 1: //Refine Level 1 Weapon
set .@price,20000;
set .@material,30205;
set .@safe,7;
break;
case 2: //Refine Level 2 Weapon
set .@price,20000;
set .@material,30205;
set .@safe,6;
break;
case 3: //Refine Level 3 Weapon
set .@price,20000;
set .@material,30205;
set .@safe,5;
break;
case 4: //Refine Level 4 Weapon
set .@price,20000;
set .@material,30205;
set .@safe,4;
break;
case 5: //Refine other stuff?
set .@price,20000;
set .@material,30205;
set .@safe,4;
break;
}
if(.@features != 1) {
mes "[" + getarg(0) + "]";
mes "To refine this I need";
mes "one ^003366"+getitemname(.@material)+"^000000 and";
mes "a service fee of " + .@price + " Zeny.";
mes "Do you really wish to continue?";
next;
if(select("Yes:No") == 2){
mes "[" + getarg(0) + "]";
mes "Yeah...";
mes "There's no need to";
mes "rush. Take your time.";
close;
}
if(getequippercentrefinery(.@part) < 100) {
mes "[" + getarg(0) + "]";
mes "Oh no! If I continue to";
mes "refine this, there's a risk it could";
mes "be ^FF0000downgraded by 1 levels!^000000";
mes "Do you still want to refine?";
next;
if(select("Yes:No") == 2){
mes "[" + getarg(0) + "]";
mes "I completely agree...";
mes "I might be a great refiner, but sometimes even I make mistakes.";
close;
}
}
if((countitem(.@material) < 1) || (Zeny < .@price)) {
mes "[" + getarg(0) + "]";
mes "You don't seem to have";
mes "enough Zeny or "+getitemname(.@material)+"...";
mes "Go get some more. I'll be";
mes "here all day if you need me.";
close;
}
set Zeny,Zeny-.@price;
delitem .@material,1;
if(getequipisequiped(.@part) == 0) { // hacker has removed the item (not changed, why?)
mes "[" + getarg(0) + "]";
mes "Look here... you don't have any Items on...";
close;
}
if(getequiprefinerycnt(.@part) != .@refinerycnt || getequipid(.@part) != .@refineitemid) { // hacker has changed the item
mes "[" + getarg(0) + "]";
mes "Wait a second...";
mes "Do you think I'm stupid?!";
mes "You switched the item while I wasn't looking! Get out of here!";
close;
}
if(getequippercentrefinery(.@part) <= rand(100)) {
//getitem2 getequipid(.@part),1,1,getequiprefinerycnt(.@part)-1,0,getequipcardid(.@part,0),getequipcardid(.@part,1),getequipcardid(.@part,2),getequipcardid(.@part,3);
downrefitem .@part;
mes "[" + getarg(0) + "]";
set .@emo,rand(1,5);
if (.@emo == 1) {
} else {
}
set .@lose,rand(1,2);
if (.@lose == 1) {
mes "OH! MY GOD!";
mes "Damn it! Not again!";
mes "I'm terribly sorry, but you know practice does make perfect.";
mes "Um, right? Heh heh...";
} else {
mes "Crap!";
mes "It couldn't take";
mes "much more tempering!";
mes "Sorry about this...";
}
close;
}
mes "["+getarg(0)+"]";
successrefitem .@part;
set .@win,rand(1,3);
if (.@win == 1) {
mes "Perfect!";
mes "Heh heh!";
mes "Once again,";
mes "flawless work";
mes "from the master~";
} else if(.@win == 2) {
mes "Success...!";
mes "Yet again, my amazing";
mes "talent truly dazzles";
mes "and shines today.";
} else {
mes "Heh heh!";
mes "I'm all done.";
mes "No doubt, my work is";
mes "to your satisfaction.";
mes "Sheer, utter perfection~";
}
}
// New Refining Functions ========================
mes "[" + getarg(0) + "]";
mes "I can refine this to the limit or a desired number of times... it's your choice...";
next;
switch(select("I'll decide how many times.","I've changed my mind...")) {
case 1:
mes "[" + getarg(0) + "]";
mes "So how many times would you like me to refine your item?";
next;
input .@refinecnt;
set .@refinecheck,.@refinecnt + getequiprefinerycnt(.@part);
if (.@refinecnt < 1 || .@refinecheck > 20) {
mes "[" + getarg(0) + "]";
mes "I can't refine this item that many times.";
close;
}
if(.@refinecheck > .@safe) {
set .@refinecheck,.@refinecheck - .@safe;
mes "[" + getarg(0) + "]";
mes "This will try to refine the equipment " + .@refinecheck + " times past the safe limit. Your equipment may be ^FF0000downgraded by 1 levels^000000 if i fail... is that ok?";
next;
if(select("Yes...","No...") == 2){
mes "[" + getarg(0) + "]";
mes "You said so..Hmm so be it...";
close;
}
}
break;
case 2:
mes "[" + getarg(0) + "]";
mes "You said so..Hmm so be it...";
close;
}
set .@fullprice,.@price * .@refinecnt;
mes "[" + getarg(0) + "]";
mes "That will cost you " + .@refinecnt + " " + getitemname(.@material) + " and " + .@fullprice + " Zeny. Is that ok?";
next;
if(select("Yes","No...") == 2){
mes "[" + getarg(0) + "]";
mes "You said so..Hmm so be it...";
close;
}
if(countitem(.@material) < .@refinecnt || Zeny < .@fullprice) {
mes "[" + getarg(0) + "]";
mes "Is that all you got? Unfortunately I can't work for you at a lower price. Try putting yourself in my shoes.";
close;
}
set Zeny,Zeny - .@fullprice;
delitem .@material,.@refinecnt;
while(.@refinecnt){
if (getequipisequiped(.@part) == 0) {
mes "[" + getarg(0) + "]";
mes "Look here... you don't have any Items on...";
close;
}
if (getequipid(.@part) != .@refineitemid || (.@menu2 == 1 && getequippercentrefinery(.@part) < 100)) {
mes "[" + getarg(0) + "]";
mes "Clan... No, but Did you imagine I could be so stupid !?!";
mes "You have changed it...";
mes "Go out before I stun you with my Hammer!!!";
close;
}
mes "Clang, clang!!!";
if(getequippercentrefinery(.@part) <= rand(100)) {
//getitem2 getequipid(.@part),1,1,getequiprefinerycnt(.@part)-1,0,getequipcardid(.@part,0),getequipcardid(.@part,1),getequipcardid(.@part,2),getequipcardid(.@part,3);
downrefitem .@part;
mes "[" + getarg(0) + "]";
mes "WAHHHH!!! I'm so sorry... I warned you this could happen...";
set .@refinecnt,.@refinecnt - 1;
if(.@refinecnt == 0) close;
mes "Here's the unused Zeny and Material back...";
getitem .@material,.@refinecnt;
set .@fullprice,.@refinecnt * .@price;
set Zeny,Zeny + .@fullprice;
close;
}
successrefitem .@part;
set .@refinecnt,.@refinecnt - 1;
next;
}
mes "[" + getarg(0) + "]";
mes "All finished... Come again soon.";
close;
}

//
// NORMAL REFINER
///
skycity,131,240,5	script	Normal Refiner	826,{
	callfunc "refinemain","Hollgrehenn",1;
	end;
	OnInit:
		waitingroom " Normal Refiner",0;
	end;
}

image.png.715e03ed86166e4c243e3fb97d308a9b.pngimage.png.8820df930e0aef8a34e39519402aad4c.png

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1649
  • Reputation:   258
  • Joined:  08/03/12
  • Last Seen:  

1 hour ago, agamanaros said:

Good day! Im seeking for your kindest assistance regarding my refine NPC. I'm using a refine NPC I just got of from rathena. As you can you in the image below. Im using a refine script from the link below. It works fine but the npc is reading the equip position wrong. Thank you and more power!

//=====================================================================================
// Refine from +5 to +10
//=====================================================================================
skycity,127,240,5	script	HD Refiner	826,{
callfunc	"refinenew2","Safety Upgrade",0;
OnInit:
waitingroom " HD Refiner",0;
end;
}

//============================================================
//= To allow auto safe refining/multiple refining set the
//= second argument to '1' in the function call.
//============================================================
function	script	refinenew2	{

set .@features,getarg(1);
mes "[" + getarg(0) + "]";
mes "I'm Bestri brother.";
mes "I can refine all kinds of weapons, armor and equipment, so let me";
mes "know what you want me to refine.";
next;

setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
set .@menu$,"";
for( set .@i,1; .@i <= 7; set .@i,.@i+1 )
{
if( getequipisequiped(.@i) )
set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";

set .@menu$, .@menu$ + ":";
}
set .@part,select(.@menu$);
if(!getequipisequiped(.@part)) {
mes "[" + getarg(0) + "]";
mes "You're not wearing";
mes "anything there that";
mes "I can refine.";
close;
}
//Check if the item is refinable...
if(!getequipisenableref(.@part)) {
mes "[" + getarg(0) + "]";
mes "I don't think I can";
mes "refine this item at all...";
close;
}
//Check to see if the items is between +5 and +10
if(getequiprefinerycnt(.@part) >= 10) {
mes "[" + getarg(0) + "]";
mes "I can't refine this";
mes "any more. This is as";
mes "refined as it gets!";
close;
}
if(getequiprefinerycnt(.@part) <= 3) {
mes "[" + getarg(0) + "]";
mes "I can't refine this yet.";
mes "Upgrade it to ^0000FFatleast +4^000000";
mes "before you bring it to me.";
close;
}
set .@refineitemid, getequipid(.@part); // save id of the item
set .@refinerycnt, getequiprefinerycnt(.@part); //save refinery count
switch(getequipweaponlv(.@part)){
case 0: //Refine Armor
set .@price,20000;
set .@material,30205;
set .@safe,4;
break;
case 1: //Refine Level 1 Weapon
set .@price,20000;
set .@material,30205;
set .@safe,7;
break;
case 2: //Refine Level 2 Weapon
set .@price,20000;
set .@material,30205;
set .@safe,6;
break;
case 3: //Refine Level 3 Weapon
set .@price,20000;
set .@material,30205;
set .@safe,5;
break;
case 4: //Refine Level 4 Weapon
set .@price,20000;
set .@material,30205;
set .@safe,4;
break;
case 5: //Refine other stuff?
set .@price,20000;
set .@material,30205;
set .@safe,4;
break;
}
if(.@features != 1) {
mes "[" + getarg(0) + "]";
mes "To refine this I need";
mes "one ^003366"+getitemname(.@material)+"^000000 and";
mes "a service fee of " + .@price + " Zeny.";
mes "Do you really wish to continue?";
next;
if(select("Yes:No") == 2){
mes "[" + getarg(0) + "]";
mes "Yeah...";
mes "There's no need to";
mes "rush. Take your time.";
close;
}
if(getequippercentrefinery(.@part) < 100) {
mes "[" + getarg(0) + "]";
mes "Oh no! If I continue to";
mes "refine this, there's a risk it could";
mes "be ^FF0000downgraded by 1 levels!^000000";
mes "Do you still want to refine?";
next;
if(select("Yes:No") == 2){
mes "[" + getarg(0) + "]";
mes "I completely agree...";
mes "I might be a great refiner, but sometimes even I make mistakes.";
close;
}
}
if((countitem(.@material) < 1) || (Zeny < .@price)) {
mes "[" + getarg(0) + "]";
mes "You don't seem to have";
mes "enough Zeny or "+getitemname(.@material)+"...";
mes "Go get some more. I'll be";
mes "here all day if you need me.";
close;
}
set Zeny,Zeny-.@price;
delitem .@material,1;
if(getequipisequiped(.@part) == 0) { // hacker has removed the item (not changed, why?)
mes "[" + getarg(0) + "]";
mes "Look here... you don't have any Items on...";
close;
}
if(getequiprefinerycnt(.@part) != .@refinerycnt || getequipid(.@part) != .@refineitemid) { // hacker has changed the item
mes "[" + getarg(0) + "]";
mes "Wait a second...";
mes "Do you think I'm stupid?!";
mes "You switched the item while I wasn't looking! Get out of here!";
close;
}
if(getequippercentrefinery(.@part) <= rand(100)) {
//getitem2 getequipid(.@part),1,1,getequiprefinerycnt(.@part)-1,0,getequipcardid(.@part,0),getequipcardid(.@part,1),getequipcardid(.@part,2),getequipcardid(.@part,3);
downrefitem .@part;
mes "[" + getarg(0) + "]";
set .@emo,rand(1,5);
if (.@emo == 1) {
} else {
}
set .@lose,rand(1,2);
if (.@lose == 1) {
mes "OH! MY GOD!";
mes "Damn it! Not again!";
mes "I'm terribly sorry, but you know practice does make perfect.";
mes "Um, right? Heh heh...";
} else {
mes "Crap!";
mes "It couldn't take";
mes "much more tempering!";
mes "Sorry about this...";
}
close;
}
mes "["+getarg(0)+"]";
successrefitem .@part;
set .@win,rand(1,3);
if (.@win == 1) {
mes "Perfect!";
mes "Heh heh!";
mes "Once again,";
mes "flawless work";
mes "from the master~";
} else if(.@win == 2) {
mes "Success...!";
mes "Yet again, my amazing";
mes "talent truly dazzles";
mes "and shines today.";
} else {
mes "Heh heh!";
mes "I'm all done.";
mes "No doubt, my work is";
mes "to your satisfaction.";
mes "Sheer, utter perfection~";
}
}
// New Refining Functions ========================
mes "[" + getarg(0) + "]";
mes "I can refine this to the limit or a desired number of times... it's your choice...";
next;
switch(select("I'll decide how many times.","I've changed my mind...")) {
case 1:
mes "[" + getarg(0) + "]";
mes "So how many times would you like me to refine your item?";
next;
input .@refinecnt;
set .@refinecheck,.@refinecnt + getequiprefinerycnt(.@part);
if (.@refinecnt < 1 || .@refinecheck > 20) {
mes "[" + getarg(0) + "]";
mes "I can't refine this item that many times.";
close;
}
if(.@refinecheck > .@safe) {
set .@refinecheck,.@refinecheck - .@safe;
mes "[" + getarg(0) + "]";
mes "This will try to refine the equipment " + .@refinecheck + " times past the safe limit. Your equipment may be ^FF0000downgraded by 1 levels^000000 if i fail... is that ok?";
next;
if(select("Yes...","No...") == 2){
mes "[" + getarg(0) + "]";
mes "You said so..Hmm so be it...";
close;
}
}
break;
case 2:
mes "[" + getarg(0) + "]";
mes "You said so..Hmm so be it...";
close;
}
set .@fullprice,.@price * .@refinecnt;
mes "[" + getarg(0) + "]";
mes "That will cost you " + .@refinecnt + " " + getitemname(.@material) + " and " + .@fullprice + " Zeny. Is that ok?";
next;
if(select("Yes","No...") == 2){
mes "[" + getarg(0) + "]";
mes "You said so..Hmm so be it...";
close;
}
if(countitem(.@material) < .@refinecnt || Zeny < .@fullprice) {
mes "[" + getarg(0) + "]";
mes "Is that all you got? Unfortunately I can't work for you at a lower price. Try putting yourself in my shoes.";
close;
}
set Zeny,Zeny - .@fullprice;
delitem .@material,.@refinecnt;
while(.@refinecnt){
if (getequipisequiped(.@part) == 0) {
mes "[" + getarg(0) + "]";
mes "Look here... you don't have any Items on...";
close;
}
if (getequipid(.@part) != .@refineitemid || (.@menu2 == 1 && getequippercentrefinery(.@part) < 100)) {
mes "[" + getarg(0) + "]";
mes "Clan... No, but Did you imagine I could be so stupid !?!";
mes "You have changed it...";
mes "Go out before I stun you with my Hammer!!!";
close;
}
mes "Clang, clang!!!";
if(getequippercentrefinery(.@part) <= rand(100)) {
//getitem2 getequipid(.@part),1,1,getequiprefinerycnt(.@part)-1,0,getequipcardid(.@part,0),getequipcardid(.@part,1),getequipcardid(.@part,2),getequipcardid(.@part,3);
downrefitem .@part;
mes "[" + getarg(0) + "]";
mes "WAHHHH!!! I'm so sorry... I warned you this could happen...";
set .@refinecnt,.@refinecnt - 1;
if(.@refinecnt == 0) close;
mes "Here's the unused Zeny and Material back...";
getitem .@material,.@refinecnt;
set .@fullprice,.@refinecnt * .@price;
set Zeny,Zeny + .@fullprice;
close;
}
successrefitem .@part;
set .@refinecnt,.@refinecnt - 1;
next;
}
mes "[" + getarg(0) + "]";
mes "All finished... Come again soon.";
close;
}

//
// NORMAL REFINER
///
skycity,131,240,5	script	Normal Refiner	826,{
	callfunc "refinemain","Hollgrehenn",1;
	end;
	OnInit:
		waitingroom " Normal Refiner",0;
	end;
}

image.png.715e03ed86166e4c243e3fb97d308a9b.pngimage.png.8820df930e0aef8a34e39519402aad4c.png

old equipments having restructure for a quite long time ago.

why not you use the refiner that rathena has right now ?

https://github.com/rathena/rathena/blob/master/npc/re/merchants/hd_refiner.txt

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  41
  • Reputation:   0
  • Joined:  03/26/16
  • Last Seen:  

10 minutes ago, Chaos92 said:

old equipments having restructure for a quite long time ago.

why not you use the refiner that rathena has right now ?

https://github.com/rathena/rathena/blob/master/npc/re/merchants/hd_refiner.txt

Hi sir, really appreciate you responding to my query. I'am trying to implement rathena official hd_refiner script however Im having hard time adjusting the refine limit from +7~+9 I need it to be +4~+10.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  41
  • Reputation:   0
  • Joined:  03/26/16
  • Last Seen:  

54 minutes ago, Chaos92 said:

old equipments having restructure for a quite long time ago.

why not you use the refiner that rathena has right now ?

https://github.com/rathena/rathena/blob/master/npc/re/merchants/hd_refiner.txt

I manage to find an older version of the official hd_refiner. And it works well on my ra version now. Thanks!

 

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