yuhsing

Untitled

Nov 11th, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1.  
  2. - shop tax_Shop -1,909:100
  3.  
  4.  
  5. prontera,155,181,5 script Sample#taxshop 757,{
  6. if( select( "Open Shop",( getcharid(0) == getguildmasterid(getcastledata( .CastleMap$,1 )) )?"Collect Tax":"" ) == 1 ){
  7. mes "A Total of "+.TaxRate+"% will be transfer to "+getguildname( getcastledata( .CastleMap$,1 ) )+" Guild.";
  8. callshop "tax_Shop",1;
  9. npcshopattach "tax_Shop";
  10. end;
  11. }else{
  12. mes "Gained total of "+@Guild_Tax+" Zeny.";
  13. if( select("Collect:Cancel") == 1 ){
  14. set Zeny,Zeny + @Guild_Tax;
  15. set @Guild_Tax,0;
  16. mes "Tax Collected.";
  17. }
  18. }
  19. close;
  20.  
  21. OnBuyItem:
  22. set .@TotalCost,0;
  23. for(set .@i,0; .@i < getarraysize( @bought_nameid ); set .@i,.@i+1)
  24. for(set .@j,0; .@j < getarraysize( .Items ); set .@j,.@j+1)
  25. if( .Items[.@j] == @bought_nameid[.@i] )
  26. set .@TotalCost,.@TotalCost + ( .Costs[.@j] * @bought_quantity[.@i] );
  27. if( Zeny >= .@TotalCost ){
  28. set Zeny,Zeny - .@TotalCost;
  29. for(set .@i,0; .@i < getarraysize( @bought_nameid ); set .@i,.@i+1)
  30. getitem @bought_nameid[.@i],@bought_quantity[.@i];
  31. set @Guild_Tax,@Guild_Tax + (( .@TotalCost * .TaxRate ) / 100 );
  32. message strcharinfo(0),"Tax Gained by "+getguildname( getcastledata( .CastleMap$,1 ) )+" Guild : "+(( .@TotalCost * .TaxRate ) / 100 )+" Zeny";
  33. }else{
  34. mes "You dont have enough Zeny...";
  35. }
  36. close;
  37.  
  38.  
  39. OnInit:
  40. // Castle Map Name
  41. set .CastleMap$,"prtg_cas03";
  42. // Tax Gained upon purchasing
  43. set .TaxRate,10;
  44. // Item List + Cost
  45. setarray .Items[0],607,608,512;
  46. setarray .Costs[0],100,200,300;
  47.  
  48. npcshopitem "tax_Shop",512,1000;
  49. npcshopdelitem "tax_Shop",512;
  50. for(set .@i,0; .@i < getarraysize( .Items ); set .@i,.@i+1)
  51. npcshopadditem "tax_Shop",.Items[.@i],.Costs[.@i];
  52. end;
  53.  
  54. }
Advertisement
Add Comment
Please, Sign In to add comment