RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

XmlSpawner2

Corbomite

Wanderer
xmlAttachment to multi-damage pets

Arte, I was wondering if there was a way to attach some property or behavior to a mob or weap that will deal extra damage to player pets? I have the FTS Taming system and one of the evo packages, and not surprisingly, some pretty beefed pets roaming about. So beefed it is hard to balance templates absent introducing equally beefed mage and warrior armor and weapons.
 

ArteGordon

Wanderer
Corbomite said:
Arte, I was wondering if there was a way to attach some property or behavior to a mob or weap that will deal extra damage to player pets? I have the FTS Taming system and one of the evo packages, and not surprisingly, some pretty beefed pets roaming about. So beefed it is hard to balance templates absent introducing equally beefed mage and warrior armor and weapons.

The XmlEnemyMastery attachment allows you to deal extra damage to certain types of mobs.
When attached to a weapon, then that weapon deals extra damage. When attached to a player or mob, then all weapons they use will deal extra damage.

[addatt xmlenemymastery evodragon 100

will add an attachment that will increase damage by 100% on evodragon type creatures.

[addatt xmlenemymastery evodragon 30 200 120

will add an attachment that will increase damage by 200% on evodragon type creatures 30% of the time, and the attachment will expire in 120 minutes.

This attachment requires that you have performed installation step 7 to work.

(edit)
note,
[availatt will list all of the attachments and their args, including those for xmlenemymastery
 

Erucid

Sorceror
Ronin/Name/Mizu-Kami/HUE/187/Title/ /
/UNEQUIP,Shoes,delete
/EQUIP/<SamuraiTabi/Name/Mizu-Kami-Tabi/hue/187/FireBonus/2/PoisonBonus/1/>
/UNEQUIP,shirt,delete
/EQUIP/<Shirt/Name/Mizu-Kami-Shirt/hue/187/FireBonus/2/PoisonBonus/1/>
/UNEQUIP,outerlegs,delete
/EQUIP/<Hakama/Name/Mizu-Kami-Hakam/hue/187/FireBonus/2/PoisonBonus/1/>
/UNEQUIP,Pants,delete
/EQUIP/<PlateSuneate/Name/Mizu-Kami-Sune-Ate/hue/187/FireBonus/10/PoisonBonus/5/>
/UNEQUIP,InnerTorso,delete
/EQUIP/<PlateDo/Name/Mizu-Kami-PlateDo/hue/187/FireBonus/10/PoisonBonus/5/>
/UNEQUIP,Arms,delete
/EQUIP/<PlateHiroSode/Name/Mizu-Kami-Hiro_Sode/hue/187/FireBonus/10/PoisonBonus/5/>
/UNEQUIP,Helm,delete
/EQUIP/<DecorativePlateKabuto/Name/Mizu-Kami-Kabuto/hue/187/FireBonus/10/PoisonBonus/5/>
/UNEQUIP,Neck,delete
/EQUIP/<PlateMempo/Name/Mizu-Kami-Mempo/hue/187/FireBonus/10/PoisonBonus/5>
/UNEQUIP,Gloves,delete
/EQUIP/<PlateGloves/Name/Mizu-Kami-Gloves/hue/187/FireBonus/10/PoisonBonus/5/>
/UNEQUIP,TwoHanded,delete
/UNEQUIP,OneHanded,delete
/EQUIP/<Daisho/Name/Mizu-Kami-Daisho/hue/187/HitColdArea/10/>

Whenever I enter this into the XML spawner, and then close the XMLSpawner primary gump, it crashes UO program. Any Idears? And yes I've tried entering it in with no carriage returns.
 

Corbomite

Wanderer
Quote:
Originally Posted by Corbomite
Arte, I was wondering if there was a way to attach some property or behavior to a mob or weap that will deal extra damage to player pets? I have the FTS Taming system and one of the evo packages, and not surprisingly, some pretty beefed pets roaming about. So beefed it is hard to balance templates absent introducing equally beefed mage and warrior armor and weapons.

The XmlEnemyMastery attachment allows you to deal extra damage to certain types of mobs.
When attached to a weapon, then that weapon deals extra damage. When attached to a player or mob, then all weapons they use will deal extra damage.

[addatt xmlenemymastery evodragon 100

will add an attachment that will increase damage by 100% on evodragon type creatures.

[addatt xmlenemymastery evodragon 30 200 120

will add an attachment that will increase damage by 200% on evodragon type creatures 30% of the time, and the attachment will expire in 120 minutes.

This attachment requires that you have performed installation step 7 to work.

(edit)
note,
[availatt will list all of the attachments and their args, including those for xmlenemymastery

I was afraid of that. I was hoping that there was something that would key on the controlled property that would be more universal. I have never gotten enemymastery to work all that well, even with the proper installation, and even then you don't know if they are coming with a beetle, evo, wyrm or something of their own creation. Oh well. I suppose I could equip a mob with a multi slayer and bless it so it does not drop. Thanks!
 

snicker7

Sorceror
Arte: had a quick question regarding xmldialogs. when setting the depends to -1 to trigger automatically, with no keywords, the trigoncarried and notrigoncarried aren't working properly. for any other entries and even entries with depends -1 and keywords this doesn't occur.

What I mean to say is that if they arent carrying the trigoncarried item, it triggers anyways.
 

ArteGordon

Wanderer
Corbomite said:
I was afraid of that. I was hoping that there was something that would key on the controlled property that would be more universal. I have never gotten enemymastery to work all that well, even with the proper installation, and even then you don't know if they are coming with a beetle, evo, wyrm or something of their own creation. Oh well. I suppose I could equip a mob with a multi slayer and bless it so it does not drop. Thanks!
easy enough to make one for pets. Just change the test for creature type to test for controlled.
What problems did you have with enemy mastery? Note that the default is to only do enhanced damage 20% of the time.

Code:
using System;
using Server;
using Server.Items;
using Server.Network;
using Server.Mobiles;
using Server.Spells;
using System.Collections;

namespace Server.Engines.XmlSpawner2
{
	public class XmlPetMastery : XmlAttachment
	{
		private int m_Chance = 20;       // 20% chance by default
		private int m_PercentIncrease = 50;

		[CommandProperty( AccessLevel.GameMaster )]
		public int Chance { get{ return m_Chance; } set { m_Chance = value; } }
        
		[CommandProperty( AccessLevel.GameMaster )]
		public int PercentIncrease { get{ return m_PercentIncrease; } set { m_PercentIncrease = value; } }

		// These are the various ways in which the message attachment can be constructed.
		// These can be called via the [addatt interface, via scripts, via the spawner ATTACH keyword.
		// Other overloads could be defined to handle other types of arguments

		// a serial constructor is REQUIRED
		public XmlPetMastery(ASerial serial) : base(serial)
		{
		}

		[Attachable]
		public XmlPetMastery()
		{
		}
        
		[Attachable]
		public XmlPetMastery(int increase )
		{
			m_PercentIncrease = increase;
		}

		[Attachable]
		public XmlPetMastery(int chance, int increase )
		{
			m_Chance = chance;
			m_PercentIncrease = increase;
		}

		[Attachable]
		public XmlPetMastery(int chance, int increase, double expiresin)
		{
			m_Chance = chance;
			m_PercentIncrease = increase;
			Expiration = TimeSpan.FromMinutes(expiresin);
		}
        
		public override void OnAttach()
		{
			base.OnAttach();

			if(AttachedTo is Mobile)
			{
				Mobile m = AttachedTo as Mobile;
				Effects.PlaySound( m, m.Map, 516 );
				m.SendMessage(String.Format("You gain the power of Pet Mastery"));
			}
		}


		// note that this method will be called when attached to either a mobile or a weapon
		// when attached to a weapon, only that weapon will do additional damage
		// when attached to a mobile, any weapon the mobile wields will do additional damage
		public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
		{
			if(m_Chance <= 0 || Utility.Random(100) > m_Chance)
				return;

			if(defender is BaseCreature && attacker != null)
			{
				// is the defender a pet?
				if(((BaseCreature)defender).Controled)
				{
					defender.Damage( (int) (damageGiven*PercentIncrease/100), attacker );
				}
			}
		}
        
		public override void OnDelete()
		{
			base.OnDelete();

			if(AttachedTo is Mobile)
			{
				Mobile m = AttachedTo as Mobile;
				if(!m.Deleted)
				{
					Effects.PlaySound( m, m.Map, 958 );
					m.SendMessage(String.Format("Your power of Pet Mastery fades.."));
				} 
			}
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize(writer);

			writer.Write( (int) 0 );
			// version 0
			writer.Write(m_PercentIncrease);
			writer.Write(m_Chance);
		}

		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();
			// version 0
			m_PercentIncrease = reader.ReadInt();
			m_Chance = reader.ReadInt();
		}

		public override string OnIdentify(Mobile from)
		{
			string msg = null;

			if(Expiration > TimeSpan.Zero)
			{
				msg = String.Format("Pet Mastery : +{2}% damage vs pets, {0}%, hitchance expires in {1} mins", Chance, Expiration.TotalMinutes, PercentIncrease);
			} 
			else
			{
				msg = String.Format("Pet Mastery : +{1}% damage vs pets, {0}% hitchance", Chance, PercentIncrease);
			}

			return msg;
		}
	}
}
 

ArteGordon

Wanderer
snicker7 said:
Arte: had a quick question regarding xmldialogs. when setting the depends to -1 to trigger automatically, with no keywords, the trigoncarried and notrigoncarried aren't working properly. for any other entries and even entries with depends -1 and keywords this doesn't occur.

What I mean to say is that if they arent carrying the trigoncarried item, it triggers anyways.

with DependsOn of -1 and no keywords (spontaneous banter), Trig/NoTrigOnCarried are ignored and movement alone is enough to activate them.
Use DependsOn of -2 for spontaneous banter entries that are also controlled by the Trig/NoTrig settings.
 

Erucid

Sorceror
If you "[Props" and target a weapon, one of the things one can modifiy are "Attributes" and "WeaponAttributes". Within these headings are other fun stuff like "DurabilityBonus", In which a person can put in a percentage increase. What is the proper method to make an item via XMLSPawner using /ADD/ or /EQUIP/ that has these attributes?


Also, suppose a creature is scripted to commonly spawn in its pack something like a randomscroll or an amount of nightshade. Can XMLspawner remove these items from the creatures pack?


Suggestion...
After entering information like "Hiryu/Name/Kitty/Hue/187" the name Hiryu can no longer be visible in the primary gump. After about 1 page of specail creatures to be spawned, you can't easily go back and modify that one Hiryu that you no longer want name kitty. Can you make it so the first few characters of the enty is still visible in the main XML gump?



Thanks
 

snicker7

Sorceror
ArteGordon said:
with DependsOn of -1 and no keywords (spontaneous banter), Trig/NoTrigOnCarried are ignored and movement alone is enough to activate them.
Use DependsOn of -2 for spontaneous banter entries that are also controlled by the Trig/NoTrig settings.
ah, thank you much Arte, guess I should RTFM!
 

Corbomite

Wanderer
Originally Posted by ArteGordon
easy enough to make one for pets. Just change the test for creature type to test for controlled.
What problems did you have with enemy mastery? Note that the default is to only do enhanced damage 20% of the time.

ROFL. That is exactly what I need. Thanks Arte you are the best!
 

ArteGordon

Wanderer
Erucid said:
If you "[Props" and target a weapon, one of the things one can modifiy are "Attributes" and "WeaponAttributes". Within these headings are other fun stuff like "DurabilityBonus", In which a person can put in a percentage increase. What is the proper method to make an item via XMLSPawner using /ADD/ or /EQUIP/ that has these attributes?


Also, suppose a creature is scripted to commonly spawn in its pack something like a randomscroll or an amount of nightshade. Can XMLspawner remove these items from the creatures pack?


Suggestion...
After entering information like "Hiryu/Name/Kitty/Hue/187" the name Hiryu can no longer be visible in the primary gump. After about 1 page of specail creatures to be spawned, you can't easily go back and modify that one Hiryu that you no longer want name kitty. Can you make it so the first few characters of the enty is still visible in the main XML gump?



Thanks
you would do something like

brigand/ADD/<longsword/name/Blazer/weaponattributes.hitfireball/50>

you need to use the <> grouping characters so that the parser knows that you want to set those properties on the longsword instead of the brigand.

To access the contents of a spawned mobs pack, you could use the SETONCARRIED keyword. That keyword will act on the mobile that is referred to by the 'TriggerMob' property of the spawner which is normally the triggering player, but you can force it to refer to any mob you like by first assigning TriggerMob and then using the keyword, like this

subgroup 1: brigand
subgroup 1: SETONTHIS/TriggerMob/GETONSPAWN,1,serial
subgroup 1: SETONCARRIED,,gold/DELETE
subgroup 1: SETONCARRIED,,nightshade/DELETE

the GETONSPAWN,1,serial will refer to the serial number of the spawn on subgroup 1, which will be the brigand. Then the following SETONCARRIED keywords will refer to things that the brigand is carrying. I used an empty name argument for things like gold and nightshade.
Note, all the entries are in the same subgroup, so they will always spawn together and in the order listed.

To edit long entries, use the booktextentry button to the right of each spawner entry field in the main gump.
Long entries should already display the beginning of the entry text in the main gump.
You can also expand the main gump text entry area using the right arrow button down by the page buttons (near the word Spawner next to the spawner count and max values).
If you have more than 16 entries, you can use the page buttons (1-4) down near the bottom of the gump to switch between entry pages.
 

ArteGordon

Wanderer
updated to version 3.11

from the changelog

New to version 3.11
updated 6/14/06

- added support for proximity triggering by non-player npcs. Setting the new AllowNPCTrig property on the spawner to true will allow it to be triggered by both players and non-player npcs.
NPC proximity triggering is configured the same as regular player proximity triggering by setting the ProximityRange and the other optional triggering controls such as SpawnOnTrigger or even things like SpeechTrigger (when used with xmlquestnpcs that can generate actual speech), or the PlayerTrigProp property to test for properties on the triggering npc just as it used to for players.

- a small change to the XmlDialog attachment that allows it to be reset by setting the DoReset property via an Action field in XmlDialog entries (thanks to Vladimir for the idea). This allows the use of an action such as

SETONTHIS/doreset/true

to allow the xmldialog to become immediately available for reactivation without having to wait for it to timeout from the last player.

- added a new IgnoreCarried flag to xmldialog entries that will allow them to ignore the Trigger/NoTriggerOnCarried settings that normally control their activation (thanks to Vladimir for the idea). Previously, if the Trigger/NoTriggerOnCarried fields were set then all speech-dependent entries required that condition to be satisfied before they could be activated. In the [xmledit gump, the flag can be toggled by checking the new IgnoreCar box.

This will allow you to set up entries that you want to keep separate from the main triggering conditions.

- added a check to xmldialogs to prevent assigning invalid speechhue values (greater than 37852) that could cause client crashes.

- added the new spawn position control keywords #DXY,dx,dy[,dz] and #XY,x,y[,z].

#DXY will place the spawn at the specified delta xy coordinates relative to the spawner location.
#XY will place the spawn at the specified absolute xy coordinates.

For example, the spawn entries

#DXY,2,3 ; orc
#XY,5441,1700 ; troll

would spawn an orc at a location relative to the spawner and a troll at an absolute location.

- fixed a problem in referring to mobile or item type properties when assigning other mobile or item type properties. Mobile or Item type properties that return the name as well as the serial numbers of the target were not being properly parsed that caused examples like masterhelper.xml not to work. So spawn entries like

SETONSPAWN,1/combatant/GETONSPAWN,2,combatant

will now work properly.

- added the ability for [xmlfind to search spawners based on the type of objects being spawned and not just the spawner entry string itself. By specifying the search type as either 'xmlspawner' or 'spawner' and checking the new 'type' checkbox next to the 'entry' field, the entry string will be treated as the type of the spawn entry to be found instead of just a string to be matched against the spawn entry.
With both the entry and type boxes checked, the search will find all spawners that contain entries that are of the the specified type. So to find all spawners with vendors on them, specify an entry field of 'basevendor'.
This will work for both xmlspawners and regular distro spawners.

finding all spawners with baseweapon type spawn entries


- fixed a possible [xmlfind search results gump display synchronization problem. This may have produced garbled text or lost client connections when displaying search results under certain conditions. (thanks to LowCastle and CEO for pointing this out).

- added a new attachment called XmlDeathAction. This attachment, when applied to a creature allows any spawnable action to be performed on the creatures death. (thanks to Syntria for the idea). This could include sending the killer a gump or a message, adding items to the corpse, spawning another creature, etc. (the killer is considered to be the trigger mob in these actions).
An example of these applications is included in deathaction.xml in xmlextras.zip. Just "[xmlloadhere deathaction.xml" and start killing the creatures to see what happens.
For example, with this spawn entry

harpy/ATTACH/<xmldeathaction/action/@GUMP,Harpy be gone,0/Congratulations! You killed a harpy.

killing the harpy gives you this


You must perform xmlspawner installation step #2 for this attachment to work.

- added the XmlAddTithing attachment which is just like the XmlAddFame, or XmlAddKarma attachments but for tithing points.

- fixed a problem with TalkingBaseEscortable destinations that were not being properly restored after server restarts (thanks to EtraDor for pointing this out).

- added the 'stafflevel' property of the staffcloak (or any other item) to the protected property list that blocks any attempt to set it via xmlspawner to prevent possible exploits (thanks to snicker7 for pointing that out).

- spawn entry strings displayed in the properties list on mouseover of the spawner crystal are now truncated at 20 chars. This improves the appearance and avoids any problems the client might have trying to display extremely long spawn entries.
 

Erucid

Sorceror
Lets talk about XML Dialoge Gumps...

After reading this page xmlspawner Fan Webpage I'm just as confused as to how to set one of these up. I need specific examples of What & How commands function.

I would like to bring up a gump at the begining of the dialoge with something like this...
GUMP,TravelorGump,4/It will cost you 50gp for transport to Isamu-Jima, and 100gp for transport to Homar-Jima. Where would you like to go? ; Isamu-Jima ; (take away 10gp and then Set a new location on TrigMob) ; Homar-Jima ; (same above); No Thanks; (Brings up a second gump with further questions/information)
How would I do this?

What is the proper method of
SETONTRIGMOB/Location/x,y,z
To trasnport the PC to the specified location?

Thanks
 

ArteGordon

Wanderer
Erucid said:
Lets talk about XML Dialoge Gumps...

After reading this page xmlspawner Fan Webpage I'm just as confused as to how to set one of these up. I need specific examples of What & How commands function.

I would like to bring up a gump at the begining of the dialoge with something like this...
How would I do this?

What is the proper method of To trasnport the PC to the specified location?

Thanks

There is an example of what you want to do in xmlextras.zip. It is called travelagent.npc

To have that gump come up when a dialog entry is activated, just enter what you typed into the Gump field for the entry, but replace the things in parentheses with the response strings that you want generated when the player selects that option.

Isamu-Jima ; Isamu ; Homar-Jima ; Homar; No Thanks; Refuse

Then you would add dialog entries that have their DependsOn field set to the ID of that entry, and have their Keyword field set to the different response strings (like Homar, Isamu, or Refuse). Those entries would then handle the different responses and could carry out the action that you wanted such as taking gold and transporting them, or bringing up another gump.
You would set those actions in the Action field for the entry.

You can set locations with this

SETONTRIGMOB/Location/(x,y,z)

You need the () around the coordinates because that is the format for Point3D property values. You can see this by doing a '[get location' and seeing the format that it returns.
 

Corbomite

Wanderer
Thanks Arte!

easy enough to make one for pets. Just change the test for creature type to test for controlled.
What problems did you have with enemy mastery? Note that the default is to only do enhanced damage 20% of the time.

That xmlpetmastery script works great. Thanks for the help again!


Oh is your 2.0 release backward compatible?
 
S

Sheilaplafcan

Guest
I made a xml quest npc that says "Greetings M'Lord" when Admins walk by. I want her to bow also, but i have no clue what to put under action. Could someone plz help me. Thankyou! :confused:
 

ArteGordon

Wanderer
Sheilaplafcan said:
I made a xml quest npc that says "Greetings M'Lord" when Admins walk by. I want her to bow also, but i have no clue what to put under action. Could someone plz help me. Thankyou! :confused:

try this

SETONPARENT/ANIMATE,32,5,1,true,false,0

the parent of xmldialogs is whatever it is attached to, such as the npc. The ANIMATE keyword will cause the object to perform the specified animation. For human bodies, animation 32 is the bow animation.

ANIMATE,action[,framecount][,repeatcount][,forward true/false][,repeat true/false][delay]

(edit)

sorry, I was wrong about that. SETONTHIS will refer to what it is attached to, not SETONPARENT.
 

ArteGordon

Wanderer
Sheilaplafcan said:
I tried that and it don't work. Maybe i have an older version?
probably. The ANIMATE keyword was added in v3.09. You can use the [smartstat command to tell you what you are running.
If you are running a recent version, then try this instead

SETONTHIS/ANIMATE,32,5,1,true,false,0
 
Top