Full Version : Spanwer question
xmlspawner >>Q&A >>Spanwer question
<< Prev | Next >>
Anvil- 02-04-2006
I'm posting here because I don't want to get flamed over at RunUO, however, there was a question that came up or rather a request that came up to have vendors (non player vendors) equip a lantern turned on when the time of day went to night and the light level went down. I was wondering if this was feasable with XML Spawner and if so how would it be done? Or is this something that would need to be scripted custom? Thanks.
Anvil
ArteGordon- 02-04-2006
Yes, this can be done.
Here is a single spawner version.

QUOTE
<Spawns> <Points> <Name>AutoLantern</Name> <UniqueId>9f8dfb55-f981-4180-ad39-2ba235437960</UniqueId> <Map>Felucca</Map>
<X>5434</X>
<Y>1178</Y>
<Width>10</Width>
<Height>10</Height>
<CentreX>5439</CentreX>
<CentreY>1183</CentreY>
<CentreZ>0</CentreZ>
<Range>5</Range>
<MaxCount>6</MaxCount>
<MinDelay>5</MinDelay>
<MaxDelay>10</MaxDelay>
<DelayInSec>False</DelayInSec>
<Duration>0</Duration>
<DespawnTime>0</DespawnTime>
<ProximityRange>-1</ProximityRange>
<ProximityTriggerSound>500</ProximityTriggerSound>
<TriggerProbability>1</TriggerProbability>
<InContainer>False</InContainer>
<MinRefractory>0</MinRefractory>
<MaxRefractory>0</MaxRefractory>
<TODStart>0</TODStart>
<TODEnd>0</TODEnd>
<TODMode>1</TODMode>
<KillReset>1</KillReset>
<ExternalTriggering>False</ExternalTriggering>
<SequentialSpawning>1</SequentialSpawning>
<AllowGhostTriggering>False</AllowGhostTriggering>
<SpawnOnTrigger>False</SpawnOnTrigger>
<SmartSpawning>False</SmartSpawning>
<Team>0</Team>
<Amount>1</Amount>
<IsGroup>False</IsGroup>
<IsRunning>True</IsRunning>
<IsHomeRangeRelative>True</IsHomeRangeRelative>
<Objects2>jeweler:MX=1:SB=1:RT=0:TO=0:KL=0:RK=0:CA=0:DN=-1:DX=-1:SP=1:PR=-1:OBJ=IF/TOD&gt;8:00:00 &amp; TOD&lt;16:00:00/44:MX=1:SB=1:RT=0:TO=0:KL=0:RK=0:CA=0:DN=-1:DX=-1:SP=1:PR=-1:OBJ=IF/TOD&gt;16:00:00 | TOD&lt;7:00:00/33:MX=1:SB=1:RT=0:TO=0:KL=0:RK=0:CA=0:DN=-1:DX=-1:SP=1:PR=-1:OBJ=GOTO/1:MX=1:SB=1:RT=0:TO=0:KL=0:RK=0:CA=0:DN=-1:DX=-1:SP=1:PR=-1:OBJ=SETONSPAWN,1/EQUIP/lantern:MX=1:SB=33:RT=0:TO=0:KL=0:RK=0:CA=0:DN=-1:DX=-1:SP=1:PR=-1:OBJ=SETONSPAWN,1/UNEQUIP,TwoHanded,delete:MX=1:SB=44:RT=0:TO=0:KL=0:RK=0:CA=0:DN=-1:DX=-1:SP=1:PR=-1</Objects2>
</Points>
</Spawns>

This will spawn a vendor and then between the hours of 8am and 4pm, it will unequip any lantern it has. And then between the hours of 4pm and 7am it will equip a lantern.
Anvil- 02-04-2006
Ok, since I'm really new to XML Spawner, even though I've been using it for awhile, haven't been fully utilizing all it's features... so what would I do with this segment of code? Second, how do you determine which type of vendor it is, and 3rd, is there anyway to apply this to all current vendors or would I have to manually replace each vendor in the world to comply with the code? Thanks!
Anvil
ArteGordon- 02-04-2006
that would be an XML spawn file. Just cut and paste the text into a file, and load it using the
[xmlloadhere filename
command.
When you open the spawner gump, you will see where the vendor is defined. You could add multiple vendors there as well, and it will equip/deequip them all.
And yes, you would need to replace all of your normal vendor spawners with something like this.
If you really wanted all of your vendors in the world to equip/deequip lanterns, it would probably be easier to just mod the vendor scripts.
Anvil- 02-04-2006
That's what I want to do. I'm building a new world right now and I'd rather just put a mod in the vendor scripts so all my vendors take this action which is what I'm really looking for... Any chance you could code this up for me if it's not too much trouble? While I'm OK with making small mods here and there I'm not good at making big mods myself... *sigh*... Would appreciate it!
Anvil- 02-09-2006
I'm actually going to make a go with this, but I was wondering, would this be something I'd put in basevendor.cs or would I have to modify every NPC vendor script?
ArteGordon- 02-09-2006
you could put it in basevendor if you wanted them all to do this.
Anvil- 02-10-2006
Thanks... I've gotten them to hold lanterns in their hands through additem, however, in trying to add the variable for the lantern to be lit it then won't equip the lantern. I'm still playing with it a bit before I get into the timer to make them equip/unequip them, that'll be even more fun... since I don't know jack about coding *laugh*... but I'm trying... and I"m sure I'll learn something.