Full Version : Trigger spawns on carried or equipped items
xmlspawner >>XMLSpawner - How do I? >>Trigger spawns on carried or equipped items
<< Prev | Next >>
ArteGordon- 12-27-2005
Triggering when a player is carrying an item:
To cause a spawner to trigger when a player is carrying a particular item,
1) turn on proximity triggering by setting the ProximityRange property to a value > 0
2) set the SpawnOnTrigger property to true for immediate spawning on triggering, or set the Min/MaxDelay properties to the delay between triggering and spawning.
3) set the TriggerOnCarried property to the name of the item that needs to be carried.
This will result in a spawner that will only spawn when a player carrying the specified item comes within range of the spawner.
The general syntax for a TriggerOnCarried or NoTriggerOnCarried string is
name[,type][,EQUIPPED][,objective,objective,...]
Preventing triggering when a player is carrying an item:
To prevent a spawner from triggering when a player is carrying a particular item, just set the NoTriggerOnCarried property instead of the TriggerOnCarried property.
Triggering or blocking triggering when players have completed quest objectives:
The special 'objective' arguments to TriggerOnCarried or NoTriggerOnCarried will be used when the item being tested is a questholder object. By giving objective numbers, the test will only succeed if the named questholder is found and the specified objectives have been completed.
For example if you wish to trigger a spawner only when quest item "Blathers Quest" is carried and has objective 1 completed, then use the string
Blathers Quest,1
in the TriggerOnCarried property. If you would like to prevent triggering when objective 1 of that quest has already been completed then use the same string in the NoTriggerOnCarried property.
Triggering when players have equipped items:
if the EQUIPPED argument is added then the item must be equipped for the test to succeed.
So to test for the longsword named "Balron's Bane" that is not only carried, but also equipped you would use a string like
Balron's Bane,longsword,EQUIPPED
When used in the NoTriggerOnCarried, triggering would be prevented if the item was equipped.
Note, if the EQUIPPED option is not specified, then the item will be detected whether it is equipped or carried.
Triggering on multiple items:
You can also test for multiple carried or equipped items in TriggerOnCarried/NoTriggerOnCarried tests using the & and | operators.
For example to trigger the spawner when a player is carrying both the platehelm named 'Helm of Light' and the longsword named 'Sword of Light' you could use the following string in the TriggerOnCarried property,
Helm of Light,platehelm & Sword of Light,longsword
Triggering when a player has an attachment:
spawner triggering can be made dependent upon attachments on the triggering mob by using the
ATTACHMENT,name,type
string in the TriggerOnCarried or NoTriggerOnCarried properties. This will make triggering dependent on attachments on the player, or an attachment on an item equipped by the player, or an attachment on an item in the top level of the players backpack (see attachtest1.xml for an example).
Vladimir- 08-08-2006
Why does my questnpc reject this?
<TriggerOnCarried>a Magic Skull,goldenskull & Odd Key,key</TriggerOnCarried>
Its fine with just the first condition a Magic Skull,goldenskull, but as soon as i put in the & it won't load the config file
*edit*
Was because i was editing it from the .npc file... looks a bit different:
<TriggerOnCarried>Odd Key,key &amp; a Magic Skull,goldenskull &amp; Key For Sacrificial Room,key</TriggerOnCarried>
Sorry about that
ArteGordon- 08-08-2006
yep. Probably the same issue you had with the quotes earlier.
If you are directly editing the xml .npc or .xml files, then things like & and " are special chars and you have to use the escape sequences &amp; &quote;
Vladimir- 08-08-2006
Yea realise that now... I should try get used to that tho because its actually quite usefull being able to edit it from the .npc file and just copy that over to the server
Vladimir- 08-09-2006
How would i specify the number of a particular item in the Triggeroncarried prop?
for example I want to check for 4 recall runes named Teleporter Rune.
I tried adding Teleporter Rune,4 but that didn't seem to work.
ArteGordon- 08-09-2006

QUOTE (Vladimir @ August 09, 2006 01:34 pm)
How would i specify the number of a particular item in the Triggeroncarried prop? for example I want to check for 4 recall runes named Teleporter Rune. I tried adding Teleporter Rune,4 but that didn't seem to work.

unfortunately, there is no support for specifying quantites in the TriggerOnCarried strings.
The closest you can get to that would be using the AMOUNTCARRIED keyword as a triggering property test (like PlayerTriggerProp) which supports a type but not a name argument. I'll look into adding name support to the next update.
from xmlspawner2.txt

QUOTE
- added the new "AMOUNTCARRIED,itemtype" keyword that will return the total amount of the specified type of item being carried in the backpack of the triggering mob. You can use this to test for carried items like IF/AMOUNTCARRIED,gold < 100/33
or add it to a Condition field in xmldialogs or in a triggering condition test on spawners
AMOUNTCARRIED,bandage>100

Callandor2k- 12-23-2006
How do you make a spawner spawn when a certain object that is being carried in a players pack and then delete that item from the players pack after it spawns the creature. I have gotten it to work but for some reason more often than not it will delete the object first before spawning the creature and not spawn the creature.
This is how I have it set on the XMLSpawner2 Gump....
Box 1..... MasteroftheArts
Box 2..... SETONCARRIED,Master of the Arts Summoning Jewel/DELETE
The TriggerOnCarried box has Master of the Arts Summoning Jewel placed in it.
Am i forgetting to do something or can it be done the way I want it to be done?
ArteGordon- 12-23-2006
you want them to spawn together as a group, so place them both into the same subgroup by assigning them the same subgroup number.
Callandor2k- 12-23-2006
Thank you, that worked as I wanted it to. Gotta love these XML Spawners they are awsome.
koluch- 12-30-2006
I am having issues getting an item a player is carrying to trigger a spawner to spawn.
The items is a CryptScroll : Item
Name = "The Keeper Of Montor Scroll"
The creature to spawn is Tezana, he is on the spawner.
I have set the Proximity range at 1 and also tried up to 5.
SpawnOnTrigger = true
TriggerOn Carried = The Keeper Of Montor Scroll,item
I also tried ATTACHMENT,The Keeper Of Montor Scroll,item
The Keeper Of Montor Scroll,CryptScroll
and several others, at this point I have lost track
What perhaps am I missing, thanks :/
koluch
ArteGordon- 12-30-2006
I would confirm the name of the item using "[get name" on it, and then check the exact spelling taking particular note of capitalizations.

QUOTE
The creature to spawn is Tezana, he is on the spawner. I have set the Proximity range at 1 and also tried up to 5. SpawnOnTrigger = true TriggerOn Carried = The Keeper Of Montor Scroll,item

that should all be correct. Make sure their accesslevel is player in order to trigger.
If you still have a problem, you can post the spawner xml and I will take a look.
koluch- 12-30-2006
Arti, thanks a ton.
The Of was actually of....sheeeesh.....
Works like a gem!
(as always)
Koluch
Grimm92- 04-02-2007
Mister Gordon forgive my ignorance but I just can seem to figure out the correct way to get an object to spawn on three different carried items. It works great when I add one item. Here is what I put in Trigger On Carried:
Grand Mage Key,item & High Executioner Key,item & Master Thief Key,item
Its supposed to spawn a teleporter to a dungeon normally in accessible. Then once they are in the dungeon a monster is supposed to spawn and delete all three items so that they cant camp there and wait for the monster to respawn. Ive figured out how to get one to delete but not how to get it to delete all three AND spawn a monster at the same time. It either deletes OR spawns the monster.
P.S. I am doing this on the spawner in game is that maybe what Im doing wrong?
ArteGordon- 04-03-2007
you have a spawner entry to spawn the monster, and a spawner entry to delete the keys. What you want is for both of those entries to be spawned together as a group.
To do that, assign them both to the same subgroup.
If you dont assign them to a subgroup then they are each in the default subgroup of zero, and when the spawner is triggered it just randomly picks one of the spawns. That is the default spawning behavior.
Grimm92- 04-03-2007
Im not sure what you mean by "sub group" How would I assign a subgroup please? I thought maybe it meant to place both commands for spawning and deleting the items in the same line on the spawner. But I keep being told in red on the bottom that my command is wrong or not found.
Also, did I phrase correctly for the spawner to recognize all thre items by using

CODE
Grand Mage Key,item & High Executioner Key,item & Master Thief Key,item

?