30 Jul, 2010, arholly wrote in the 1st comment:
Votes: 0
I thought there was at one time, a snippet for allowing for unique items (one-pop items). Is there code out there for doing this or is there someone who'd be willing to work with a (relative) newbie coder on it?

Thanks in advance,
30 Jul, 2010, jurdendurden wrote in the 2nd comment:
Votes: 0
You can attain this functionality without touching a single line of code. Just make an area in your mud called 'unique items', then make all the uniques you want in that area. Set security so no one can mess with it but you (or whoever you want), and pass out the items as you please.
30 Jul, 2010, Mudder wrote in the 3rd comment:
Votes: 0
jurdendurden said:
You can attain this functionality without touching a single line of code. Just make an area in your mud called 'unique items', then make all the uniques you want in that area. Set security so no one can mess with it but you (or whoever you want), and pass out the items as you please.

While that would work, I don't think it's what the OP had in mind. I think arholly wants a unique item system that works with resets to only create one instance of an item ever.

If a player has it, even if offline, it doesn't return at reset. If it is destroyed, it then gets recycled back through the resets.
30 Jul, 2010, Rarva.Riendf wrote in the 4th comment:
Votes: 0
I implemented unique items on my mud, but you cannot have a 'snippet' for that.
You have to code it all over the place.

As an example:
No sacrificing them, no giving them to mobs, No scavenger, no enchanting till destroying them, no recycling them etc etc.

At boot have a routine that check if your item is on a player (easier than to track everywhere who has it, and also helps if you want to modify all chars at a time for any other reason anyway) and do not load it.

Very tedious process depending on what your mud allow to do with objects, or what you want to achieve.
30 Jul, 2010, Kjwah wrote in the 5th comment:
Votes: 0
Couldn't you just add a new flag such as poponce when an item is looted flagged poponce just remove it's reset so it doesn't spawn again?

I haven't used a ROM based MUD since 2000 so maybe I'm not remembering correctly but I think I did something almost exactly like that. Iono, waiting on my friend to send me my old code from 99 so maybe I'll actually have the method that I did it and be able to upload the changes.
30 Jul, 2010, quixadhal wrote in the 6th comment:
Votes: 0
Just add a "unique" flag to your list of item flags. Whenever an item flagged as unique is about to be created, check a list of unique items. If that vnum/id is on the list, the creation fails. If not, it works and you add it to the list (which gets saved to disk). If you destroy such an item, it gets removed from the list, allowing it to be created again.
31 Jul, 2010, Oliver wrote in the 7th comment:
Votes: 0
Wouldn't it be easier, on a RoM game, to make a flag on the pIndexData for "limit?" If it's limit 1, then the item can only be loaded once. In create_object() and extract_object(), you could make the functions respectively decrement and increment an object's limit. If an object's limit is <1, in whatever function takes care of reset loads, don't load it.

I suppose it would be smart to make the game also load all the players at boot-up to make certain that the limit matches with its set original value, to cover the potential loophole of objects not being correctly extracted.
31 Jul, 2010, Rarva.Riendf wrote in the 8th comment:
Votes: 0
arholly: at this point you have many solutions that all kinda work depending on your goal. Unless you are more specific to what represent a unique item for you, hard to tell wich solution will best suit you.
31 Jul, 2010, Hades_Kane wrote in the 9th comment:
Votes: 0
I've given this a lot of thought and have some basic ideas on how I want to accomplish this.

Basically I'm going to have a text file that will keep up with items that are flagged as unique. When the game boots, it will check the text file for the unique item, check to see who has it and how long its been since they have logged on. If its been too long since the person has had it, or if no one has it, it will follow predetermined loading parameters (I'll have some reset somewhere randomly in the world, some will be available as the result of a quest, others might just go in a predetermined spot). When a player logs on, it will double check against this file to see if they should have a unique item, and if they have one on them and it doesn't match the file, it will remove from them. I haven't planned enough to entirely figure out integration of the OLC editing of objects to modify the file and everything else, as this is a frills project I'll get to eventually when more core things are finished. But in a nutshell, that's the basic idea. I also plan on other things that might remove the unique item, depending on the "personality" of the item. Such as the Masamune might leave you if your alignment shifts too far from good or if you kill something innocent, another one might leave you if you die, etc. Our PK system is an opt-in system, where once you flag yourself as PK then there is no going back, but there are some things that can temporarily remove your PK-Safe (such as Lycans when shifted into their lycan form during the full moon are always PKable), and that's another consideration of having a unique weapon… As long as you possess one, you can't be PK Safe.

But those are some ideas I've kicked around. When implementation of that actually goes into affect, that might change a bit, but that might be another way of considering it.