Jump to content
  • 0

item to zenny exchanger


unrestricted

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  03/02/20
  • Last Seen:  

I created a file which will exchange a certain item for zennies. Need help pls. on how to make this work

prontera,139,70,5,    script    VIP Box Agent    828,{
mes "[^000088 Mr. Credit ^000000]";
mes "I Can Change VIP Boxes to Zeny";
mes "Remember 1 VIP 3 Days= ^640000500,000z^000000.";
mes "and 1 VIP 7 Days Box is= ^6400001,000,000z^000000.";
mes "So what do you want?";
menu  "3 Days Box To Zeny",-,"7 Days Box to Zeny",-,15c,"15 Days Box to Zeny",ztc;
next;
mes "[^000088 Mr. Credit ^000000]";
mes "Are you sure you want to exchange your 3 Days Box to Zeny?";
menu  "Yes",-,"No",G_no;
next;
mes "[^000088 Mr. Credit ^000000]";
mes "How many Credits do you want to exchange?";
next;
input .@t;
    if(countitem(12985) < .@t) goto L_NOTENOUGH;
mes "[^000088 Mr. Credit ^000000]";
mes "Thanks. . See you again. . . !";
    delitem 12985,.@t;
    set Zeny,Zeny+500000*.@t;
    close;
15c:
next;
mes "[^000088 Mr. Credit ^000000]";
mes "Are you sure you want to exchange your 7 Days VIP Boxto Zeny?";
menu  "Yes",-,"No",G_no;
next;
mes "[^000088 Mr. Credit ^000000";
mes "How many Boxes do you want to exchange?";
next;
input .@t;
    if(countitem(12986) < .@t) goto L_NOTENOUGH2;
mes "[^000088 Mr. Credit ^000000]";
mes "Thanks. . See you again. . . !";
    delitem 12986,.@t;
    set Zeny,Zeny+1000000*.@t;
    close;
ztc:
next;
mes "[^000088 Mr. Credit ^000000]";
mes "Are you sure you want to exchange your 15 Days VIP Boxto Zeny?";
menu  "Yes",-,"No",G_no;
next;
mes "[^000088 Mr. Credit ^000000";
mes "How many Boxes do you want to exchange?";
next;
input .@t;
    if(countitem(12984) < .@t) goto L_NOTENOUGH3;
mes "[^000088 Mr. Credit ^000000]";
mes "Thanks. . See you again. . . !";
    delitem 12984,.@t;
    set Zeny,Zeny+2000000*.@t;
    close;

L_NOTENOUGH:
   next;
   mes "[^000088 ^000088 Mr. Credit ^000000]";
   mes "You dont have it.";
   close;
L_NOTENOUGH2:
   next;
   mes "[^000088 ^000088 Mr. Credit ^000000]";
   mes "You dont have it.";
L_NOTENOUGH3:
   next;
   mes "[^000088 ^000088 Mr. Credit ^000000]";
   mes "You dont have it.";
   close;

G_no:
next;
   mes "[^000088 ^000088 Mr. Credit ^000000]";
   mes "Please use my service next time";
   close;
end;
}

 

Edited by Mael
Use a codebox
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  68
  • Reputation:   8
  • Joined:  05/12/20
  • Last Seen:  

You npc wont run because uyou have problem in  your prontera cordinates, also has an extra coma after npc position 

anyway, try this

prontera,155,175,5	script	VIP Box Agent	828,{
	// Show 1st message
	mes .npc$,"I Can Change VIP Boxes to Zeny.";
	for (.@i =  0 ; .@i < getarraysize(.vipbox); .@i++)
		mes "1 x " + .vipbox_name$[.@i] + " = ^640000" + .reward[.@i] + "^000000.";
	
	// Choose option
	mes "So what do you want?";
	.@s = select(implode(.vipbox_name$,":")) -1;
	
	// Confirm
	clear;
	mes .npc$,"Are you sure you want to exchange your " + .vipbox_name$[.@i] + " to Zeny?";
	if (select("Nevermind...:Yes..!") < 2)
		close;
	
	// Choose amount	
	clear;
	mes .npc$,"How many Credits do you want to exchange?";
	input .@t;
	clear;
	
	// Check ammount
	if (.@t < 1){
		mes .npc$,"Wrong number...";
		close;
	}
	
	// Check inventory
	if(countitem(.vipbox_id[.@s]) < .@t){
		mes .npc$,"You dont have it...";
		close;
	}
	
	// Conclude
	mes .npc$,"Thanks. . See you again. . . !";
	delitem .vipbox_id[.@s],.@t;
	Zeny += .reward[.@s]*.@t;
	close;
	
	
// When npc is loaded	
OnInit:
	// Set npc variables
	.npc$ = "[^000088 Mr. Credit ^000000]";
	setarray .vipbox_id,12985,12986,12984;
	setarray .reward,500000,1000000,2000000;
		
	// Get item names
	for (.@i =  0 ; .@i < getarraysize(.vipbox_id); .@i++)
		.vipbox_name$[.@i] = getitemname(.vipbox_id[.@i]);
}


 

Edited by buraquera
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  03/02/20
  • Last Seen:  

Thanks sir!

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