Jump to content
  • 0

Exchanger not working


MusiLiciouS

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   2
  • Joined:  06/04/13
  • Last Seen:  

Anyone can help me what's wrong with this script? I can't get any Coins from it. Thank You in Advance
 

turbo_room,79,86,8	script	Badge Exchanger	686,{
	
	mes "^C45AEC** Badge Exchanger **^000000";
	mes "Here is how much 1 BubblyRO Coin is worth:";
	mes "^FF0000Bravery Badge^000000: 1 piece";
	mes "^0000FFValor Badge^000000: 1 piece";
	mes "^706b00War Badge^000000: 1 piece";
	next;
	menu "^FF0000Bravery Badge -> BubblyRO Coins^000000",BC_bb,"^0000FFValor Badge -> BubblyRO Coins^000000",BC_vb,"^706b00War Badge -> BubblyRO Coins^000000",BC_wb,"Nevermind",L_No;

	BC_bb:
		mes "^C45AEC** Badge Exchanger **^000000";
		mes "How many Bravery Badge would you like to give up?";
		next;
		set @bbamount,1;
		input @bbamount;
		if (@bbamount < 0) goto L_No;
		if (countitem(7828) < @bbamount) goto L_No;
		delitem 7728,@bbamount;
		getitem 30091,@bbamount;
		goto L_Thanks;

	BC_vb:
		next;
		mes "^C45AEC** Badge Exchanger **^000000";
		mes "Here is how much BubblyRO Coin is worth:";
		mes "^99CCCCBubblyRO Coin^000000: 15 Skulls";
		next;
		mes "^C45AEC** Poi-Poi **^000000";
		mes "How many skulls would you like to give up?";
		set @samount,0;
		input @samount;
		if (@samount < 0) goto L_No;
		if (countitem(30110) < @samount) goto L_No;
		delitem 30110,15;
		getitem 30091,1;
		goto L_Thanks;

	BC_wb:
		next;
		mes "^C45AEC** Badge Exchanger **^000000";
		mes "Here is how much BubblyRO Coin is worth:";
		mes "^99CCCCBubblyRO Coin^000000: 5 War Badges";
		next;
		mes "^C45AEC** Badge Exchanger **^000000";
		mes "How many war badges would you like to give up?";
		set @wamount,0;
		input @wamount;
		if (@wamount < 0) goto L_No;
		if (countitem(7773) < @wamount) goto L_No;
		delitem 7773,5;
		getitem 30091,1;
		goto L_Thanks;

	L_Thanks:
		mes "^C45AEC** Badge Exchanger **^000000";
		mes "Pleasure doing business with you.";
		close2;
		cutin "", 255;
		close;

	L_No:
		next;
		mes "^C45AEC** Badge Exchanger **^000000";
		mes "Okay~ Bye!";
		close2;
		cutin "", 255;
		close;

OnInit:
       waitingroom "Exchange your badges here...",0;
    end;
}
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  715
  • Reputation:   83
  • Joined:  01/05/12
  • Last Seen:  

Try this...

turbo_room,79,86,8	script	Badge Exchanger	686,{
	mes "^C45AEC** Badge Exchanger **^000000";
	mes "Rule's Of Exchange:";
	mes "^FF00001x Bravery Badge^000000: 1 BubblyRO Coins";
	mes "^0000FF15x Valor Badge^000000: 1 BubblyRO Coins";
	mes "^706b005x War Badge^000000: 1 BubblyRO Coins";
	next;
	switch(select("^FF0000Bravery Badge -> BubblyRO Coins^000000:^0000FFValor Badge -> BubblyRO Coins^000000:^706b00War Badge -> BubblyRO Coins^000000:Nevermind")){
		case 1:
			next;
			mes "^C45AEC** Badge Exchanger **^000000";
			mes "How many Bravery Badge would you like to give up?";
			next;
			input @bbamount,0,countitem(7728);
			if( @bbamount == 0 ){
				next;
				mes "^C45AEC** Badge Exchanger **^000000";
				mes "I'm Sorry you don't have enough Bravery Badge";
				close;
			}
			next;
			delitem 7728,(@bbamount * 1);
			getitem 30091,@bbamount;
			mes "^C45AEC** Badge Exchanger **^000000";
			mes "Pleasure doing business with you.";
			close2;
			cutin "", 255;
			close;
			
		case 2:
			next;
			mes "^C45AEC** Badge Exchanger **^000000";
			mes "Here is how much BubblyRO Coin is worth:";
			mes "^99CCCCBubblyRO Coin^000000: 15 Skulls";
			next;
			mes "^C45AEC** Poi-Poi **^000000";
			mes "How many skulls would you like to give up?";
			next;
			input @samount,0,countitem(30110);
			if( @samount == 0 ){
				next;
				mes "^C45AEC** Badge Exchanger **^000000";
				mes "I'm Sorry you don't have enough Valor Badge";
				close;
			}
			next;
			delitem 30110,(@samount * 15);
			getitem 30091,@samount;
			mes "^C45AEC** Badge Exchanger **^000000";
			mes "Pleasure doing business with you.";
			close2;
			cutin "", 255;
			close;
			
		case 3:
			next;
			mes "^C45AEC** Badge Exchanger **^000000";
			mes "Here is how much BubblyRO Coin is worth:";
			mes "^99CCCCBubblyRO Coin^000000: 5 War Badges";
			next;
			mes "^C45AEC** Badge Exchanger **^000000";
			mes "How many war badges would you like to give up?";
			next;
			input @wamount,0,countitem(7773);
			if( @wamount == 0 ){
				next;
				mes "^C45AEC** Badge Exchanger **^000000";
				mes "I'm Sorry you don't have enough War Badge";
				close;
			}
			next;
			delitem 7773,(@wamount * 5);
			getitem 30091,@wamount;
			mes "^C45AEC** Badge Exchanger **^000000";
			mes "Pleasure doing business with you.";
			close2;
			cutin "", 255;
			close;
			
		case 4:
			next;
			mes "^C45AEC** Badge Exchanger **^000000";
			mes "Okay~ Bye!";
			close2;
			cutin "", 255;
			close;
		
	}
OnInit:
	waitingroom "Exchange your badges here...",0;
	end;
} 
Edited by Lelouch vi Britannia
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  452
  • Reputation:   33
  • Joined:  12/18/14
  • Last Seen:  

Any errors on the map server? It could be that item 30091 is not present or not read in the database which is why you are not getting any coins from it.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   2
  • Joined:  06/04/13
  • Last Seen:  

Any errors on the map server? It could be that item 30091 is not present or not read in the database which is why you are not getting any coins from it.

 

No errors. Item 30091 is not the problem. The problem is when I choose to select from the menu. Badges can't be exchanged to item 30091.. 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

instead of this
 if (@wamount < 0) goto L_No;

try this

if (@wamount <= 0) goto L_No;

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   2
  • Joined:  06/04/13
  • Last Seen:  

This is what I wanted to happen:

3 types of badges in 1 exchanger npc.. Rate is 1:1

Badge a = b. Coin

Badge b = b. coin

Badge c = b.Coin

Where they can enter how much they want to exchange.. Like for example they have 5 pcs of Badge A then he will just only want to exchange 3 then he will get 3 b.Coin

Thats what I wanted to do with that script but nothing happens.. Before, its working but it only exchange one at a time.. it is very time consuming for my players..

anyone can help?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

im not really into NPC scripting,
But try this...
 

turbo_room,79,86,8	script	Badge Exchanger	686,{
	
	if( @ba < 1 || @bb < 1 || @bc < 1){
		if(getgmlevel() >= @gml){
			mes "Invalid Rate in 'OnInit:'"
			mes "Minimum Rate is 1."
			close;
		}else{
			mes "Error Occured: Please report to Administrator.";
			close;
		}
	}
	
	mes "^C45AEC** Badge Exchanger **^000000";
	mes "Here is how much 1 BubblyRO Coin is worth:";
	mes "^FF0000Bravery Badge^000000: 1 piece";
	mes "^0000FFValor Badge^000000: 1 piece";
	mes "^706b00War Badge^000000: 1 piece";
	next;


	switch(select("^FF0000Bravery Badge -> BubblyRO Coins^000000","^0000FFValor Badge -> BubblyRO Coins^000000","^706b00War Badge -> BubblyRO Coins^000000","Nevermind")){
		mes "^C45AEC** Badge Exchanger **^000000";
			mes "Here is how much BubblyRO Coin is worth:";
		case 1:
			mes "^C45AEC** Badge Exchanger **^000000";
			mes "How many Bravery Badge would you like to give up?";
			next;
			input @amount;
			if (@amount <= 0) goto L_No;
			if (countitem(7828) < @amount) goto L_No;
			delitem 7728,@amount;
			getitem 30091,@ba * @amount;
			goto L_Thanks;
			break;
		case 2:
			next;
			mes "^99CCCCBubblyRO Coin^000000: 15 Skulls";
			next;
			mes "^C45AEC** Poi-Poi **^000000";
			mes "How many skulls would you like to give up?";
			input @amount;
			if (@amount <= 0) goto L_No;
			if (countitem(30110) < @amount) goto L_No;
			delitem 30110,@amount;
			getitem 30091,@bb * @amount;
			goto L_Thanks;
			break;
		case 3:
			next;
			mes "^99CCCCBubblyRO Coin^000000: 5 War Badges";
			next;
			mes "^C45AEC** Badge Exchanger **^000000";
			mes "How many war badges would you like to give up?";
			input @amount;
			if (@amount <= 0) goto L_No;
			if (countitem(7773) < @amount) goto L_No;
			delitem 7773,@amount;
			getitem 30091,@bc * @amount;
			goto L_Thanks;
			break;
		case 4:
			close;
			break;
	}


	L_Thanks:
		mes "^C45AEC** Badge Exchanger **^000000";
		mes "Pleasure doing business with you.";
		close2;
		cutin "", 255;
		close;

	L_No:
		next;
		mes "^C45AEC** Badge Exchanger **^000000";
		mes "Okay~ Bye!";
		close2;
		cutin "", 255;
		close;

OnInit:
       waitingroom "Exchange your badges here...",0;
	   
	   set @gml,98;
	   // exchange rate in piece(s)
	   set .@ba,1;
	   set .@bb,1;
	   set .@bc,1;
    end;
}
Edited by benching
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...