Full Version : How Do I - Set properties on spawns
xmlspawner >>XMLSpawner - How do I? >>How Do I - Set properties on spawns
<< Prev | Next >>
ArteGordon- 03-02-2006
the general rule of thumb in setting properties like that is to first do a [get of the property, and then look at the format of the value returned and then format it in the same way when you try to set it.
Point3D properties like locations have the format
(x, y, z)
So in your case you would set it like
recallrune/target/(5200, 1090, 1)/targetmap/trammel/marked/true/description/A fun spot
Zigamus- 03-02-2006
Thanx Bro
Works perfectly now! Woot!
If anyone is interested in this project I be happy to post it
Discord- 06-24-2006
Is there a way set the spawn to give a special type of resource - to be gathered from that custom spawned creature so that the "special" resource can be used for a quest objective?
Here is what I am trying to do:
I have a spawner of a black sheep in a meadow, I would like to have a quester gather wool from this sheep and return X# of this special wool to the quest giving NPC for a reward.
The trouble I am running into at this point is how to differentiate this black sheep's wool from the regular wool that can be gathered off the other sheep in the area. I would like them to ONLY be able to use this special wool in the collection process for the quest. It should not accept "stock wool".
Being that it is not a loot item I am using, how would I set the spawned sheep up to give this special wool when using the skinning knife on him to shear him? Is this even possible to do without scripting a special sheep?
Thanks.
Dis~
ArteGordon- 06-24-2006
to specify "special" items as collection objectives, you can use the additional optional property test argument to the COLLECT objective
COLLECT,type,[count][,proptest].
For example,
COLLECT,wool,10,hue=250
which would only collect wool of a certain color as the objective.

CODE
- added support for an additional property test argument to the quest keywords like COLLECT,type,[count][,proptest]. The property test can also be used with the other quest keywords like KILL, GIVE, and ESCORT (thanks to BlackNova for the idea)
- added support for conditional testing of enum type property values by using the # modifier (e.g. resource=#Iron or planthue=#Blue or loyalty!#WonderfullyHappy, where resource, planthue, and loyalty are all enum type properties and Iron, Blue, and WonderfullyHappy are values that they can take on).
At the present, the enum tests are restricted to equals and not equals (= and !). I'll add < and > later.

what gets generated when you shear the sheep is something that has to be scripted. Take a look at the sheep.cs script and the Carve method.
Note, you could easily make a generic mod to sheep.cs that would allow you to use an attachment to specify the wool color and so you wouldnt have to script special sheep for special wool.
Just make this change to the Carve method
around line 30, change this

CODE
from.SendLocalizedMessage( 500452 ); // You place the gathered wool into your backpack. from.AddToBackpack( new Wool( Map == Map.Felucca ? 2 : 1 ) );

to this

CODE
from.SendLocalizedMessage(500452); // You place the gathered wool into your backpack. //ARTEGORDONMOD // allow wool color to be specified using an xmlvalue attachment Item wool = new Wool(Map == Map.Felucca ? 2 : 1); XmlValue a = (XmlValue)XmlAttach.FindAttachment(this, typeof(XmlValue), "WoolColor");
if (a != null)
{
wool.Hue = a.Value;
}
from.AddToBackpack(wool);

and add this to the beginning of the file

CODE
using Server.Engines.XmlSpawner2;

and then when you spawn the sheep, just give it the xmlvalue attachment with the wool color you want, like
sheep/ATTACH/xmlvalue,WoolColor,250
or if you wanted to just set the hue of the sheep on spawning, and then have the wool be the same color, just do this

CODE
from.SendLocalizedMessage(500452); // You place the gathered wool into your backpack. //ARTEGORDONMOD // make wool color the same as the sheep Item wool = new Wool(Map == Map.Felucca ? 2 : 1); wool.Hue = Hue;
from.AddToBackpack(wool);

and then spawn the sheep like
sheep/hue/250