One more note about my above code. Was doing this as an example but if you are using this code I suggest adding the following checks because if you do use it on BaseWeapon or something else you might not have control over, you'll run into errors with the types found being abstract or not public...
I would add another method to the RandomRewardItem class to return a list of items because GetReward() actually creates instances of the item each time it's called so you would want to build the list internally to avoid that. You could add a second method like so to return an amount of rewards...
You can still do what you want without having to type out each known item in code by using some Reflection. Was just trying to keep it simple ;). Try this sample I just whipped up. using System;
using System.Collections.Generic;
using System.Linq;
using Server.Commands;
using Server.Items...
Many ways you can do this. One simple way is you can use a switch statement on a random number range to return the type you want.public static BaseClassSepcialItem GetItem(int random)
{
switch (random)
{
case 0:
return new ItemA();
case 1:
return new ItemB();
}
return null;
}
[XmlSpawnerUnLoad <SpawnFile or directory> [SpawnerPrefixFilter] -
Alias: XmlUnload
UnLoads the XmlSpawners that are defined in the file supplied from the world.
I haven't tested that client from UOArchive but it's been tagged for quite awhile and mentioned by others that it's a custom client. It has a custom map and custom art so it might not be what you are looking for.
Welcome to ServUO :). If you are just trying to merge your changes and scripts into a fresh ServUO then you aren't looking at much time at all. On the other hand if you are trying to keep your RunUO saves to work with ServUO then you probably have a ton of work ahead of you merging the...