Jump to content
  • 0

[Need Help]Tax-Shop


Question

Posted (edited)

Hi i need a help i have a tax shop added to my server but if someone get the castle and someone buy items to the tax shop you will get error and you need to close your client 

and if no ones own the castle u can buy without error

 

here is the tax shop script

-	shop	tax_Shop	-1,909:100

prontera,164,173,5	script	Tax Castle Shop	757,{
if( select( "Open Shop",( getcharid(0) == getguildmasterid(getcastledata( .CastleMap$,1 )) )?"Collect Tax - "+$Guild_Tax+" zeny":"" ) == 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_cas01";
// Tax Gained upon purchasing
set .TaxRate,10;
// Item List + Cost
setarray .Items[0],611,1750,1752,1751,501,502,503,504,506,533,645,656,657,601,602,1065,2239;
setarray .Costs[0],40,1,3,3,50,200,550,1200,40,200,800,1500,3000,60,300,100,10000;

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;

}
Edited by eXibitz

3 answers to this question

Recommended Posts

Posted (edited)

I have no errors with this script at all.  The only thing I could think of is you're using a client dating prior to 2013-12-23.  As this client or newer is required for you to use the npcshop script commands.

 

But you said if no one owns the castle it works?  So that makes no sense.  I can buy with the castle owned and not owned and characters in or out of the owning guild.  Does your server see any errors at all?  or maybe a better description of the error people are receiving.

Edited by Terrinigma

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