Exportforce Posted September 14, 2013 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 13 Reputation: 0 Joined: 09/05/13 Last Seen: September 21, 2013 Share Posted September 14, 2013 Hello, is there any known way to save the taxes done by trades ? So other scripts can use it ? Reffering to config: vending_tax thanks Quote Link to comment Share on other sites More sharing options...
Brian Posted September 14, 2013 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted September 14, 2013 getbattleflag("vending_tax") A value of 200 means 2% tax. Since scripts can only do integer math, you'd have to do something like: multiple price by 100 // this converts dollars to cents subtract (price * vending_tax) // subtract 2% tax divide price by 100 // converts cents back to dollars Quote Link to comment Share on other sites More sharing options...
Exportforce Posted September 14, 2013 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 13 Reputation: 0 Joined: 09/05/13 Last Seen: September 21, 2013 Author Share Posted September 14, 2013 But getbattleflag only telly me the set tax? What I need is, when someone buys something for 100 Zeny the script should fetch e.g. 2 Zeny and store them. if someone then buys something for 10000 the script adds another 200. But how do I fetch this value ? Quote Link to comment Share on other sites More sharing options...
Brian Posted September 15, 2013 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted September 15, 2013 Are you talking about the vending_tax that is automatically deducted when players buy from vendors ? --> sorry, that is not saved anywhere. The 2% zeny just "disappears" after the transaction. But you could modify the source code any maybe store it in a global permanent variable like $tax_collected Or are you talking about when someone buys something from a NPC or script, you want to deduct and store the 2% tax? Quote Link to comment Share on other sites More sharing options...
GmOcean Posted September 15, 2013 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted September 15, 2013 (edited) Yea, as Brain is saying, atm it's not possible, you'd need to edit the src code, if your trying to store the tax from a Vending Purchase. However, if your trying to store the tax from a normal NPC purchase, then you'll need to use a Dynamic NPC. You'd first need to use a Dynamic NPC to create the ' tax ' and also store it. At the moment those are your options. But, additionally, you should be able to also edit the src code for a normal NPC, and add a ' tax ' feature. Not exactly sure, what the actual coding to do so is, but the snippet that you need to edit should be here This is in NPC.C for editing normal NPC sells. Couldn't find the purchase section I might have over looked it lol. Just woke up @.@; value = pc_modifysellvalue(sd, sd->inventory_data[idx]->value_sell); z+= (double)value*amount; Now this is for Vening: pc_payzeny(sd, (int)z, LOG_TYPE_VENDING, vsd); if( battle_config.vending_tax ) z -= z * (battle_config.vending_tax/10000.); You'll see here, that it actually, sets your zeny - that tax. So, here is most likely where you'd need to have it store the tax into a var. Not sure how, but Brian.. I'm sure he knows...D: Edited September 15, 2013 by GmOcean 1 Quote Link to comment Share on other sites More sharing options...
Exportforce Posted September 15, 2013 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 13 Reputation: 0 Joined: 09/05/13 Last Seen: September 21, 2013 Author Share Posted September 15, 2013 Okay if that is not possible... sad. Thought, since there is a calculation ,that there are some ways to grab of the ammounts, to have maybe something like a treasure room where all taxes are stored to use them in other ways. Thanks though Quote Link to comment Share on other sites More sharing options...
Question
Exportforce
Hello,
is there any known way to save the taxes done by trades ?
So other scripts can use it ?
Reffering to config: vending_tax
thanks
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.