Jump to content
  • 0

script blacksmith refining item that cannot be refined


IsabelaFernandez

Question


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

I would like some solution to resolve this situation, I have already tried using Refineable: false
in db but there was no way.
here is the script

https://pastebin.com/wNqMZjDM

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.05
  • Content Count:  45
  • Reputation:   25
  • Joined:  09/09/23
  • Last Seen:  

17 minutes ago, IsabelaFernandez said:

I would like some solution to resolve this situation, I have already tried using Refineable: false
in db but there was no way.
here is the script

https://pastebin.com/wNqMZjDM

Here, have a try

prontera,164,168,4	script	Dwarf	600,{
	.@item = 7420;
	.@quan = 0;
	.@freeRef = 7;
	.@paidRef = 10;
	setarray .@blacklist, 501,502,503,504,505; //add banned item here
	switch(select("Refino Gratis", "Refino Pago")){
		case 1:
			setarray .@items[0],EQI_SHOES,EQI_GARMENT,EQI_HEAD_TOP,EQI_ARMOR,EQI_HAND_L,EQI_HAND_R;
			for(.@i = 0; .@i < getarraysize(.@items); .@i++){
				if(inarray(.@blacklist[0],.@items[.@i]) != -1){
					message strcharinfo(0),"Invalid item";
					end;
				}
				if(getequiprefinerycnt(.@items[.@i]) < .@freeRef){
					specialeffect2 154;
					successrefitem .@items[.@i],.@freeRef - getequiprefinerycnt(.@items[.@i]);
				}
			}
			end;
		case 2:
			setarray .@items[0],EQI_SHOES,EQI_GARMENT,EQI_HEAD_TOP,EQI_ARMOR,EQI_HAND_L,EQI_HAND_R;
 
			if (countitem(.@item) < .@quan){
				mes "Voce nao tem os items necessarios: " + .@quan + "x "+ getitemname(.@item);
				close;
			}
			for(.@i = 0; .@i < getarraysize(.@items); .@i++){
				if(inarray(.@blacklist[0],.@items[.@i]) != -1){
					message strcharinfo(0),"Invalid item";
					end;
				}
				// prevent the item consuption
				if(getequiprefinerycnt(.@items[.@i]) != .@paidRef) .@flag = 1;
				if(getequiprefinerycnt(.@items[.@i]) < .@paidRef){
					specialeffect2 154;
					successrefitem .@items[.@i],.@paidRef - getequiprefinerycnt(.@items[.@i]);
				}
			}
			if (.@flag == 1) delitem 7420,10;
			end;
	}
 
OnInit:
	waitingroom "Refinador Mestre",0;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

3 minutes ago, Nyaniverse said:

Here, have a try

prontera,164,168,4	script	Dwarf	600,{
	.@item = 7420;
	.@quan = 0;
	.@freeRef = 7;
	.@paidRef = 10;
	setarray .@blacklist, 501,502,503,504,505; //add banned item here
	switch(select("Refino Gratis", "Refino Pago")){
		case 1:
			setarray .@items[0],EQI_SHOES,EQI_GARMENT,EQI_HEAD_TOP,EQI_ARMOR,EQI_HAND_L,EQI_HAND_R;
			for(.@i = 0; .@i < getarraysize(.@items); .@i++){
				if(inarray(.@blacklist[0],.@items[.@i]) != -1){
					message strcharinfo(0),"Invalid item";
					end;
				}
				if(getequiprefinerycnt(.@items[.@i]) < .@freeRef){
					specialeffect2 154;
					successrefitem .@items[.@i],.@freeRef - getequiprefinerycnt(.@items[.@i]);
				}
			}
			end;
		case 2:
			setarray .@items[0],EQI_SHOES,EQI_GARMENT,EQI_HEAD_TOP,EQI_ARMOR,EQI_HAND_L,EQI_HAND_R;
 
			if (countitem(.@item) < .@quan){
				mes "Voce nao tem os items necessarios: " + .@quan + "x "+ getitemname(.@item);
				close;
			}
			for(.@i = 0; .@i < getarraysize(.@items); .@i++){
				if(inarray(.@blacklist[0],.@items[.@i]) != -1){
					message strcharinfo(0),"Invalid item";
					end;
				}
				// prevent the item consuption
				if(getequiprefinerycnt(.@items[.@i]) != .@paidRef) .@flag = 1;
				if(getequiprefinerycnt(.@items[.@i]) < .@paidRef){
					specialeffect2 154;
					successrefitem .@items[.@i],.@paidRef - getequiprefinerycnt(.@items[.@i]);
				}
			}
			if (.@flag == 1) delitem 7420,10;
			end;
	}
 
OnInit:
	waitingroom "Refinador Mestre",0;
}

 

unfortunately the NPC didn't even show up, I'm using the host so I didn't see the error. But I will see what the error line is and tell you. thank you for your attention! I'll send you the error message shortly

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

1 hour ago, Nyaniverse said:

Here, have a try

prontera,164,168,4	script	Dwarf	600,{
	.@item = 7420;
	.@quan = 0;
	.@freeRef = 7;
	.@paidRef = 10;
	setarray .@blacklist, 501,502,503,504,505; //add banned item here
	switch(select("Refino Gratis", "Refino Pago")){
		case 1:
			setarray .@items[0],EQI_SHOES,EQI_GARMENT,EQI_HEAD_TOP,EQI_ARMOR,EQI_HAND_L,EQI_HAND_R;
			for(.@i = 0; .@i < getarraysize(.@items); .@i++){
				if(inarray(.@blacklist[0],.@items[.@i]) != -1){
					message strcharinfo(0),"Invalid item";
					end;
				}
				if(getequiprefinerycnt(.@items[.@i]) < .@freeRef){
					specialeffect2 154;
					successrefitem .@items[.@i],.@freeRef - getequiprefinerycnt(.@items[.@i]);
				}
			}
			end;
		case 2:
			setarray .@items[0],EQI_SHOES,EQI_GARMENT,EQI_HEAD_TOP,EQI_ARMOR,EQI_HAND_L,EQI_HAND_R;
 
			if (countitem(.@item) < .@quan){
				mes "Voce nao tem os items necessarios: " + .@quan + "x "+ getitemname(.@item);
				close;
			}
			for(.@i = 0; .@i < getarraysize(.@items); .@i++){
				if(inarray(.@blacklist[0],.@items[.@i]) != -1){
					message strcharinfo(0),"Invalid item";
					end;
				}
				// prevent the item consuption
				if(getequiprefinerycnt(.@items[.@i]) != .@paidRef) .@flag = 1;
				if(getequiprefinerycnt(.@items[.@i]) < .@paidRef){
					specialeffect2 154;
					successrefitem .@items[.@i],.@paidRef - getequiprefinerycnt(.@items[.@i]);
				}
			}
			if (.@flag == 1) delitem 7420,10;
			end;
	}
 
OnInit:
	waitingroom "Refinador Mestre",0;
}

 

the script is working but the block list is not working unfortunately

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.05
  • Content Count:  45
  • Reputation:   25
  • Joined:  09/09/23
  • Last Seen:  

2 minutes ago, IsabelaFernandez said:

the script is working but the block list is not working unfortunately

Ah yes, sorry it was my mistake, please edit this line
 

if(inarray(.@blacklist[0],.@items[.@i]) != -1){

to this
 

if(inarray(.@blacklist[0],getequipid(.@items[.@i])) != -1){

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

30 minutes ago, Nyaniverse said:

Ah yes, sorry it was my mistake, please edit this line
 

if(inarray(.@blacklist[0],.@items[.@i]) != -1){

to this
 

if(inarray(.@blacklist[0],getequipid(.@items[.@i])) != -1){

 

worked perfectly! However, I noticed that if the block list item ID is there the NPC refines the shoes "ID 64 @refine", is there any way to block any refinement until the blocked list item is not equipped?

thank you my friend

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.05
  • Content Count:  45
  • Reputation:   25
  • Joined:  09/09/23
  • Last Seen:  

13 hours ago, IsabelaFernandez said:

worked perfectly! However, I noticed that if the block list item ID is there the NPC refines the shoes "ID 64 @refine", is there any way to block any refinement until the blocked list item is not equipped?

thank you my friend

Here you go.
 

prontera,164,168,4	script	Dwarf	600,{
	.@item = 7420;
	.@quan = 0;
	.@freeRef = 7;
	.@paidRef = 10;
	setarray .@blacklist, 501,502,503,504,505; //add banned item here
	switch(select("Refino Gratis", "Refino Pago")){
		case 1:
			setarray .@items[0],EQI_SHOES,EQI_GARMENT,EQI_HEAD_TOP,EQI_ARMOR,EQI_HAND_L,EQI_HAND_R;]
			for(.@i = 0; .@i < getarraysize(.@items); .@i++){
				if(inarray(.@blacklist[0],getequipid(.@items[.@i])) != -1){
					message strcharinfo(0),"Invalid item";
					end;
				}
			}
			for(.@i = 0; .@i < getarraysize(.@items); .@i++){
				if(getequiprefinerycnt(.@items[.@i]) < .@freeRef){
					specialeffect2 154;
					successrefitem .@items[.@i],.@freeRef - getequiprefinerycnt(.@items[.@i]);
				}
			}
			end;
		case 2:
			setarray .@items[0],EQI_SHOES,EQI_GARMENT,EQI_HEAD_TOP,EQI_ARMOR,EQI_HAND_L,EQI_HAND_R;
 
			if (countitem(.@item) < .@quan){
				mes "Voce nao tem os items necessarios: " + .@quan + "x "+ getitemname(.@item);
				close;
			}
			for(.@i = 0; .@i < getarraysize(.@items); .@i++){
				if(inarray(.@blacklist[0],getequipid(.@items[.@i])) != -1){
					message strcharinfo(0),"Invalid item";
					end;
				}
			}
			for(.@i = 0; .@i < getarraysize(.@items); .@i++){
				// prevent the item consuption
				if(getequiprefinerycnt(.@items[.@i]) != .@paidRef) .@flag = 1;
				if(getequiprefinerycnt(.@items[.@i]) < .@paidRef){
					specialeffect2 154;
					successrefitem .@items[.@i],.@paidRef - getequiprefinerycnt(.@items[.@i]);
				}
			}
			if (.@flag == 1) delitem 7420,10;
			end;
	}
 
OnInit:
	waitingroom "Refinador Mestre",0;
}

 

Edited by Nyaniverse
missing getequipid
  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

11 hours ago, Nyaniverse said:

Here you go.
 

prontera,164,168,4	script	Dwarf	600,{
	.@item = 7420;
	.@quan = 0;
	.@freeRef = 7;
	.@paidRef = 10;
	setarray .@blacklist, 501,502,503,504,505; //add banned item here
	switch(select("Refino Gratis", "Refino Pago")){
		case 1:
			setarray .@items[0],EQI_SHOES,EQI_GARMENT,EQI_HEAD_TOP,EQI_ARMOR,EQI_HAND_L,EQI_HAND_R;]
			for(.@i = 0; .@i < getarraysize(.@items); .@i++){
				if(inarray(.@blacklist[0],.@items[.@i]) != -1){
					message strcharinfo(0),"Invalid item";
					end;
				}
			}
			for(.@i = 0; .@i < getarraysize(.@items); .@i++){
				if(getequiprefinerycnt(.@items[.@i]) < .@freeRef){
					specialeffect2 154;
					successrefitem .@items[.@i],.@freeRef - getequiprefinerycnt(.@items[.@i]);
				}
			}
			end;
		case 2:
			setarray .@items[0],EQI_SHOES,EQI_GARMENT,EQI_HEAD_TOP,EQI_ARMOR,EQI_HAND_L,EQI_HAND_R;
 
			if (countitem(.@item) < .@quan){
				mes "Voce nao tem os items necessarios: " + .@quan + "x "+ getitemname(.@item);
				close;
			}
			for(.@i = 0; .@i < getarraysize(.@items); .@i++){
				if(inarray(.@blacklist[0],.@items[.@i]) != -1){
					message strcharinfo(0),"Invalid item";
					end;
				}
			}
			for(.@i = 0; .@i < getarraysize(.@items); .@i++){
				// prevent the item consuption
				if(getequiprefinerycnt(.@items[.@i]) != .@paidRef) .@flag = 1;
				if(getequiprefinerycnt(.@items[.@i]) < .@paidRef){
					specialeffect2 154;
					successrefitem .@items[.@i],.@paidRef - getequiprefinerycnt(.@items[.@i]);
				}
			}
			if (.@flag == 1) delitem 7420,10;
			end;
	}
 
OnInit:
	waitingroom "Refinador Mestre",0;
}

 

You forgot the getequipid in your inarray comparisons.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.05
  • Content Count:  45
  • Reputation:   25
  • Joined:  09/09/23
  • Last Seen:  

1 hour ago, Winterfox said:

You forgot the getequipid in your inarray comparisons.

You're right, I apparently copied the one I sent previously. Edited it to have the getequipid check.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

resolved, thank you very much! It worked exactly as I wanted! 

@Nyaniverse

Edited by IsabelaFernandez
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...