QUOTE |
PremiumSpawner's if you create a spawner with 3 typenames and you set each value to say 3, so a total of nine. then if you hit respawn several times it will respawn with different amounts each time (randomly) [assuming that the total amount to make has been set to 9] bird 3 cat 3 dog 3 then after a respawn it randomly would change to like so: bird 0 cat 5 dog 4 then again bird 1 cat 3 dog 6 |
QUOTE |
If you wanted an xmlspawner to behave in that way, what you would do would be to assign each individual entry a maxcount that was the same as the spawner maxcount. |
CODE |
XmlSpawner xml = new XmlSpawner(); for (int g = 0; g < creatureNames.Count; g++) { string name = (String)creatureNames[g]; XmlSpawner sp = xml; sp.AddSpawn = name; sp.MaxCount = npcMaxCount; xml = sp; } xml.Team = team; if (xml.MaxCount < npcMaxCount) xml.MaxCount = npcMaxCount; if (xml.StackAmount < xml.MaxCount) xml.StackAmount = xml.MaxCount; if (homerange > xml.HomeRange) xml.HomeRange = homerange; if (spawnrange > xml.SpawnRange) xml.SpawnRange = spawnrange; xml.MoveToWorld(loc, map); if (xml.Parent == null) xml.Respawn(); |
CODE |
XmlSpawner.SpawnObject[] so = new XmlSpawner.SpawnObject[creatureNames.Count]; for (int i = 0; i < creatureNames.Count; i++) { so[i] = new XmlSpawner.SpawnObject(creatureNames[i], npcMaxCount); } Guid SpawnId = Guid.NewGuid(); string spawnername = String.Format("Spawner{0}", DateTime.Now); XmlSpawner.TODModeType defTODMode = XmlSpawner.TODModeType.Realtime; int x = 0; int y = 0; int z = 0; XmlSpawner spawner = new XmlSpawner(SpawnId, x, y, 0, 0, spawnername, npcMaxCount, TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(10), TimeSpan.FromMinutes(0), -1, 0x1F4, 1, 0, homerange, false, so, TimeSpan.FromMinutes(0), TimeSpan.FromMinutes(0), TimeSpan.FromMinutes(0), TimeSpan.FromMinutes(0), null, null, null, null, null, null, null, null, null, 1, null, false, defTODMode, 1, false, -1, null, false, false, false, null, TimeSpan.FromHours(0), null, false, null); spawner.Team = team; if (spawner.MaxCount < npcMaxCount) spawner.MaxCount = npcMaxCount; if (homerange > spawner.HomeRange) spawner.HomeRange = homerange; if (spawnrange > spawner.SpawnRange) spawner.SpawnRange = spawnrange; spawner.MoveToWorld(loc, map); spawner.Respawn(); |
QUOTE |
RunUO - [www.runuo.com] Version 2.0, Build 2357.32527 Core: Running on .NET Framework Version 2.0.50727 Scripts: Compiling C# scripts...failed (1 errors, 4 warnings) Errors: + Custom/DeveloperScripts/PremiumSpawnerConverter.cs: CS1502: Line 168: The best overloaded method match for 'Server.Mobiles.XmlSpawner.SpawnObject.SpawnObject(string, int)' has some invalid arguments CS1503: Line 168: Argument '1': cannot convert from 'object' to 'string' |
CODE |
so[i] = new XmlSpawner.SpawnObject(creatureNames[i], npcMaxCount); |
CODE |
foreach (Item premiumSpawner in itemsToRemove) { PremiumSpawner sp = (PremiumSpawner)premiumSpawner; CreateSpawner(from, sp.CreaturesName, sp.Location, sp.Map, sp.HomeRange, sp.SpawnRange, sp.Count, sp.Team); premiumSpawner.Delete(); } |
CODE |
for (int i = 0; i < creatureNames.Count; i++) { so[i] = new XmlSpawner.SpawnObject(creatureNames[i], npcMaxCount); } |
CODE |
for (int i = 0; i < creatureNames.Count; i++) { string name = (String)creatureNames[i]; so[i] = new XmlSpawner.SpawnObject(name, npcMaxCount); } |