Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

currency exchange npc script

Status
Not open for further replies.

vod

Newbie Spellweaver
Joined
Jul 26, 2012
Messages
10
Reaction score
0
I'm looking for a currency exchange npc script.
is there one? please and thank you.
 
Newbie Spellweaver
Joined
Mar 29, 2014
Messages
91
Reaction score
8
What do you want your currency exchanged to? If it's between mesos & a currency item, it's almost always better and more convenient to have it in a command. If you're looking to make a NPC to exchange currency for different items, you should make it on your own. No one will sit here and make you a NPC specific to your needs, not even mentioning the fact that we don't know what you need. Open up any similar NPC, look at it, and try to leech off it unless you're willing to learn, then you could follow this guide:
http://forum.ragezone.com/f428/add-npc-scripting-605225/
 
Upvote 0
Newbie Spellweaver
Joined
Jul 13, 2014
Messages
11
Reaction score
5
It seems to me he is unable to program it himself. Also he phrased it in the form that if it already existed he would simply like to use this code.

Belittling someone is not the best way to get them to learn to do things themselves.

Give a man a fish.
He can eat for a day.
Give a man a fishing pole,
and he will starve unless you teach him to use it.

My take on this old limerick applies here because many servers use NPCs which just swap currency A for mesos, and mesos for A.
Currency B for currency A. Currency A for currency B and so on... maybe up to 5 tiers.

I could see why someone after playing multitudinous servers with such a system would never consider re-scripting this "common-place" script and investing time that could be better spent than reinventing the wheel.

EDIT: Though it does not justify him leeching... I like how he chose to ask though. It was polite.
 
Upvote 0
Newbie Spellweaver
Joined
Mar 27, 2010
Messages
20
Reaction score
0
something like this?


var status = 0;

function start() {
status = -1;
action(1, 0, 0);
}

function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && status == 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {

cm.sendGetText("How many mesos do you want to give exchange for #v4000313 #? \r\n You will receive 5 #v4000313 # per 10,000,000 mesos");

} else if (status == 1) {
var receive = cm.getText();
var receive1=(receive/10000000)*5
if (cm.havemeso(recieve))
{
cm.gainItem(4000313, receive1);
cm.gainmeso(-recieve);
cm.sendOk("Thank you for your mesos");
}
else
{
cm.sendOk("Sorry you dont have enough mesos");
}
}
}
}

may need some minor fixes because I edited it myself lol
 
Upvote 0
Status
Not open for further replies.
Back
Top