with the exception of manually handing out the item. is it possible to make it so that only a specific number of an item can be available on a shard?

eg - a named item called "a Goblin Crown" which you want to have as a random spawn drop on a mob, but only 6 exist on the whole shard
 
the way i would personally do it is to have a certain item dropped on Mob, likely a small chance to drop.

then use that item as currency on a complete custom vendor: Complete Customizable Vendor For Newer Clients [Deleted]

then have your item as a limited inventory

this would allow you to actually build a "sytem" of strong mobiles all over that drop the currency item and have say 5 or 10 limit to each item on the stone.
 
I think you could do that with static int in GoblinCrown.cs.. You need to count that variable up +1 on every construction in the Constructor of GoblinCrown.cs. Furthermore you will need a function to check that current count in the ondeath function of the mobs which shall be dropping, and in perfection you will need to decrease that count in the OnAfterDelete function if a player would drop that Item and let it despawn or if it wouldn't be even looted. Also you will need to save your count in the Deserialization/Serialization method in GoblinCrown.cs. Good luck!

If you want that working for more items than one, you could write your own class (e.g. LimitedItems.cs) to handle that and combine it as a attachment in every limited item. But naturally I don't think you will get to your point with great performance, since you would need to scan every item on the shard for each drop. Example #1 is imho the easiest solution.
 
Last edited:
You could do LimitedItem with persistence saves with a List to track Item and int

persistence saves means you don't need to spawn an item in the world in order for it to save and track the int.
 
Back