Full Version : Question about Rare items
xmlspawner >>Q&A >>Question about Rare items


<< Prev | Next >>

crabby654- 09-01-2006
Ok suppose i want "Fruit Bowl" to spawn only on server up, how would i set the respawn timer for it? and if no one picked it up on day 1 would it respawn on day 2 and there would be 2 of them?

And is there a way to weekly or monthly rare items as well? Again i would have no idea how to set it to respawn in a week or a month if this is possible

ArteGordon- 09-02-2006
yes, you can specify day, month, week spawn times. You just have to set the min/maxdelay setting for the spawner. The props gump will let you specify it in hours, so daily spawns would be 24 hours, weekly would be 168 hours, etc.

You could also restrict spawning to a certain day of the week, or month by adding conditions that tested the value of various timekeeping properties

QUOTE

- added several timekeeping properties to XmlDialog entries that allows you to control their activation based upon time of the day, day of the week, day of the month, or phase of the moon. These properties are:
GameTOD - has values of the form hh:mm:ss, so 14:00:00 would be 2pm
RealTOD - has values of the form hh:mm:ss
RealDayOfWeek - has values Sunday, Monday, etc.  Note, these are enums so when referring to them in property tests precede them with a #, like "RealDayOfWeek=#Monday"
RealDay - has values 1-31
RealMonth - has values 1-12
MoonPhase - has values NewMoon, WaxingCrescentMoon, FirstQuarter, WaxingGibbous, FullMoon, WaningGibbous, LastQuarter, WaningCrescent

There are a number of ways that you might use these new properties.
By setting the Home property on an npc which will cause it to wander to that location. By setting Home at different times, you can have your npcs go to different places throughout the day.

You could also have certain conversations that could only be carried out at certain times of the day, or days of the week.
For example, setting the Condition field in an xmldialog entry to

GameTOD>12:00:00 & GameTOD<16:00:00

would restrict its activation to between the times of 12 and 4pm

- added an example of the use of these new properties in a .npc file timeofday.npc, and a spawner example that loads it up onto an npc in timeofday.xml.  To test it out, just do an "[xmlloadhere timeofday.xml".  The npc will respond with the day of the week in his banter, and if you respond with the keyphrase "hello", you will get different responses depending on the time of day (game time), and even the day of the week (he doesnt work on Sunday).


the same properties are available on the spawner.

For example, to have a spawn that only appeared in December on the 24th day

#CONDITION,RealMonth=12 & RealDay=24; santaclaus

To have something spawn immediately on a server restart, you will need to make use of a new attachment that I just added called XmlOnStartup.
This is in the Files section and will allow you to perform an action whenever the server is restarted.

Just add the attachment to the spawner like this

[addatt xmlonstartup spawnit "SETONTHIS/nextspawn/0"

and then target the spawner

That will cause the spawner to spawn as soon as the server starts up.

crabby654- 09-02-2006
by setting spawns to spawn in 24 hours or 168 or whatever, will this be affected by servers automatic restart every night?

ArteGordon- 09-02-2006
QUOTE (crabby654 @ September 02, 2006 11:28 am)
by setting spawns to spawn in 24 hours or 168 or whatever, will this be affected by servers automatic restart every night?

The time intervals can span restarts, so if you set it to spawn once a week, then it wont matter if you restart multiple times during that week.

But note that the intervals only count server uptime, so if you set it for one week and the server goes down for five days, then it wont count that downtime in the week interval and you will still wait a week after it comes back up for the spawn.

Hanse46- 03-21-2008
So to do this for MoonPhase, i would spawn a spawner, add my item and then:

1. [xmledit

and in conditions add Moonphase, NewMoon

is this correct?

ArteGordon- 03-22-2008
QUOTE (Hanse46 @ March 21, 2008 03:35 pm)
So to do this for MoonPhase, i would spawn a spawner, add my item and then:

1. [xmledit

and in conditions add Moonphase, NewMoon

is this correct?

no, [xmledit would allow you to add or edit a dialog attachment on an object.

What you would want to do is to simply make your spawner entry look like this

#CONDITION,MoonPhase =NewMoon; myitem

The #CONDITION is a special spawn control keyword that can used in spawner entries.
There are a number of these spawn control keywords and they are specific to spawner entries, so that is the only place you can use them.
The way it works is that when the spawner 'ticks' (based upon your min/maxdelay) and tries to spawn something it will check the moonphase before actually spawning that particular entry.

QUOTE

- #spawn control keywords: #NOTILES, #TILES, #WET, #DXY, #XY, #RELXY, #CONDITION, #PLAYER, #WAYPOINT, #XFILL, #YFILL, #EDGE


QUOTE

- added the "#CONDITION,proptest" spawn control keyword that allows individual entries to be made conditional on the specified property test.
When combined with the new FastestPlayerSpeed and MovingPlayerCount properties, you can make spawn entries that will depend on the speed and number of nearby players with entries like

#CONDITION,movingplayercount<2 ; orc

which would only spawn the orc if fewer than 2 players were moving nearby.

#CONDITION,fastestplayerspeed>5 ; #PLAYER,3 ; orc

Which would only spawn the orcs if some player was moving faster than 5 tiles per second and would additionally have the orcs placed within 3 tiles of the triggering player when they are spawned.

You can use the same kind of condition tests that can be used anywhere else, such as compound tests or tests for properties on carried items, or triggering players, etc.  For example,

#CONDITION,GETONTRIGMOB,skills.magery.value>100 ; lichlord

would only spawn the lichlord if the triggering player had magery greater than 100.

Hanse46- 03-22-2008
I am following all but where the code goes, does it go in the script or do I add like when I place a spawner. I am trying hard to understand the system and I am slowly getting better.

ArteGordon- 03-22-2008
it goes right where you would normally put a basic spawn entry like

orc

in the spawner gump, but instead you type in that longer string that includes the #CONDITION

Hanse46- 03-22-2008
Sorry to sound like such a idiot, my coding skills are rather limited and I am trying to understand this stuff. I have found it far easier to learn then I did C#. I can see the ability to make my shard different and rather special.

Thank you for taking the time in helpig me.

ArteGordon- 03-22-2008
glad to help.