Jump to content
  • 0

My Refiner script to add menu request


johnbond

Question


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

Hello Sirs,

 

I have this sure refiner script to +10 which requires 4500 mithril coins to be able to refine with 100% chance.

 

May I request an edit for this script so that it will have 2 options/menu to refine. One option/menu is to require 4500 mithril coins and a second option/menu  to require 1 PC of item #7179.

 

So basically players will have to 2 options in transacting with the NPC whichever they want.

 

Here is my script:

 

prt_in,53,56,7	script	Mithril Refiner +1 to +10::Mithril Refiner1		86,{
function Refine;

  set @itemid, 674;
  set @itemquantity, 4500;
  set @maxrefine, 10;

  mes "[Forger]";
  mes "Hi, I can refine any upgradeable equipment of your choice to sure +10. Just pay me ^FF00004,500 Mithril Coins^000000.";
    next;
    mes "Oh and by the way, I can refine your refinable equipment even if it already has a previous upgrade. I can upgrade them whether if its +5, +7 or +9 doesn't matter.";
  menu "Refine equipment",REFIN,"Nothing at all",QUIT;

REFIN:
if (countitem(674)<4500) goto  NOREQ;
next;
  mes "To refine an item you need:";
  mes "^FF0000 "+@itemquantity+" "+getitemname(@itemid)+"^000000";

  set @headtop$,getequipname(1);
  set @armor$,getequipname(2);
  set @handl$,getequipname(3);
  set @handr$,getequipname(4);
  set @garment$,getequipname(5);
  set @shoes$,getequipname(6);
  set @accl$,getequipname(7);
  set @accr$,getequipname(8);
  set @headmid$,getequipname(9);
  set @headlow$,getequipname(10);

menu
"[Head - Top] "+@headtop$,HEADTOP,
"[Head - Mid] "+@headmid$,HEADMID,
"[Head - Low] "+@headlow$,HEADLOW,
"[Armor] "+@armor$,ARMOR,
"[Garment] "+@garment$,GARMENT,
"[Left Hand] "+@handl$,HANDL,
"[Right Hand] "+@handr$,HANDR,
"[Left Acc] "+@accl$,ACCL,
"[Right Acc] "+@accr$,ACCR,
"[Shoes] "+@shoes$,SHOES,
"Cancel",QUIT;

HEADTOP:
set @slot, 1;
callfunc Refine;

HEADMID:
set @slot, 9;
callfunc Refine;

HEADLOW:
set @slot, 10;
callfunc Refine;

ARMOR:
set @slot, 2;
callfunc Refine;

GARMENT:
set @slot, 5;
callfunc Refine;

HANDL:
set @slot, 3;
callfunc Refine;

HANDR:
set @slot, 4;
callfunc Refine;

ACCL:
set @slot, 7;
callfunc Refine;

ACCR:
set @slot, 8;
callfunc Refine;

SHOES:
set @slot, 6;
callfunc Refine;

QUIT:
mes "Oh, bye then.";
close;

LATER:
mes "Thanks, have a nice day.";
close;

CANCEL:
mes "Okay, come back another time.";
close;

MAX:
mes "Sorry, but I can't refine this anymore.";
close;

NOWAY:
mes "Oh my, I can't refine this item!!!";
close;

NOREQ:
next;
mes "Sorry, but you don't have the items I need. Get out!";
close;

// ---------------Refine Equipment
function	Refine	{
if (getequiprefinerycnt(@slot) >= @maxrefine) goto MAX;
if (getequipisenableref(@slot) == 0) goto NOWAY;
menu "Do it!",-,"Cancel",CANCEL;

if (countitem(@itemid) < @itemquantity) goto NOREQ;
delitem @itemid, @itemquantity;

set @repeat, (@maxrefine - getequiprefinerycnt(@slot));

while (@repeat > 0) {
    successrefitem(@slot);
    set @repeat, @repeat - 1;
}
goto LATER;
}
}



Thank you Sirs. :)


Anyone? Kindly please help a newbie scripter like me.

 

Thank you. :)

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

try this

prt_in,53,56,7	script	Mithril Refiner +1 to +10::Mithril Refiner1		86,{
function Refine;

  set @itemid, 674;
  set @itemquantity, 4500;
  set @itemid2, 7179;
  set @itemquantity2, 1;
  set @maxrefine, 10;

  mes "[Forger]";
  mes "Hi, I can refine any upgradeable equipment of your choice to sure +10. Just pay me ^FF00004,500 Mithril Coins^000000 or ^FF00001 Proof of Donation^000000.";
    next;
    mes "Oh and by the way, I can refine your refinable equipment even if it already has a previous upgrade. I can upgrade them whether if its +5, +7 or +9 doesn't matter.";
  menu "Refine equipment",REFIN,"Nothing at all",QUIT;

REFIN:
if (countitem(674)<4500 && countitem(7179)<1) goto  NOREQ;
next;
  mes "To refine an item you need either :";
  mes "^FF0000 "+@itemquantity+" "+getitemname(@itemid)+"^000000";
  mes "or :";
  mes "^FF0000 "+@itemquantity2+" "+getitemname(@itemid2)+"^000000";

  set @headtop$,getequipname(1);
  set @armor$,getequipname(2);
  set @handl$,getequipname(3);
  set @handr$,getequipname(4);
  set @garment$,getequipname(5);
  set @shoes$,getequipname(6);
  set @accl$,getequipname(7);
  set @accr$,getequipname(8);
  set @headmid$,getequipname(9);
  set @headlow$,getequipname(10);

menu
"[Head - Top] "+@headtop$,HEADTOP,
"[Head - Mid] "+@headmid$,HEADMID,
"[Head - Low] "+@headlow$,HEADLOW,
"[Armor] "+@armor$,ARMOR,
"[Garment] "+@garment$,GARMENT,
"[Left Hand] "+@handl$,HANDL,
"[Right Hand] "+@handr$,HANDR,
"[Left Acc] "+@accl$,ACCL,
"[Right Acc] "+@accr$,ACCR,
"[Shoes] "+@shoes$,SHOES,
"Cancel",QUIT;

HEADTOP:
set @slot, 1;
callfunc Refine;

HEADMID:
set @slot, 9;
callfunc Refine;

HEADLOW:
set @slot, 10;
callfunc Refine;

ARMOR:
set @slot, 2;
callfunc Refine;

GARMENT:
set @slot, 5;
callfunc Refine;

HANDL:
set @slot, 3;
callfunc Refine;

HANDR:
set @slot, 4;
callfunc Refine;

ACCL:
set @slot, 7;
callfunc Refine;

ACCR:
set @slot, 8;
callfunc Refine;

SHOES:
set @slot, 6;
callfunc Refine;

QUIT:
mes "Oh, bye then.";
close;

LATER:
mes "Thanks, have a nice day.";
close;

CANCEL:
mes "Okay, come back another time.";
close;

MAX:
mes "Sorry, but I can't refine this anymore.";
close;

NOWAY:
mes "Oh my, I can't refine this item!!!";
close;

NOREQ:
next;
mes "Sorry, but you don't have the items I need. Get out!";
close;

// ---------------Refine Equipment
function	Refine	{
if (getequiprefinerycnt(@slot) >= @maxrefine) goto MAX;
if (getequipisenableref(@slot) == 0) goto NOWAY;
if (countitem(7179)>=1 && countitem(674)>=4500) {
	mes "[Forger]";
	mes "Which item do you want to use?";
	set @num , select("Mithril coin:Proof of donation");
}
else if (countitem(674)>=4500) set @num , 1;
else set @num , 2;
menu "Do it!",-,"Cancel",CANCEL;

if (@num = 1) {
	if (countitem(@itemid) < @itemquantity) goto NOREQ;
	delitem @itemid, @itemquantity;
}
else {
	if (countitem(@itemid2) < @itemquantity2) goto NOREQ;
	delitem @itemid2, @itemquantity2;
}

set @repeat, (@maxrefine - getequiprefinerycnt(@slot));

while (@repeat > 0) {
    successrefitem(@slot);
    set @repeat, @repeat - 1;
}
goto LATER;
}
}

didin't test but you shouldn't have any problems.

 

If you have both of the items required the forger will ask you which one you want to use, else he'll use the one you have.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

try this

prt_in,53,56,7	script	Mithril Refiner +1 to +10::Mithril Refiner1		86,{
function Refine;

  set @itemid, 674;
  set @itemquantity, 4500;
  set @itemid2, 7179;
  set @itemquantity2, 1;
  set @maxrefine, 10;

  mes "[Forger]";
  mes "Hi, I can refine any upgradeable equipment of your choice to sure +10. Just pay me ^FF00004,500 Mithril Coins^000000 or ^FF00001 Proof of Donation^000000.";
    next;
    mes "Oh and by the way, I can refine your refinable equipment even if it already has a previous upgrade. I can upgrade them whether if its +5, +7 or +9 doesn't matter.";
  menu "Refine equipment",REFIN,"Nothing at all",QUIT;

REFIN:
if (countitem(674)<4500 && countitem(7179)<1) goto  NOREQ;
next;
  mes "To refine an item you need either :";
  mes "^FF0000 "+@itemquantity+" "+getitemname(@itemid)+"^000000";
  mes "or :";
  mes "^FF0000 "+@itemquantity2+" "+getitemname(@itemid2)+"^000000";

  set @headtop$,getequipname(1);
  set @armor$,getequipname(2);
  set @handl$,getequipname(3);
  set @handr$,getequipname(4);
  set @garment$,getequipname(5);
  set @shoes$,getequipname(6);
  set @accl$,getequipname(7);
  set @accr$,getequipname(8);
  set @headmid$,getequipname(9);
  set @headlow$,getequipname(10);

menu
"[Head - Top] "+@headtop$,HEADTOP,
"[Head - Mid] "+@headmid$,HEADMID,
"[Head - Low] "+@headlow$,HEADLOW,
"[Armor] "+@armor$,ARMOR,
"[Garment] "+@garment$,GARMENT,
"[Left Hand] "+@handl$,HANDL,
"[Right Hand] "+@handr$,HANDR,
"[Left Acc] "+@accl$,ACCL,
"[Right Acc] "+@accr$,ACCR,
"[Shoes] "+@shoes$,SHOES,
"Cancel",QUIT;

HEADTOP:
set @slot, 1;
callfunc Refine;

HEADMID:
set @slot, 9;
callfunc Refine;

HEADLOW:
set @slot, 10;
callfunc Refine;

ARMOR:
set @slot, 2;
callfunc Refine;

GARMENT:
set @slot, 5;
callfunc Refine;

HANDL:
set @slot, 3;
callfunc Refine;

HANDR:
set @slot, 4;
callfunc Refine;

ACCL:
set @slot, 7;
callfunc Refine;

ACCR:
set @slot, 8;
callfunc Refine;

SHOES:
set @slot, 6;
callfunc Refine;

QUIT:
mes "Oh, bye then.";
close;

LATER:
mes "Thanks, have a nice day.";
close;

CANCEL:
mes "Okay, come back another time.";
close;

MAX:
mes "Sorry, but I can't refine this anymore.";
close;

NOWAY:
mes "Oh my, I can't refine this item!!!";
close;

NOREQ:
next;
mes "Sorry, but you don't have the items I need. Get out!";
close;

// ---------------Refine Equipment
function	Refine	{
if (getequiprefinerycnt(@slot) >= @maxrefine) goto MAX;
if (getequipisenableref(@slot) == 0) goto NOWAY;
if (countitem(7179)>=1 && countitem(674)>=4500) {
	mes "[Forger]";
	mes "Which item do you want to use?";
	set @num , select("Mithril coin:Proof of donation");
}
else if (countitem(674)>=4500) set @num , 1;
else set @num , 2;
menu "Do it!",-,"Cancel",CANCEL;

if (@num = 1) {
	if (countitem(@itemid) < @itemquantity) goto NOREQ;
	delitem @itemid, @itemquantity;
}
else {
	if (countitem(@itemid2) < @itemquantity2) goto NOREQ;
	delitem @itemid2, @itemquantity2;
}

set @repeat, (@maxrefine - getequiprefinerycnt(@slot));

while (@repeat > 0) {
    successrefitem(@slot);
    set @repeat, @repeat - 1;
}
goto LATER;
}
}

didin't test but you shouldn't have any problems.

 

If you have both of the items required the forger will ask you which one you want to use, else he'll use the one you have.

 

 

Oh thanks but can we just make it that the player will first choose in a menu which requirement he wants to use?

 

Thanks. :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

He'll be asked if he has the two possible items:

if (countitem(7179)>=1 && countitem(674)>=4500) {
	mes "[Forger]";
	mes "Which item do you want to use?";
	set @num , select("Mithril coin:Proof of donation");
}
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...