Full Version : Adding a trigmob's name to a spawned item?
xmlspawner >>Q&A >>Adding a trigmob's name to a spawned item?


<< Prev | Next >>

LowCastle- 02-10-2006
Hello everyone. I have done several searches without much success. So I'm here to ask the masters.
What I want to do is provide a Valentine's day quest for my players. I am a big fan of the old whispering roses that OSI had, but I don't know how to set up the giftgiver.cs file to give one per character rather than one per account.

The Valentine's Day gift package (by RoninGT, I think) that I downloaded on the RunUO forums renames the longstemrose via the script as the gifts are given, like this:

LongStemRose rose = new LongStemRose();
rose.Name = "a whispering rose from " + mob.Name;
box.DropItem( rose );


Is there any way to do this with a spawner, so I can make a short quest that will give them out?

I remembered seeing a post that explained how to have an NPC dialog include the player's name, but sadly I couldn't even find that post.

Galfaroth- 02-10-2006
Depends on:-1
Condition:~GETONTRIGMOB,[ATTACHMENT,xmlquestattachment,HasRose,name]="HasRose"
Action:GIVE/<LongStemRose/name/Rose from TRIGMOB>;SETONTRIGMOB/ATTACH/xmlquestattachment,HasRose
Gump:GUMP,Valentino,4/Hello. This is rose for you. Enjoy

The only thing you have to edit is LongStemRose to your Rose class name (I don't know it).

I'm not sure the red line will work. If not, tell me I will tell you how to do it in other way. And you'll need to post your LongStemRose.cs for this other way.

ArteGordon- 02-10-2006
the red line is close. You would use the string substitution brackets {} to insert the name like this

GIVE/<LongStemRose/name/Rose from {GETONTRIGMOB,name}>

What happens is that before the entry is processed, there is a substitution pass that evaluates any statements between {} and inserts the results into the entry string. Then the entry string is processed as usual.

LowCastle- 02-10-2006
Ooh that is perfect! I just knew xmlspawner could do it. I tested and it works great. Many thanks.