Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - shop tax_Shop -1,909:100
- prontera,155,181,5 script Sample#taxshop 757,{
- if( select( "Open Shop",( getcharid(0) == getguildmasterid(getcastledata( .CastleMap$,1 )) )?"Collect Tax":"" ) == 1 ){
- mes "A Total of "+.TaxRate+"% will be transfer to "+getguildname( getcastledata( .CastleMap$,1 ) )+" Guild.";
- callshop "tax_Shop",1;
- npcshopattach "tax_Shop";
- end;
- }else{
- mes "Gained total of "+@Guild_Tax+" Zeny.";
- if( select("Collect:Cancel") == 1 ){
- set Zeny,Zeny + @Guild_Tax;
- set @Guild_Tax,0;
- mes "Tax Collected.";
- }
- }
- close;
- OnBuyItem:
- set .@TotalCost,0;
- for(set .@i,0; .@i < getarraysize( @bought_nameid ); set .@i,.@i+1)
- for(set .@j,0; .@j < getarraysize( .Items ); set .@j,.@j+1)
- if( .Items[.@j] == @bought_nameid[.@i] )
- set .@TotalCost,.@TotalCost + ( .Costs[.@j] * @bought_quantity[.@i] );
- if( Zeny >= .@TotalCost ){
- set Zeny,Zeny - .@TotalCost;
- for(set .@i,0; .@i < getarraysize( @bought_nameid ); set .@i,.@i+1)
- getitem @bought_nameid[.@i],@bought_quantity[.@i];
- set @Guild_Tax,@Guild_Tax + (( .@TotalCost * .TaxRate ) / 100 );
- message strcharinfo(0),"Tax Gained by "+getguildname( getcastledata( .CastleMap$,1 ) )+" Guild : "+(( .@TotalCost * .TaxRate ) / 100 )+" Zeny";
- }else{
- mes "You dont have enough Zeny...";
- }
- close;
- OnInit:
- // Castle Map Name
- set .CastleMap$,"prtg_cas03";
- // Tax Gained upon purchasing
- set .TaxRate,10;
- // Item List + Cost
- setarray .Items[0],607,608,512;
- setarray .Costs[0],100,200,300;
- npcshopitem "tax_Shop",512,1000;
- npcshopdelitem "tax_Shop",512;
- for(set .@i,0; .@i < getarraysize( .Items ); set .@i,.@i+1)
- npcshopadditem "tax_Shop",.Items[.@i],.Costs[.@i];
- end;
- }
Advertisement
Add Comment
Please, Sign In to add comment