Full Version : XmlSpawner2 v3.17 [RunUO 2.0] released
xmlspawner >>XMLSpawner - Releases & Updates >>XmlSpawner2 v3.17 [RunUO 2.0] released


<< Prev | Next >>

ArteGordon- 11-29-2006
New to version 3.17
updated 11/29/06
Bug Fixes
- fixed a bug in which assigning an extremely large expiration time to questholders could cause a crash (thanks to koluch for pointing this out). Expiration times are now capped at 100 years. This is a particular issue for playermade quests, since it is possible for players to enter such extreme expiration times.

Modified Features
- modified smartspawning so that mobs that are below maximum hits, stamina, or mana will not be despawned (thanks to Kamuflaro for the suggestion). The previous test only looked at hits.

- the LOOT,methodname keyword will now work with Loot methods that have multiple overloads of the sort added in RunUO 2.0. It will still refer to the zero-arg method in those cases. (thanks to Cheetah2003 for the suggestion).

- extended existing support for accessing Array type properties to all other IList types, including Arrays, ArrayLists, and Lists. For example, to get the name of the first attacker on a mobiles aggressors list you could use

[xmlget aggressors[0].attacker.name

where aggressors is a List type property on mobiles, and attacker.name is a property on one of the elements in the list.
The same syntax can be used to refer to such properties in spawner entries and property tests.

- the XmlLifeDrain attachment now gives a message and adds effects just like the default succubus life drain attack.

New Features
- enabled attachment support for "using" objects that allows you to add custom double-click functionality to any object, even statics and mobiles.
If you dont want to use this feature you can disable it by going into PacketHandlerOverrides.cs and commenting out the line in red as shown below

QUOTE

            // this replaces the default packet handler for Use requests.  Items and Mobiles will still
            // behave exactly the same way, it simply adds a hook in to call the OnUse method for attachments
            // they might have.
            //Timer.DelayCall( TimeSpan.Zero, new TimerCallback( UseReqOverride ) );


With this feature enabled the following overridable methods are available to all attachments
CODE

 public virtual void OnUse(Mobile from)
 {
 }

which will be called whenever the object that the attachment is attached to is used (e.g. double clicked). The 'from' argument is the person doing the using.
CODE

 public virtual void OnUser(object target)
 {
 }

When you add an attachment to a player, this method will be called whenever the player "uses" things. The 'target' argument is the thing being used.

Note that the attachment system OnUse and OnUser methods dont replace the default RunUO OnUse method, they are called in addition to any OnUse support that a target object might have, so if an object has support for OnUse in its script, it will still be called.
If you want attachments to ignore the default RunUO OnUse call, you can override the following method in your attachments and have it return true:
CODE

       public virtual bool BlockDefaultOnUse(Mobile from, object target)
       {
           return false;
       }


- added the new XmlUse attachment that allows you to control the use of any object. By adding this attachment to any object you can specify the conditions required to use the object as well as add new use functions to the object that will be executed on double clicks.

Properties:
Condition
A test string that is the same as any xmlspawner condition test. It will be tested whenever the object with the attachment is used (double clicked). If it returns true, then the object can be used. This can be used to control the built-in use functions of an object or the custom use functions that you add on the fly.

MaxUses
An integer value that restricts the maximum number of uses allowed. (default = unlimited)

Refractory
An integer that restricts the minimum time in seconds between uses. (default = 0)

MaxRange
An integer that restricts the maximum distance in tiles allowed from the target object (default = 3)

RequireLOS
A bool that determines whether line-of-sight between the user and the object is required (default = false)

SuccessAction
Assign this string to specify custom actions (in addition to the default OnUse functionality) that will be taken when the conditions for use of the object are met. The action string can be any spawnable entry string and supports multiple actions separated by semicolons.

FailureAction
This action will be executed when the conditions for use of the object are NOT met.

MaxUsesAction
This action will be executed when someone tries to use the object after the max uses has been exceeded.

RefractoryAction
This action will be executed when someone tries to use the object before the refractory period is over.

BlockDefaultUse
Setting this property to true will allow you to completely disable the default scripted RunUO method called when the object is used. This can be used to replace existing default use functions with your custom use actions.

Constructors:

public XmlUse()

public XmlUse(int maxuses)

public XmlUse(int maxuses, double refractory)

Examples:

For example, to make any object usable only once, just issue this command and target the object

[addatt xmluse 1

Note that you can always just remove the attachment and the object will go back to its default behavior. The attachment makes no changes to the object.

To spawn a metal box that can only be opened 3 times with a minimum delay of 10 seconds between openings and delivers a message if someone tries to use it more than the maximum number of times use a spawn entry like

metalbox/ATTACH/<xmluse,3,10/maxusesaction/@SENDMSG/Max uses exceeded.>

To spawn a stone static that pops open a gump when double clicked

static,3796/ATTACH/<xmluse/successaction/@GUMP,Wicked woods,0/Enter here and despair!>

you could also add this manually to any existing static by simply adding the attachment with

[addatt xmluse

and then opening up the props on the attachment with

[getatt

and assigning the SuccessAction property the value of "GUMP,Wicked woods,0/Enter here and despair!"

user posted image

To spawn a door that can only be opened by players named "Bob"

metaldoor,1/ATTACH/<xmluse/condition/@GETONTRIGMOB,name="Bob">

or by players that havent yet completed an objective of a quest

metaldoor,1/ATTACH/<xmluse/condition/@GETONCARRIED,Bunglers quest,questholder,completed1=false>

To prevent a player from using any metal doors for 2 minutes, create a triggered spawner that will add an xmluse attachment to the player lasting 2 minutes with the following entry

SETONTRIGMOB/ATTACH/<xmluse/expiration/00:02/condition/@GETONTHIS,TYPE!#MetalDoor>

Note that GETONTRIGMOB will always refer to the player doing the using, and GETONTHIS will always refer to the object being used.

- added examples of the new XmlUse attachment in customuse.xml to xmlextras. Just do an "[xmlloadhere customuse.xml" and respawn it.
Examples:
1. Creates a metalbox that can only be opened by someone with positive karma, and after opening it sends a message, opens a gump, and changes the players karma to evil. If someone with negative karma tries to open it, they are refused and a gump pops up.

2. Creates a door that can only be opened by someone with enough strength (>70). If a player is too weak, they will be blocked and a gump will be displayed.

3. Spawns a horse that can only be mounted by someone with high enough chivalry (>90). If a player lacking the skill attempts to use it, they will be blocked and a message will be displayed.

4. Creates a brazier that will spawn a daemon when double clicked if the player has enough fame (>1000).

5. Spawns a stone that will deliver a bag of regs when double-clicked with a waiting time between uses of 10 seconds.

6. Creates a magic portal that teleports the user to a site in Ilshenar when double clicked.

Note that examples 4,5, and 6 are done using simple statics that have no default use scripted.