Full Version : Complicated "or" XMLQuest
xmlspawner >>Q&A >>Complicated "or" XMLQuest


<< Prev | Next >>

Neira- 01-27-2008
Hello again, I have lousy question again.

How do I make "or" in this case? (I apologize, but the example principle is the best for me whether for explanation or understanding)

In Xml dialog I have Action part in this way: SETONTRIGMOB/ATTACH/xxx ; SETONTRIGMOB/SOUND,xxx ; GIVE<Mace/Name/xxx>
now i want to add anothar mace with different name, in way all Setonmobs are always valid, and it is random chosen between maces (so first mace, or second mace, only one of them). I know in Condition part its | but i cant find a way to get it to action part.
Is this possible? Or do i have to make separate entry.


Thanks for answer in advance.
Neira

ArteGordon- 01-27-2008
you will need separate entries. There is no support for OR operations in Actions.

Neira- 01-29-2008
Oh well, doesnt matter, thanx very much for answer anyway. Also here is another question (i prefer not to spam x new topics).


Is there some way to put action of mob to condition?

Lets say I need to get condition of mob casting certain spell, or using certain skill. Is it possible? If yes whats the "syntax" of such condition.

Thanks for answer in advance again smile.gif

ArteGordon- 01-30-2008
no, I'm afraid those are not possible.

There are hooks that can detect skill use but those have been intentionally limited to players.
There are no hooks that have been added to detect casting, although that is a good idea.

In general, anything that sets a property on a mob can be checked as part of a condition test.
Skills and casting dont really do that, so to access them explicit hooks, which are modifications of the default RunUO code, have to be added into to detect them.

Neira- 01-31-2008
Ok, thank you very much for your patience with my questions. smile.gif

See there is hook for player use of certain skill? How can i put one (or how would it look like)

ArteGordon- 01-31-2008
To enable skill triggering you need to perform installation step #5

QUOTE

STEP 5: (recommended but not required)
--------------------------------------
To take advantage of spawner triggering on skill use you must change 4 lines in Scripts/Misc/SkillCheck.cs (note, you dont have to make this mod if you dont want to, the spawner and other items will work just fine without it, the SkillTriggering features simply wont do anything). Near the beginning of the file at line 73 change these lines.

public static void Initialize()
{
Mobile.SkillCheckLocationHandler = new SkillCheckLocationHandler( Mobile_SkillCheckLocation );
Mobile.SkillCheckDirectLocationHandler = new SkillCheckDirectLocationHandler( Mobile_SkillCheckDirectLocation );

Mobile.SkillCheckTargetHandler = new SkillCheckTargetHandler( Mobile_SkillCheckTarget );
Mobile.SkillCheckDirectTargetHandler = new SkillCheckDirectTargetHandler( Mobile_SkillCheckDirectTarget );
}

to this

public static void Initialize()
{
// Begin mod to enable XmlSpawner skill triggering
Mobile.SkillCheckLocationHandler = new SkillCheckLocationHandler( XmlSpawnerSkillCheck.Mobile_SkillCheckLocation );
Mobile.SkillCheckDirectLocationHandler = new SkillCheckDirectLocationHandler( XmlSpawnerSkillCheck.Mobile_SkillCheckDirectLocation );

Mobile.SkillCheckTargetHandler = new SkillCheckTargetHandler( XmlSpawnerSkillCheck.Mobile_SkillCheckTarget );
Mobile.SkillCheckDirectTargetHandler = new SkillCheckDirectTargetHandler( XmlSpawnerSkillCheck.Mobile_SkillCheckDirectTarget );
// End mod to enable XmlSpawner skill triggering
}


Once you have done that you will have access to spawner skill triggering features.

from xmlspawner2.txt
QUOTE

- added spawner triggering on skill use.  By setting the SkillTrigger property to a string of the form "skillname[+/-][,minval,maxval]" the spawner can trigger when the named skill is used and optionally when the skill value falls within the specified range and is either successful (+) or unsuccessful (-).  If +/- is omitted then it will trigger on either success or failure - simply using the skill is enough.  For example, specifying a SkillTrigger string of "Hiding" would trigger the spawner whenever the hiding skill was used within the specified ProximityRange of the spawner, regardless of skill level or whether or not it was successful.  Using "Hiding,+" would trigger whenever the skill was successfully used. "Hiding,50,100" whenever the skill was used and the user had a skill level between 50 and 100 (inclusive).  "Hiding,-,50,100" whenever the skill failed and the user had a skill level between 50 and 100. Note, the skill names are case sensitive.  Several examples of skill triggering are given in xmlextras (skilltrigger1-4.xml).  Skilltrigger3.xml gives an example of how to spawn mobs or give special drops on mining based on skill level.  Skilltrigger4.xml demonstrates triggering on failed hiding. Skilltrigger1 and 2 trigger on musicianship. (Thanks to MarkC777 and Nix4 for the suggestion).

- added the property keyword "TRIGSKILL,name|value|base|cap" that returns information on the triggered skill for use in property testing and property value assignment.  See examples of this in the skilltrigger xml files.


QUOTE

- added new xml examples skilltrigger5.xml and equipper.xml demonstrating the new features.  Equipper.xml spawns a ratman, gives him a random male name, and equips him with a random level 5 magical weapon with a random female name, and a hitfireball 100% weaponattribute which you will notice if you fight him.
Skilltrigger5.xml shows how the TRIGSKILL keyword can be used with string substitution or to assign other properties based upon skill base, value, cap, or name.  It is triggered by using the Musicianship skill within the trigger range of the spawner and sends a message displaying skill information using string substitution, and spawns gold in an amount based on the skill value using property assignment.