Jump to content
  • 0
manabeast

[Solve]Coin exchange Coin Npc

Question

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
Link to comment
Share on other sites

16 answers to this question

Recommended Posts

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 [email protected], 0; [email protected] < getarraysize(.coin_id); set [email protected], [email protected] + 1) {
mes "1 " + getitename(.coin_id[[email protected]]) + " = " + .coin_trade_amount[[email protected]] + " " + getitemname(.coin_trade_coin[[email protected]]) + "s";
}
close;

case 2: // Trade Coin
next;

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

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

set [email protected]_choice, select([email protected]$) - 1;

if (countitem(.coin_trade_coin[[email protected]_choice]) < .coin_trade_amount[[email protected]_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[[email protected]_choice], .coin_trade_amount[[email protected]_choice];
getitem .coin_id[[email protected]_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
Link to comment
Share on other sites

oh. i see.. thank you very much. :)

and ok. after test i let you know @@" , me now also working hehe~ ned wait tonight.

Edited by manabeast
Link to comment
Share on other sites

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 [email protected], 0; [email protected] < getarraysize(.coin_id); set [email protected], [email protected] + 1) {
mes "1 " + getitename(.coin_id[[email protected]]) + " = " + .coin_trade_amount[[email protected]] + " " + getitemname(.coin_trade_coin[[email protected]]) + "s";
}
close;

case 2: // Trade Coin
next;

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

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

set [email protected]_choice, select([email protected]$) - 1;

if (countitem(.coin_trade_coin[[email protected]_choice]) < .coin_trade_amount[[email protected]_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[[email protected]_choice], .coin_trade_amount[[email protected]_choice];
getitem .coin_id[[email protected]_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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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; ?

Link to comment
Share on other sites

not only tab. the script no working @[email protected]" 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.{

Link to comment
Share on other sites

not only tab. the script no working @[email protected]" 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......

Link to comment
Share on other sites

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

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.