Jump to content
  • 0

[Solve]Coin exchange Coin Npc


Question

Posted (edited)

Need a coin exchange coin npc. any script also can as long using coin exchange coin.

i dun wan use the zeny for coin. can you give me a npc that exchange coin?

1xSilver Coin =Need 5 Bronze coin (to trade silver coin)

1xGold Coin =Need 4 Silver coin (to trade Gold coin)

1xPlatinum Coin =Need 3 Platinum coin (to trade Platinum coin)

1xMithril Coin = Need 2 Platinum coin (to trade Mithril coin)

if can tq ^^

Edited by manabeast

16 answers to this question

Recommended Posts

Posted

Untested (because I'm at work)

prontera,158,173,4 script Coin Exchanger 88,{

mes .npc$;
mes "What would you like to do?";
switch(select("Info:Trade for Coin")) {
case 1: // Get Info
next;
mes .npc$;
for (set .@a, 0; .@a < getarraysize(.coin_id); set .@a, .@a + 1) {
mes "1 " + getitename(.coin_id[.@a]) + " = " + .coin_trade_amount[.@a] + " " + getitemname(.coin_trade_coin[.@a]) + "s";
}
close;

case 2: // Trade Coin
next;

mes "Please select which coin you would like...";

// Build Menu
for (set .@a, 0; .@a < getarraysize(.coin_id); set .@a, .@a + 1) {
set .@menu$, .@menu$ + (.@menu$ == "" ? "" : ":") + getitemname(.coin_id[.@a]);
}

set .@coin_choice, select(.@menu$) - 1;

if (countitem(.coin_trade_coin[.@coin_choice]) < .coin_trade_amount[.@coin_choice]) {
mes "You do not have enough items...";
close;
} 
mes "Ok! Let me do a little magic...";
next;

mes "and.... Here you go...";
delitem .coin_trade_coin[.@coin_choice], .coin_trade_amount[.@coin_choice];
getitem .coin_id[.@coin_choice], 1;

mes "Enjoy!";
close;
}

OnInit:
set .npc$, "[Coin Exchanger]";

setarray .coin_id[0],silver,gold,plat,mithril;
setarray .coin_trade_amount[0],5,4,3,2;
setarray .coin_trade_coin[0],bronze,silver,gold,plat;
end;

}

  • Upvote 1
Posted (edited)

prontera,158,173,4 script Coin Exchanger 88,{

mes .npc$;
mes "What would you like to do?";
switch(select("Info:Trade for Coin")) {
case 1: // Get Info
next;
mes .npc$;
for (set .@a, 0; .@a < getarraysize(.coin_id); set .@a, .@a + 1) {
mes "1 " + getitename(.coin_id[.@a]) + " = " + .coin_trade_amount[.@a] + " " + getitemname(.coin_trade_coin[.@a]) + "s";
}
close;

case 2: // Trade Coin
next;

mes "Please select which coin you would like...";

// Build Menu
for (set .@a, 0; .@a < getarraysize(.coin_id); set .@a, .@a + 1) {
set .@menu$, .@menu$ + (.@menu$ == "" ? "" : ":") + getitemname(.coin_id[.@a]);
}

set .@coin_choice, select(.@menu$) - 1;

if (countitem(.coin_trade_coin[.@coin_choice]) < .coin_trade_amount[.@coin_choice]) {
mes "You do not have enough items...";
close;
}
mes "Ok! Let me do a little magic...";
next;

mes "and.... Here you go...";
delitem .coin_trade_coin[.@coin_choice], .coin_trade_amount[.@coin_choice];
getitem .coin_id[.@coin_choice], 1;

mes "Enjoy!";
close;
}

OnInit:
set .npc$, "[Coin Exchanger]";

setarray .coin_id[0],silver,gold,plat,mithril;
setarray .coin_trade_amount[0],5,4,3,2;
setarray .coin_trade_coin[0],bronze,silver,gold,plat;
end;

}

npc no appear in game. i warp and mapmove there also no sew npc.

ok thx, i try it tonight.

post-472-0-04232600-1323188675_thumb.png

Edited by manabeast
Posted

You need to use TABS int eh header

prontera,158,173,4<TAB BUTTON>script<TAB BUTTON>Coin Exchange<TAB BUTTON>88.{

Also be sure to modify

setarray .coin_id[0],silver,gold,plat,mithril;
setarray .coin_trade_amount[0],5,4,3,2;
setarray .coin_trade_coin[0],bronze,silver,gold,plat;

change the words to the item id's of the coins...

  • Upvote 1
Posted

well, i already test and i try click the npc but nothing happen. like clicking him like clicking nothing ??

this is how many coin will change? if i wan change amount for first one is 10 second is 9 third is 8 four 7 so will be

setarray .coin_trade_amount[0],5,4,3,2;

setarray .coin_trade_amount[0],10,9,8,7; ?

Posted

not only tab. the script no working @.@" i cannot talk to the npc just can see him stand there .~,~"

by the way. the tab only for the first line only? other no need tab?

prontera,158,173,4<TAB BUTTON>script<TAB BUTTON>Coin Exchange<TAB BUTTON>88.{

Posted
not only tab. the script no working @.@" i cannot talk to the npc just can see him stand there .~,~"

check for the Error ==''

by the way. the tab only for the first line only? other no need tab?

prontera,158,173,4<TAB BUTTON>script<TAB BUTTON>Coin Exchange<TAB BUTTON>88.{

yes...it only apply in Header ..unles in your script have other header type stuffs... like Function......

Posted

just like what they told you ==''

the getitemname command wrong spelled ==''

it should be getitemname NOT getitename

for the above error...i guess there might be somekind of script has end while you have still added another "Unfinished" script into the text files...

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...