Full Version : Own taxes.
xmlspawner >>Scripting Support >>Own taxes.
<< Prev | Next >>
Galfaroth- 02-21-2006
Hello everyone. I wish to make my own non-factional taxes:

CODE
public virtual int GetPriceScalar() { private int podatek = 20; Town town = Town.FromRegion( this.Region ); if ( town != null )
return (100 + town.Tax);
if ( town == "Stary Oboz" && from.Oboz == 1 )
return (100 - podatek);
return 100;
}

It's from BaseVendor.cs, but from.Oboz == 1 is player who buys things and it won't compile. What should I add to this code to make it work?
E.g.: Vendor stays in Town: Stary Oboz and Player who buys sth from him has Oboz = 1 and he can buy things cheaper, because tax = 100-20=80.
Dian- 02-21-2006
The method there has no reference to what 'from' is..
Galfaroth- 02-21-2006
And how to reference this?
Dian- 02-21-2006
well, one way would to be changing these methods from this

CODE
public virtual int GetPriceScalar() public void UpdateBuyInfo()

to this

CODE
public virtual int GetPriceScalar(Mobile from) public void UpdateBuyInfo(Mofile from)

and then, to the UpdateBuyInfo() calls within the script.. change to

CODE
UpdateBuyInfo(from)

should work, unless there are other scripts that call the UpdateBuyInfo() but I dont think there are.