Jump to content
  • 0

Tax Script


zmref

Question


  • Group:  Members
  • Topic Count:  148
  • Topics Per Day:  0.03
  • Content Count:  299
  • Reputation:   6
  • Joined:  06/14/12
  • Last Seen:  

Please script this for me

this "player" will take the 10% tax from the transaction on a shop NPC

Example If someone bought an item costs 10,000 zeny the player will take the 10% of it from that someone, thus making the player earn 1k from that transaction.

It's hard!! :(

Edited by zmref
Link to comment
Share on other sites

17 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.03
  • Content Count:  265
  • Reputation:   11
  • Joined:  01/11/13
  • Last Seen:  

What would it be like for merchants not to use the discount when they went to buy?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

player B put item ID 501 into a Dynamic Shop, set the cost at 35 mithril coins

player A buy the item ID 501 from Dynamic Shop with 35 mithril coins, player B earns 38 mithril coins ...

like this ?

seems like my theory is wrong

btw, I believe this script seriously needed a *writemail script command, to send a transaction item by mailing to the seller ...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  148
  • Topics Per Day:  0.03
  • Content Count:  299
  • Reputation:   6
  • Joined:  06/14/12
  • Last Seen:  

No it's not like that. It's like a TAX system. example you buy an item on a NPC shop costs 10k, and I'll receive the 1k as a 10% tax on your purchase

let me give you a condition

If "this player" bought an item on a NPC, 10% tax would be given to "this player"

Edited by zmref
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10014
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

you mean .... NPC shop sell Jellopy at 10,000 zeny ....

Player A buy a Jellopy from the NPC and pay 10,000 Zeny...

then he gain back 10% ( 1,000 Zeny ) from the NPC ????

elaborate your stuff in DETAILS.....

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

I think i know what he means:

Example: Player A Owns 'Jellopy' shop. Player B purchases 1 jellopy for 10,000z from Player A's Jellopy shop. Player A collects TAX from NPC, resulting in earning 1,000z.

*Note - That in this example, Player A does not supply the shop with items, he just basically is the Govenor and get's paid the tax money.*

I've seen this in a few games, one of which came out recently, TERA online.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

yeah actually I also don't understand him

but I can think of 2 possible scenario

scenario 1

player A rent a npc A for 1 month ( of course the item sells are unique )

everyone can buy the items selling from npc A

after 1 month, npc A will send a mail, of total 10% TAX from all the transaction of the past 1 month

( use dynamic shop script,

every time a player ...

OnBuyItem:

$tax_system[ atoi(strnpcinfo(2) ] += sum( getiteminfo( @bought_nameid, 1 ) * @bought_quantity )

at the end of the month,

*sendmail to $tax_system_owner[ atoi(strnpcinfo(2) ]; )

scenario 2

a guild owns prontera castle A

prontera castle A has a special npc B that sells unique items

everyone can buy unique items selling from special npc B

everytime a new woe start,

the system will automatically *sendmail to the guild master owning that castle of all the 10% total transaction between the OnAgitstart

( ... well no need to explain much ... OnAgitStart: sendmail ... getguildmasterid ... )

EDIT: yeah, GmOcean say something similar to my scenario 1

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

If you want this on every shop, this is probably a source request, then.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Lol, it'd be easier with a src request that's for sure, but it's possible without one.... Just gotta create NPC's at each shop's location and have them call the shop, and use your specified dynamic shop script, for tax purposes. I've done it before to lock people out of shops as a form of account security. I made it so, if they didn't have the right variable, no shops would let them buy or sell. Though now this is easily done without scripts.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  

scenario 2

a guild owns prontera castle A

prontera castle A has a special npc B that sells unique items

everyone can buy unique items selling from special npc B

everytime a new woe start,

the system will automatically *sendmail to the guild master owning that castle of all the 10% total transaction between the OnAgitstart

( ... well no need to explain much ... OnAgitStart: sendmail ... getguildmasterid ... )

EDIT: yeah, GmOcean say something similar to my scenario 1

I LIKE THIS ONE

If this is made, i'll surely take it.

No it's not like that. It's like a TAX system. example you buy an item on a NPC shop costs 10k, and I'll receive the 1k as a 10% tax on your purchase

let me give you a condition

If "this player" bought an item on a NPC, 10% tax would be given to "this player"

Basically, to make this work is if another player owns a NPC..

because, if the shop is just going to get the TAX that you are saying,

then, you might as well just put DISCOUNT skill on all jobs..

so in my opinion POST#5 and POST#6 scenario 2 would be the best script for this.

im sure they can come up with a way how to own a NPC if its not in a guild war or some sort.

Edited by stydianx
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

This is just an example NPC, as such, it doesn't calculate MC_DISCOUNT, so all prices are at face value, even if the merchant has discount level 10.

How it works:

If no one owns the shop, no one can use the NPC. At the start of each WoE (First Edition), it will give the owner all the tax it has collected. At the end of each WoE (First Edition) it will change it's owner to the guild leader of Kriemhild castle. Other than that, it acts as a normal shop, for buy and sell.

Note - This npc, does not add a tax value to items, it just gives the shop owner 10% of all sales.

Note2 - Overcharge does not work with this npc as well, when selling items, as i didn't add in a MC_OVERCHARGE calc.

taxshop.txt

Edit: This script was not tested as I'm at work and should not be scripting lmao @.@;

Edited by GmOcean
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  

This is just an example NPC, as such, it doesn't calculate MC_DISCOUNT, so all prices are at face value, even if the merchant has discount level 10.

How it works:

If no one owns the shop, no one can use the NPC. At the start of each WoE (First Edition), it will give the owner all the tax it has collected. At the end of each WoE (First Edition) it will change it's owner to the guild leader of Kriemhild castle. Other than that, it acts as a normal shop, for buy and sell.

Note - This npc, does not add a tax value to items, it just gives the shop owner 10% of all sales.

Note2 - Overcharge does not work with this npc as well, when selling items, as i didn't add in a MC_OVERCHARGE calc.

taxshop.txt

Edit: This script was not tested as I'm at work and should not be scripting lmao @.@;

/no1/lv/kis2/kis/ok nice..

can you make this like for example:

if guild rAthenaboys runs kriemhild caste then they own all NPC at lighthalzen, the GM then gets 10% tax of all purchased items

each they that they hold the castle?

Edited by stydianx
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

I could but i'm not going to, that would require going throught shops.txt file in NPCs folder, and turning each Lighthalzen shop into a floating shop, then making an NPC for each one, that calls a specified shop. That's work for a server owner to do.

I just told you how to do it, now you can learn.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  

I could but i'm not going to, that would require going throught shops.txt file in NPCs folder, and turning each Lighthalzen shop into a floating shop, then making an NPC for each one, that calls a specified shop. That's work for a server owner to do.

I just told you how to do it, now you can learn.

ohh.. okay, so it's individual.. i thought you could make just 1 script that will work like a duplicate and create many NPC;s in a town..

okay, maybe duplicate will do the trick! thanks!

Edited by stydianx
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  148
  • Topics Per Day:  0.03
  • Content Count:  299
  • Reputation:   6
  • Joined:  06/14/12
  • Last Seen:  

sorry for the late reply

yeah you guys are right

Player A purchase 1 jellopy (cost 10k) Player B earned 10% tax(1K zeny) from the transaction

ok ok now my idea was cracked

what will I'm going to do is

Input that script on the guild related codes

thus making that script like...

When THISGUILD conquered this castle all NPC shops are now theirs thus getting the 10% tax on every single purchases of any player/s

If you want this on every shop, this is probably a source request, then.

No this is just for a single NPC shop

Player A bought jellopy (costs 10K) Guildowner(earns 1K from 10% tax of the purchased item).

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

prontera,155,180,5	script	kjhfksjdhf	100,{
if ( select ( "add", "delete", "shop" ) == 3 ) {
	callshop "guild_shop_hidden#"+ 1, 1;
	close;
}
else if ( @menu == 1 ) {
	.@add = select( .accepted_id_menu$ ) -1;
	for ( .@i = 0; .@i < .guild_shop_size[1]; .@i += 2 ) {
		if ( .accepted_id[ .@add ] == getd(".guild_shop_sellid"+ 1 +"["+ .@i +"]") ) {
			mes getitemname( .accepted_id[ .@add ] ) +" is repeated";
			close;
		}
	}
	input .@price, getiteminfo( .accepted_id[ .@add ] , 0 ), 1000000000;
	npcshopadditem "guild_shop_hidden#"+ 1, .accepted_id[ .@add ], .@price;
	setarray getd(".guild_shop_sellid"+ 1 +"["+ .guild_shop_size[1] +"]"), .accepted_id[ .@add ], .@price;
	$guild_shop_sellid$[1] = $guild_shop_sellid$[1] + .accepted_id[ .@add ] +"#"+ .@price +"#";
	.guild_shop_size[1] += 2;
	close;
}
else if ( @menu == 2 ) {
	.@menu$ = "";
	for ( .@i = 0; .@i < .guild_shop_size[1]; .@i += 2 )
		.@menu$ = .@menu$ + getitemname( getd(".guild_shop_sellid"+ 1 +"["+ .@i +"]") ) +":";
	.@delete = select( .@menu$ ) -1;
	npcshopdelitem "guild_shop_hidden#"+ 1, getd(".guild_shop_sellid"+ 1 +"["+ .@delete *2 +"]");
	deletearray getd(".guild_shop_sellid"+ 1 +"["+ .@delete *2 +"]"), 2;
	.guild_shop_size[1] -= 2;

	$guild_shop_sellid$[1] = ""; // reconstruct
	for ( .@i = 0; .@i < .guild_shop_size[1]; .@i++ )
		$guild_shop_sellid$[1] = $guild_shop_sellid$[1] + getd(".guild_shop_sellid"+ 1 +"["+ .@i +"]") +"#";
	close;
}
close; // doesn't read
OnInit:
setarray .accepted_id, 501,502,503,504,505,506; // accepted item ID

npcshopdelitem "guild_shop_hidden#"+ 1, 501;

.@size = getarraysize( .accepted_id );
for ( .@i = 0; .@i < .@size; .@i++ )
	.accepted_id_menu$ = .accepted_id_menu$ + getitemname( .accepted_id[.@i] ) +":";

if ( $guild_shop_sellid$[1] == "" ) end;
explode .@guild_shop_sellid$, $guild_shop_sellid$[1], "#";
.guild_shop_size[1] = getarraysize( .@guild_shop_sellid$ );
for ( .@i = 0; .@i < .guild_shop_size[1]; .@i += 2 ) {
	npcshopadditem "guild_shop_hidden#"+ 1, atoi( .@guild_shop_sellid$[ .@i ] ), atoi( .@guild_shop_sellid$[ .@i +1 ] );
	setarray getd(".guild_shop_sellid"+ 1 +"["+ .@i +"]"), atoi( .@guild_shop_sellid$[ .@i ] ), atoi( .@guild_shop_sellid$[ .@i +1 ] );
}
end;
}
-	shop	guild_shop_hidden#1	-1,501:1000

this script is seriously tough,

just 50 lines already looks like this

and not even 30% finish

this is just a sketch script to manipulate dynamic shop in-game

if perhaps there's another idea to tackle this function ?

or else I'll be using the same technique from my mission board script

will try complete this little bit day by day

EDIT:

yeah I'll add in some stuffs posted by GmOcean in post#10 later

that manipulating item ID and item price is somehow new system to me

I dunno which is the best method to deny the item ID

because if there's no protection, guild master can setup a shop and buy them that is usually not available by normal means

EDIT2:

or maybe I did wrong ? lol

issit the shop npc should've sell a preset list of items ?

suddenly I have a feeling I made wrong script again ...

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10014
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

or maybe it's something like this..?

http://pastebin.com/raw.php?i=vnqJevtM


http://rathena.org/b...pt/#entry154831

awesome script

u can make multi guild castle ?

if tax 10% and share all to 4 guild 2.5 x4 or 10% tax to 4 guild no share

thanks

sorry for my bad english

http://pastebin.com/raw.php?i=yZvG8usH

Edited by Emistry
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  148
  • Topics Per Day:  0.03
  • Content Count:  299
  • Reputation:   6
  • Joined:  06/14/12
  • Last Seen:  

or maybe it's something like this..?

http://pastebin.com/raw.php?i=vnqJevtM


http://rathena.org/b...pt/#entry154831

awesome script

u can make multi guild castle ?

if tax 10% and share all to 4 guild 2.5 x4 or 10% tax to 4 guild no share

thanks

sorry for my bad english

http://pastebin.com/raw.php?i=yZvG8usH

Thank you very much emistry, gonna test it. hopefully this works.

Link to comment
Share on other sites

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.

×
×
  • Create New...