Full Version : Container Question
xmlspawner >>Scripting Support >>Container Question
<< Prev | Next >>
Haazen- 07-20-2006
We have XMLSpawners in a box to spawn armor for new players. We had to set LiftOverride = true so players can take the armor out. The down side of this is that now players can put stuff in the boxes. Is there a way to allow a player to take the spawned stuff out but not put stuff back in?
Or is this just another issue to live with on the revamped containers? hehe
ArteGordon- 07-21-2006
you could make this modification to the basecontainer class in container.cs

QUOTE
public override bool CheckHold( Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight ) { if ( this.IsSecure && !BaseHouse.CheckHold( m, this, item, message, checkItems, plusItems, plusWeight ) ) return false; // ARTEGORDONMOD
// dont allow things to be placed into non-movable containers in the world except for locked down or secured ones
if (Parent == null && !Movable && !IsLockedDown && !IsSecure) return false;
return base.CheckHold( m, item, message, checkItems, plusItems, plusWeight );
}

Haazen- 07-21-2006
Thanks again Arte.
After adding this, for container like our donation boxes, do I just override this and return true or just the oroginal method?
ArteGordon- 07-21-2006
yes, you could just override it and have it return true if you werent concerned about checking the weight and item number and just wanted people to be able to put anything into the container.
Haazen- 07-22-2006
Another container issue.
We have containers that have items for new players to take out. We use XMLSpawners to add the items to the containers.
Item Count in the container decrements at the rate the respawn is set. Example:
XMLSpawner set to respawn NightSite Potion every 30 seconds. Item count decrements every 30 seconds. Our containers are now 5 days old with items counts -1940 and more depending on the respawn time.
Is this a container issue or a XMLSpawner issue?
I thought I read about the containers having count or weight issues but I can not find again what I thought I read.
ArteGordon- 07-22-2006
I'll check it out. It may have to do with the way xmlspawner kept itself from being counted when placed in containers under RunUO 1.0 which now doesnt work under 2.0
ArteGordon- 07-25-2006

QUOTE (Haazen @ July 22, 2006 08:06 am)
Another container issue. We have containers that have items for new players to take out. We use XMLSpawners to add the items to the containers. Item Count in the container decrements at the rate the respawn is set. Example: XMLSpawner set to respawn NightSite Potion every 30 seconds. Item count decrements every 30 seconds. Our containers are now 5 days old with items counts -1940 and more depending on the respawn time.
Is this a container issue or a XMLSpawner issue?
I thought I read about the containers having count or weight issues but I can not find again what I thought I read.

I have modified the way in which xmlspawner hides itself from being included in the normal item count of containers under RunUO 2.0 to deal with the negative count issue.
It will be included in the next release. You can also get it in the updated xmlspawner2.cs in the beta_20_314.zip