Full Version : Perma Drunk NPC with pet
xmlspawner >>Q&A >>Perma Drunk NPC with pet


<< Prev | Next >>

Abracadabra- 07-06-2006
Ok, assuming we've figured out how to make Charity drunk all the time, the next thing I need to do is give her a pet. My RP character always had a rat following her around. (He was after her cider) Is there a function in xml spawner that will allow this NPC Charity to spawn with a pet that belongs to her and that follows her around? If not, some suggestions on how I could code this into her script would be fantastic!

ArteGordon- 07-06-2006
QUOTE (Abracadabra @ July 06, 2006 08:31 pm)
Ok, assuming we've figured out how to make Charity drunk all the time, the next thing I need to do is give her a pet. My RP character always had a rat following her around. (He was after her cider) Is there a function in xml spawner that will allow this NPC Charity to spawn with a pet that belongs to her and that follows her around? If not, some suggestions on how I could code this into her script would be fantastic!

yep, make a spawner with spawn entries like this

subgroup 1: yournpc
subgroup 2: rat/controlled/true/controlmaster/GETONSPAWN,1,serial
subgroup 3: SETONTHIS/running/false

and put the first entry into subgroup 1, the second into subgroup 2, and then turn on sequential spawning so that they spawn in order. That way, the npc will spawn first, and then the rat which will set the controlmaster to the npc (thats what the GETONSPAWN does, it get the Serial property from the spawn on subgroup 1 which will be yournpc).

The last entry turns the spawner off. You need to do this because as soon as you "tame" the rat, the spawner loses control of it and so if you left it running, it would continue to spawn pet rats.

Here is a spawn definition that will do the above

QUOTE

<Spawns>
  <Points>
    <Name>DrunkSpawner</Name>
    <UniqueId>e98bc67e-ecf6-4498-a867-b69e1a8d0558</UniqueId>
    <Map>Felucca</Map>
    <X>5443</X>
    <Y>1154</Y>
    <Width>10</Width>
    <Height>10</Height>
    <CentreX>5448</CentreX>
    <CentreY>1159</CentreY>
    <CentreZ>0</CentreZ>
    <Range>5</Range>
    <MaxCount>2</MaxCount>
    <MinDelay>0</MinDelay>
    <MaxDelay>0</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>0</TODMode>
    <KillReset>1</KillReset>
    <ExternalTriggering>False</ExternalTriggering>
    <SequentialSpawning>1</SequentialSpawning>
    <AllowGhostTriggering>False</AllowGhostTriggering>
    <AllowNPCTriggering>False</AllowNPCTriggering>
    <SpawnOnTrigger>False</SpawnOnTrigger>
    <SmartSpawning>False</SmartSpawning>
    <Team>0</Team>
    <Amount>1</Amount>
    <IsGroup>False</IsGroup>
    <IsRunning>False</IsRunning>
    <IsHomeRangeRelative>True</IsHomeRangeRelative>
    <Objects2>banker/makedrunk/60:MX=1:SB=1:RT=0:TO=0:KL=0:RK=0:CA=0:DN=-1:DX=-1:SP=1:PR=-1:OBJ=rat/controlmaster/GETONSPAWN,1,serial/controlled/true:MX=1:SB=2:RT=0:TO=0:KL=0:RK=0:CA=0:DN=-1:DX=-1:SP=1:PR=-1:OBJ=SETONTHIS/running/false:MX=1:SB=3:RT=0:TO=0:KL=0:RK=0:CA=0:DN=-1:DX=-1:SP=1:PR=-1</Objects2>
  </Points>
</Spawns>


Just cut and paste that into an xml file, put the file into your RunUO directory, or into the Spawns folder in your RunUO directory, and do an

[xmlloadhere filename

Note that it assumes that you added the MakeDrunk property to basecreature.cs otherwise you will have to substitute your npc for the banker

Abracadabra- 07-06-2006
I'm getting an error when I try those lines in the xml spawner

controlled : property not found

I've tried 1 spawner with all the lines and 2 seperate spawners with charity in one, and the rat in another...both times this error occurs.

ArteGordon- 07-07-2006
QUOTE (Abracadabra @ July 06, 2006 11:21 pm)
I'm getting an error when I try those lines in the xml spawner

controlled : property not found

I've tried 1 spawner with all the lines and 2 seperate spawners with charity in one, and the rat in another...both times this error occurs.

The property was changed from 'Controled' to the correctly spelled 'Controlled' in RunUO 2.0. If you are using RunUO 1.0, just change it back to 'Controled'