Jump to content
  • 0

[Solve]Coin exchange Coin Npc


manabeast

Question


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

which one is the right syntax? platinum is first or third?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

Bronze, Silver, Gold, Plat, Mithril is the order JGuy

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

can you put in txt and attach send to me? if put here the tab will gone. waiting you fix. bump

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  1315
  • Reputation:   372
  • Joined:  12/10/11
  • Last Seen:  

He already did the whole thing for you and you can't take the script yourself and add in a Tab? Come on now. It's not that hard.

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

http://rathena.org/board/topic/54002-wing-evolution/page__gopid__60219#entry60219

the second one is for coin exchange npc problem. the first one i hv post in other place request other help. becos is evole wing problem.

post-472-0-86528800-1323790454_thumb.png

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

lol I always mispell that... MN are too close together /no1

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

oh ... no wonder i cannot find the getitem in wing.evo. it's in coin x.x" thx i go my friend house try tonight.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

forgot leave msg . it's work !! thank you very much . thx thx :D

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