Jump to content

Recommended Posts

Posted
//===== eAthena Script =======================================

//= TCGCashManager

//===== By: ==================================================

//= nostafu

//===== Current Version: =====================================

//= 1.0

//===== Compatible With: =====================================

//= eAthena SVN

//= 3CeAM

//===== Description: =========================================

//= Converts between Zeny, Cash Point, and TCG

//===== Additional Comments: =================================

//= 1.0 Initial Release

//===== Credits: =============================================

//= nostafu

//============================================================

prontera,244,61,4 script Trust Bank 790,{

set .NPCName$,"[Marvin]"; // NPC Name

set .CP2TCG,1000; // Convertion of Cash Points to TCG (Default:100)

set .Zen2CP,10000000; // Convertion of Zeny to Cash Points (Default:10000000)

set .Zen2TCG,1000000000; // Convertion of Zeny to Cash POints (Default:1000000000)

mes .NPCName$;

mes "Hello, what can I do for you today?";

mes "Convertion Rate:";

mes "^FF0000"+.CP2TCG+"^000000 Cash Points = 1000 TCG";

mes "^FF0000"+.Zen2CP+"^000000 Zeny = 1000 Cash Point";

mes "^FF0000"+.Zen2TCG+"^000000 Zeny = 1000 TCG";

next;

menu "Cash - TCG",CTCG,"Cash - Zeny",CZeny,"TCG - Zeny",TZeny,"View Cash Points",-;

mes ".NPCName$";

mes "You currently have ^ff0000"+#Cashpoints+"^000000 Cash Points in your account";

close;

CTCG:

mes .NPCName$;

mes "What kind of convertion would you like to make?";

next;

switch(select("Cash -> TCG:TCG -> Cash"))

{

case 1:

mes .NPCName$;

mes "How may TCG(s) do you want to exchange?";

input .@num;

next;

set .CPoints,.@num*.CP2TCG;

if(#CASHPOINTS < .CPoints)

{

mes .NPCName$;

mes "Sorry, you don't have enough cash points for this transaction!";

close;

}

set #CASHPOINTS,#CASHPOINTS-.CPoints;

getitem 7227,.@num;

mes .NPCName$;

mes "You currently have ^ff0000"+#Cashpoints+"^000000 Cash Points in your account";

close;

case 2:

mes .NPCName$;

mes "How many TCG(s) will you change?";

input .@num;

next;

set .CPoints,.@num*.CP2TCG;

if(countitem(7227) < .@num)

{

mes .NPCName$;

mes "Sorry, you don't have enough TCG of this transaction!";

close;

}

set #Cashpoints,#Cashpoints+.CPoints;

delitem 7227,.@num;

mes .NPCName$;

mes "You currently have ^ff0000"+#Cashpoints+"^000000 Cash Points in your account";

close;

}

CZeny:

mes .NPCName$;

mes "What kind of convertion would you like to do?";

next;

switch(select("Cash -> Zeny:Zeny -> Cash"))

{

case 1:

mes .NPCName$;

mes "How may Cash Points do you want to exchange?";

input .@num;

next;

if(#Cashpoints < .@num)

{

mes .NPCName$;

mes "Sorry, you don't have enough cash points for this transaction!";

close;

}

set .amount,.Zen2CP*.@num;

set zeny,zeny+.amount;

set #Cashpoints,#Cashpoints-.@num;

mes .NPCName$;

mes "You currently have ^ff0000"+#Cashpoints+"^000000 Cash Points in your account";

close;

case 2:

mes .NPCName$;

mes "How many Cash Points will you change?";

input .@num;

next;

if(zeny < .@num+.Zen2CP)

{

mes .NPCName$;

mes "Sorry, you don't have enough Zeny of this transaction!";

close;

}

set zeny,zeny-.@num*.Zen2CP;

set #Cashpoints,#Cashpoints+.@num;

mes .NPCName$;

mes "You currently have ^ff0000"+#Cashpoints+"^000000 Cash Points in your account";

close;

}

TZeny:

mes .NPCName$;

mes "What kind of convertion would you like to do?";

next;

switch(select("TCG -> Zeny:Zeny -> TCG"))

{

case 1:

mes .NPCName$;

mes "How may TCG do you want to exchange?";

input .@num;

next;

if(countitem(7227) < .@num)

{

mes .NPCName$;

mes "Sorry, you don't have enough TCG for this transaction!";

close;

}

if(zeny !=0)

{

mes .NPCName$;

mes "Make sure you didn't bring any zeny! You might end up dropping them everywhere!";

close;

}

set .camount,.Zen2TCG*.@num;

set zeny,zeny+.camount;

delitem 7227,.@num;

close;

case 2:

mes .NPCName$;

mes "How many TCG will you change?";

input .@num;

next;

if(zeny < .@num+.convtZen)

{

mes .NPCName$;

mes "Sorry, you don't have enough Cash Points of this transaction!";

close;

}

set .camount,.Zen2TCG*.@num;

set zeny,zeny-.camount;

getitem 7227,.@num;

close;

}

}

How to make it like this

10 Cashpoints = 100m

1000 TCG = 1Cashpoints

100000000zeny = 1 TCG

1000TCG = 100m

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

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