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.
The method there has no reference to what 'from' is..
And how to reference this?
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
should work, unless there are other scripts that call the UpdateBuyInfo() but I dont think there are.