Jump to content
  • 0

A couple of scripts I need


Balmung

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   2
  • Joined:  11/08/12
  • Last Seen:  

Aight so i need a script for an eathena server.

Silver coin exchanger

ID for silver coin 27004

  • trades silver coins into items

  • Needs to be able to be easily editable and organized(of course)

  • Needs to have a menu type of shop. Look below for an example

Untitled_zps557244f0.png

Gold Coin Exchanger

ID for gold coin exchanger 27005

  • See silver coin exchanger.

Event ticket NPC

ID for event ticket 27007

  • See silver coin exchanger

  • Needs to be able to change event tickets into zeny as well. 1 Event ticket = 100 mil

Bank Note NPC

ID For Bank Note = 27000

  • Convert bank notes to zeny (1,000,000z for 1 bank note)

  • Converts zeny to banknote

  • Has a storage system for bank notes

  • Tells you on first menu how many bank notes you have in your inventory and story

Each need to be seperate NPCs. Thanks and remember I use EATHENA!

Edited by Balmung
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  91
  • Reputation:   8
  • Joined:  03/03/12
  • Last Seen:  

this is not a forum for EA dude :)

Link to comment
Share on other sites


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


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  127
  • Reputation:   36
  • Joined:  01/21/13
  • Last Seen:  

Hey Balmung,

Give this a go; should suit exactly what you needed for your coin exchanger. exc.txt

// Coin Exchanger
// by Via

prontera,138,171,5	script	Via	704,{

set .Coin,909;		// Coin ID
set .Coin2,908;		// Lesser Coin ID
set .ExcName$, "[^FF5555Via^000000]";		// NPC Name
set .ExcCoin,1;		// Exchange Rate for Coin
set .ExcCoin2,10;	// Exchange Rate for Lesser Coin

mes .ExcName$;
mes "Welcome, " + strcharinfo(0) + ".";
mes "I can exchange your coins for you.";
next;
switch( select("Exchange Coins:View Rewards") )
{
case 1:
	mes .ExcName$;
	mes "Exchange rates are " + .ExcCoin + " " + getitemname(.Coin) + " per " + .ExcCoin2 + " " + getitemname(.Coin2) +".";
	mes " ";
	mes "How many " + getitemname(.Coin) + " would you like?";
	next;

	input .@Exchange;

	if(countitem(.Coin2) < .@Exchange*.ExcCoin2)
	{
		mes .ExcName$;
		mes "I'm sorry, but you don't have enough " + getitemname(.Coin2) + " for that many " + getitemname(.Coin) + ".";
		mes " ";
		mes "Talk to me again when you have at least " + .@Exchange*.ExcCoin2 + " " + getitemname(.Coin2) + " in your inventory.";
		close;
	}

	mes .ExcName$;
	mes "Looks like you have enough! Are you sure you want to exchange " + .@Exchange*.ExcCoin2 + " " + getitemname(.Coin2) + " for " + .@Exchange + " " + getitemname(.Coin) + "?";

	next;	
	if( select("Yes, let's trade!:No, thanks") == 2 )
	{
		mes .ExcName$;
		mes "Okay. Come again if you change your mind.";
		close;
	}

	if( .@Exchange*.ExcCoin2 > countitem(.Coin2) )
	{
		mes .ExcName$;
		mes "What's this? Have you lost your purse? Come back when you've got proper funds.";
		close;
	}

	delitem .Coin2,.@Exchange*.ExcCoin2;
	getitem .Coin,.@Exchange;


	mes .ExcName$;
	mes "Here you go! Use your " + getitemname(.Coin) + " wisely!";
	close;

case 2:
	setarray .@Items[0],   503,  504,  505;
	setarray .@Amount[0],	   1,	1,	1;
	setarray .@Value[0],	 1,	 1,	 1;
	break;
}

set .@Menu$, "";
for( set .@i, 0; .@i < getarraysize(.@Items); set .@i, .@i + 1 )
	set .@Menu$, .@Menu$ + .@Amount[.@i] + " " + getitemname(.@Items[.@i]) + " (" + .@Value[.@i] + " " + getitemname(.Coin) + "):";
	set .@j, select(.@Menu$) - 1;

mes .ExcName$;
mes "How many " + getitemname(.@Items[.@j]) + " do you want to buy? (1 - 50)";
mes " ";
mes "It will cost you " + .@Value[.@j] + " " + getitemname(.Coin) + " each.";
next;

input .@total;
if( .@total < 1 || .@total > 50 )
{
	mes .ExcName$;
	mes "I'm sorry; please input a value from 1 to 50. Talk to me again when you've made a selection.";
	close;
}

set .@vtotal, .@total * .@Value[.@j]; // Value of all items
set .@total, .@total * .@Amount[.@j]; // Total Amount of Items

// Check Weight Limit
if( checkweight(.@Items[.@j],.@total) == 0 )
{
	mes .ExcName$;
	mes "It seems that you would be overweight from this sale. Talk to me again after you've placed items in storage.";
	close;
}

if( countitem(.Coin) < .@vtotal )
{
	mes .ExcName$;
	mes "You do not have enough " + getitemname(.Coin) + ". Participate in events to receive them.";
	mes " ";
	mes "Required " + getitemname(.Coin) + ": ^0000FF" + .@vtotal + "^000000";
	close;
}

set .@vcount, .@vtotal;
set .@i909, countitem(.Coin);	

if( .@i909 > .@vcount ) set .@i909,.@vcount;
set .@vcount, .@vcount - .@i909;


// Final Checks
if( .@vcount != 0 )
{
	mes .ExcName$;
	mes "Sorry, not enough coins to pay the total value.";
	close;
}

mes .ExcName$;
mes "To confirm your purchase, you are exchanging ^0000FF" + .@i909 + "^000000 "+ getitemname(.Coin) + " for " + .@total + " " + getitemname(.@Items[.@j]) + ". Is this correct?";
next;

if( select("Yes, bring me my " + getitemname(.@Items[.@j]) + "!:No, that's not what I wanted") == 2 )
{
	mes .ExcName$;
	mes "Okay. Come again if you change your mind.";
	close;
}

if( .@i909 > countitem(.Coin) )
{
	mes .ExcName$;
	mes "What's this? Have you lost your purse? Come back when you've got proper funds.";
	close;
}

delitem .Coin,.@i909;
getitem .@Items[.@j],.@total;


mes .ExcName$;
mes "Here you go! Use your " + getitemname(.@Items[.@j]) + " wisely!";
close;
}

You can adjust the NPC's name, coin Item IDs, and exchange rates by modifying the values in these lines:

set .Coin,909;		// Coin ID
set .Coin2,908;		// Lesser Coin ID
set .ExcName$, "[^FF5555Via^000000]";		// NPC Name
set .ExcCoin,1;		// Exchange Rate for Coin
set .ExcCoin2,10;	// Exchange Rate for Lesser Coin

Change the Item IDs, amounts, and values in these arrays.

case 2:
	setarray .@Items[0],   503,  504,  505;
	setarray .@Amount[0],	   1,	1,	1;
	setarray .@Value[0],	 1,	 1,	 1;
	break;

this is not a forum for EA dude :)

That was so helpful; you totally deserve a +1, and I would definitely recommend you and your services to all of my friends.

/sarcasm, if you were too thick to figure that out yourself.

Edited by Via
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   2
  • Joined:  11/08/12
  • Last Seen:  

thank you via and emistry! I'll try it out now.

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