Jump to content
  • 0

help me with this script! thank you!


Question

Posted (edited)

This is my coin manager npc, it does trade 10m-zeny = 1 Platinum Coin and viceversa i want to change it to anyone can change Platinum coins to zeny, but to change zeny into platinum coins you have to make a

quest and it will be only for 30 days and you cant change more than 2b zeny per day, my idea is when you talk to the npc he ask you: what do you want to do today? -Trade Platinum coins to Zeny,-Trade Zeny to platinum coins,-Make Platinum permit quest, if you doesnt have the permit to trade zeny into P. coins he will tell you you, im sory but you have to make platinum permit quest to trade zeny into platinum coins, do you want to make platinum permit quest?.   Please help me with this guys thanks in advance ^_^

 

prontera,128,213,5	script	Coin Manager#1::CM	733,{
// Your Server Max Zeny Amount
set .MaxZeny,1000000000;		

// Coins Item ID and each Coins Costs
setarray .Coins[1],677;
setarray .Zeny[1],10000000;

set @Menu$,"";
for( set .@a,1; .@a < getarraysize( .Coins ); set .@a,.@a+1 ){
	set @Menu$,@Menu$ + getitemname( .Coins[.@a] )+":";
	}
while( 1 ){
	mes "Hello I am the Coin Manager, if you are interested in coins you have to talk with me,What can i help you with?";
	next;
	switch( select( "I want trade Coin to Zeny:I want trade Zeny to Coin" ) ){
	Case 1:
			mes "Very well. But im only interested on really expensive Coins made of Platinum:";
			for( set .@a,1; .@a < getarraysize( .Coins ); set .@a,.@a+1 ){
				mes "^0000FF"+getitemname( .Coins[.@a] )+" ^FF0000"+.Zeny[.@a]+"^000000 Zeny.";
				}
			next;
			set .@a,select( @Menu$ );
			mes "Select the Amount of Coins you want to trade into Zeny.";
			mes "You have "+countitem( .Coins[.@a] )+" "+getitemname( .Coins[.@a] )+".";
			input @Amount,0,countitem( .Coins[.@a] );
			if( @Amount < 1 ){
			mes "You don't have that quantity of Coins.";
			}else if( ( Zeny + ( @Amount * .Zeny[.@a] ) ) > .MaxZeny ){
			mes "You can't hold this amount of Zeny.";
			}else{
			set Zeny,Zeny + ( @Amount * .Zeny[.@a] );
			delitem .Coins[.@a],@Amount;
			mes "Done, you have traded "+@Amount+" of "+getitemname(.Coins[.@a])+" into "+( @Amount * .Zeny[.@a] )+" Zeny.";
			}
			next;
			break;
	Case 2:
			mes "Very well. Here is the list on how much each coin is worth:";
			for( set .@a,1; .@a < getarraysize( .Coins ); set .@a,.@a+1 ){
				mes "^0000FF"+getitemname( .Coins[.@a] )+" ^FF0000"+.Zeny[.@a]+"^000000 Zeny.";
				}
			next;
			set .@a,select( @Menu$ );
			mes "Select the Amount of Zeny you want to trade into "+getitemname( .Coins[.@a] )+".";
			mes "You can get maximum of "+Zeny/.Zeny[.@a]+" "+getitemname( .Coins[.@a] )+".";
			input @Amount,0,Zeny/.Zeny[.@a];
			if( @Amount < 1 ){
			mes "You don't have that quantity of Zeny.";
			}else{
			set Zeny,Zeny - ( @Amount * .Zeny[.@a] );
			getitem .Coins[.@a],@Amount;
			mes "Done, you have traded "+( @Amount * .Zeny[.@a] )+" Zeny into "+@Amount+" of "+getitemname(.Coins[.@a])+" .";
			}
			next;
			break;
		}
	}
close;
}


payon,164,222,2	duplicate(CM)	Coin Manager#2	733
turbo_room,93,117,5	duplicate(CM)	Coin Manager#3	733
Edited by eboni001

8 answers to this question

Recommended Posts

  • 1
Posted


prontera,128,213,5 script Coin Manager#1::CM 733,{

// Your Server Max Zeny Amount

set .MaxZeny,1000000000;

// Coins Item ID and each Coins Costs

setarray .Coins[1],677;

setarray .Zeny[1],10000000;

set .@change_zeny_per_day, 2000000000;

// Quest

setarray .@item_need, 7227,5, 7444,100, 969,100, 999,100;

.@size_need = getarraysize( .@item_need );

set @Menu$,"";

for( set .@a,1; .@a < getarraysize( .Coins ); set .@a,.@a+1 )

set @Menu$,@Menu$ + getitemname( .Coins[.@a] )+":";

while( 1 ){

mes "Hello I am the Coin Manager, if you are interested in coins you have to talk with me,What can i help you with?";

next;

switch( select( "I want trade Coin to Zeny:I want trade Zeny to Coin" ) ){

Case 1:

mes "Very well. But im only interested on really expensive Coins made of Platinum:";

for( set .@a,1; .@a < getarraysize( .Coins ); set .@a,.@a+1 ){

mes "^0000FF"+getitemname( .Coins[.@a] )+" ^FF0000"+.Zeny[.@a]+"^000000 Zeny.";

}

next;

set .@a,select( @Menu$ );

mes "Select the Amount of Coins you want to trade into Zeny.";

mes "You have "+countitem( .Coins[.@a] )+" "+getitemname( .Coins[.@a] )+".";

input @Amount,0,countitem( .Coins[.@a] );

if( @Amount < 1 ){

mes "You don't have that quantity of Coins.";

}else if( ( Zeny + ( @Amount * .Zeny[.@a] ) ) > .MaxZeny ){

mes "You can't hold this amount of Zeny.";

}else{

set Zeny,Zeny + ( @Amount * .Zeny[.@a] );

delitem .Coins[.@a],@Amount;

mes "Done, you have traded "+@Amount+" of "+getitemname(.Coins[.@a])+" into "+( @Amount * .Zeny[.@a] )+" Zeny.";

}

next;

break;

Case 2:

if ( zeny_coin_quest < gettimetick(2) ) {

mes "im sory but you have to make platinum permit quest to trade zeny into platinum coins, do you want to make platinum permit quest?";

next;

if ( select( "yes", "no" ) -1 ) end;

mes "you need :";

for ( .@i = 0; .@i < .@size_need; .@i += 2 )

mes "- "+ .@item_need[.@i+1] +" "+ getitemname( .@item_need[.@i] );

mes "and 100,000,000z";

next;

if ( select( "give the items", "leave" ) -1 ) close;

.@j = 0;

for ( .@i = 0; .@i < .@size_need; .@i += 2 )

if ( countitem( .@item_need[.@i] ) < .@item_need[.@i+1] ) {

if ( !.@j ) mes "I'm sorry you need";

mes "- "+ ( .@item_need[.@i+1] - countitem( .@item_need[.@i] ) ) +" "+ getitemname( .@item_need[.@i] );

.@j++;

}

if ( Zeny < 100000000 )

mes "You need "+ ( 100000000 - Zeny ) +" zeny.";

if ( .@j || Zeny < 100000000 ) close;

for ( .@i = 0; .@i < .@size_need; .@i += 2 )

delitem .@item_need[.@i], .@item_need[.@i+1];

Zeny = Zeny - 100000000;

zeny_coin_quest = gettimetick(2) + 30 * 86400;

close;

}

else if ( getstrlen( maxchange_zeny_per_day$ ) ) {

explode( .@tmp$, maxchange_zeny_per_day$, "|" );

if ( atoi( .@tmp$ ) == gettime(4) && atoi( .@tmp$[1] ) > .@change_zeny_per_day ) {

mes "I'm sorry you can't exchange more than "+ .@change_zeny_per_day +" zeny per day.";

close;

}

else if ( atoi( .@tmp$ ) != gettime(4) )

.@tmp$[1] = 0;

}

mes "Very well. Here is the list on how much each coin is worth:";

for( set .@a,1; .@a < getarraysize( .Coins ); set .@a,.@a+1 ){

mes "^0000FF"+getitemname( .Coins[.@a] )+" ^FF0000"+.Zeny[.@a]+"^000000 Zeny.";

}

next;

set .@a,select( @Menu$ );

mes "Select the Amount of Zeny you want to trade into "+getitemname( .Coins[.@a] )+".";

mes "You can get maximum of "+Zeny/.Zeny[.@a]+" "+getitemname( .Coins[.@a] )+".";

input @Amount,0,Zeny/.Zeny[.@a];

if( @Amount < 1 ){

mes "You don't have that quantity of Zeny.";

}else{

set Zeny,Zeny - ( @Amount * .Zeny[.@a] );

getitem .Coins[.@a],@Amount;

mes "Done, you have traded "+( @Amount * .Zeny[.@a] )+" Zeny into "+@Amount+" of "+getitemname(.Coins[.@a])+" .";

.@tmp$ = gettime(4);

.@tmp$[1] = atoi( .@tmp$[1] ) + @Amount * .Zeny[.@a];

maxchange_zeny_per_day$ = implode( .@tmp$, "|" );

}

next;

break;

}

}

close;

}

payon,164,222,2 duplicate(CM) Coin Manager#2 733

turbo_room,93,117,5 duplicate(CM) Coin Manager#3 733

  • Upvote 1
Posted

ty for reply ^_^ idk why but the quest its not working npc its the same coins to zeny-zeny to coins, no more,  how to fix this? and how to add the items i want npc to ask for the quest?

Posted

Show me your quest

if you mean the items i want mvp request for the quest: 5-TCG Card(id:7227) 100-Treasure box(id:7444) 100-gold(id:969) 100-Steel(id:999) and 100,000,000z

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...