Full Version : Spawning random item in subgroup 2?
xmlspawner >>Q&A >>Spawning random item in subgroup 2?
<< Prev | Next >>
Harack- 07-29-2007
Hey i am spawning a town rare in serps, cards and im trying to make it spawn 1 item from subgroup 2. I have managed to make this happen but it only spawns the same item everytime.
Heres how i set it up.
name = Cards
SETONPARENT/locked/true/visible/false/visible/true |subgroup 1
SETONPARENT/locklevel/45 |subgroup 1
Gold, 50 |subgroup 1
item, 3605 |subgroup 2
item, 3606 |subgroup 2
item, 3607 |subgroup 2
item, 3608 |subgroup 2
item, 3609 |subgroup 2
item, 4002 |subgroup 2
item, 4003 |subgroup 2
SPAWN,Cards, 2
it spawns item, 3605 everytime never any of the others.
I also would like to know how i can get random ammouts of gold to spawn within a range like say 700-1200gp.
Thanks,
Harack.
ArteGordon- 07-30-2007
Spawns within a subgroup will always be spawned in the order that they are listed in the gump. You can use that fact along with the SETVAR keyword to select a random value, and then use the #CONDITION keyword to select the remaining spawns based on that random value.
Check out this post for more details
http://xmlspawner.15.forumer.com/index.php?showtopic=1200
and for random amounts of gold, you can spawn it using the gold constructor that accepts an amount and use the RND keyword along with the string substitution brackets to put in a random value in some range
gold,{RND,700,1000}
or you can just use the gold constructor that already accepts 2 arguments as a range like this
gold,700,1000
Harack- 07-30-2007
Kool thanks, is there anyway to add multiple piles of gold instead of just repeating it?
Like i want to build a golden balron with about 45 piles of 700-1200gp do i just paste ADD/gold,700,1200 45 times? Or is there an easier way?
ArteGordon- 07-30-2007

QUOTE (Harack @ July 30, 2007 07:21 am)
Kool thanks, is there anyway to add multiple piles of gold instead of just repeating it? Like i want to build a golden balron with about 45 piles of 700-1200gp do i just paste ADD/gold,700,1200 45 times? Or is there an easier way?

yes, the easy way is to set the maxcount for that spawn entry to 45, and set the 'Per' field for the the entry (which is short for 'spawns per tick') to 45. That will cause it to spawn 45 of that entry all at once.
To set the 'Per' field, just open up the extended spawner gump (little right arrow button in lower right corner of the spawner gump).
So to spawn the balron and the extra loot, do it like
subgroup 1: balron
per=45: max=45: subgroup 1: SETONSPAWN,1/ADD/gold,700,1200
by putting both the balron and the entry that adds gold into the same subgroup, they will always spawn together. The SETONSPAWN,1 will refer to the spawn in subgroup 1 which is the balron. By setting the 'Per' and 'Max' for that entry to 45 it will spawn that entry 45 times at once.
Also make sure that your overall spawner maxcount is set high enough to allow all of those things to spawn (maxcount=46)
Harack- 08-06-2007
Thanks thats just what i needed!!
Ive been spawning the chests in town shops around my shard, and was wondering if i could have rare items spawn once a day but the chest loot itself spawn every 20-30 minutes.
This is my spawner.
SETONPARENT/locked/true/visible/false/visible/true (max 1)
SETONPARENT/locklevel/{RND,30,70}/traptype/{RNDLIST,None,MagicTrap,ExplosionTrap,DartTrap,PoisonTrap}/trappower/{RND,10,85} (max 1)
Gold, 25,100 (max 1)
LOOT,RandomGem (max 2 per 2)
LOOT,RandomWeapon (max 1)
static,{RNDLIST,3610,3611,4001,4002}/movable/true (max 1)
The static item is the rare, at this point of time i have them all in subgroup 1.
Thanks in advance,
Harack.
ArteGordon- 08-06-2007
you can set the min/maxdelay for individual spawn entries by assigning the MinD and MaxD values in the extended spawner gump. This allows you to have individual entries spawn at their own individual rates that are slower the main min/maxdelay of the spawner.
So to have your rares spawn once a day but your normal loot spawn every 20-30 mins, set the main spawner min/maxdelay to 20-30 mins, and then set the MinD and MaxD of the rare loot entry to values around 1440 mins.
from xlmspawner2.txt

QUOTE
- Individual spawn entry Min and Max delay times can be entered in the extended spawner gump columns labeled 'MinD' and 'MaxD'. Values are entered as minutes (so to specify 30 seconds you would enter 0.5). Note that entering individual min/max delay times that are less than the spawner min/maxdelay will NOT result in faster spawning. Spawns cannot occur faster than the main spawner min/maxdelay.
If no individual entries are specified, then the spawning time for that entry will be determined by the main spawner min/maxdelay.
When setting individual min/maxdelays for spawns with sequential spawning, make sure to check the KillReset property to make sure you are allowing enough OnTicks to actually achieve the desired target KillCount. KillCount will still be reset if the number of main spawner OnTicks specified in KillReset passes without making a kill, so for example, if you make the main spawner min/maxdelay 1 minute, and an individual spawn min/maxdelay 10 minutes, you should set KillReset to at least 10 (10 OnTicks would be 10 minutes), to allow spawning to occur (and thus give the players something to kill) before the killcount was reset.
- added a simple example of the use of min/maxdelay in a non-sequential spawner in thighmaster.xml

Harack- 08-06-2007
Thanks a lot its working perfectly. 8)
Harack.
ArteGordon- 08-07-2007
oh, and a minor thing. I noticed that you used
static,{RNDLIST,3610,3611,4001,4002}/movable/true (max 1)
to generate your rare. You can also do it like this.
item,{RNDLIST,3610,3611,4001,4002} (max 1)
since a static is basically just an item that has Movable set to false.
You may also want to consider using a LocalizedStatic if you would like to be able to specify the label that is used for it as well as the itemID.
localizedstatic,itemid,labelnumber