Full Version : XmlSiege beta 0.7 [RunUO 2.0]
xmlspawner >>XMLSiege Releases and Updates >>XmlSiege beta 0.7 [RunUO 2.0]
<< Prev | Next >>
ArteGordon- 06-17-2006
XmlSiege beta release 0.7
RunUO 2.0 support
updated 6/17/06
ArteGordon
SUMMARY
This set of attachments provides a system for allowing objects and structures to be damaged by siege weapons and repaired by siege tools.
Weapons included are the SiegeCannon and SiegeCatapult that fire siege cannonballs, and the SiegeRam that uses siege logs.
Hand siege weapons such as maces are also supported.
This is an early beta release. It works in its current form, but I will be adding things and making changes, so this is more for people to play around with and make suggestions.
CHANGELOG:
New to version 0.7a
updated 6/18/06
- removed the Dupe overrides for RunUO 2.0 compatibility from siegecannonballs.cs and siegelogs.cs.
- added GrapeShot cannonballs that only do mobile damage to the standard cannonballs in siegecannonballs.cs (thanks to MetallicSomber for the suggestion).
New to version 0.7
updated 6/17/06
- added support for sieging custom houses.
- correct hand siege attack animation added for unmounted players.
New to version 0.6
updated 4/17/06
- adjustment to the HandSiegeAttack attachment attack timer that prevents people from trying to get around the attack delay by repeatedly manually retargeting.
- added individual siege weapon scaling factors that affect damage and range. These are set by the overridable WeaponDamageFactor and WeaponRangeFactor properties in BaseSiegeWeapon.cs
SiegeCannons now have a 20% damage bonus and 20% increase in range when compared to catapults using the same projectiles.
- added support for degraded weapon damage and range performance as the weapon takes damage. By default, weapon damage will be reduced by up to 60% from its max value depending on how damaged the weapon is, and firing range reduced by up to 30%. This can be configured by changing or overriding these settings in BaseSiegeWeapon.cs

CODE
public virtual double DamageReductionWhenDamaged { get { return 0.4; } } // scale damage from 40-100% depending on the damage it has taken public virtual double RangeReductionWhenDamaged { get { return 0.7; } } // scale range from 70-100% depending on the damage it has taken

- added individual siege projectile damage scaling factors for creatures and structures. These are set by the overridable MobDamageMultiplier and StructureDamageMultiplier properties in BaseSiegeProjectile.cs. This allows different types of cannonballs to do different amounts of damage to creatures and to structures by overriding these settings in their class definitions.
- destroyed objects will no longer report damage taken when they are hit.
- catapult launch animation is working again.
- added a new siege weapon, the SiegeRam for close range attacks on structures. It has a faster attack speed than either the cannon or catapult, and the new SiegeLog ammunition can produce heavy damage to structures but is ineffective against creatures and has very short range.
The ram can also be loaded with SiegeLog stacks so that it can attack repeatedly without having to reload after each attack.
ramming speed!
- added the new SiegeLog siege ammunition type for use in the SiegeRam and 3 examples, the LightSiegeLog, HeavySiegeLog, and IronSiegeLog. They vary in damage and speed.
- added the SiegeRamDeed that can be used to sell Siege Rams.
- added the AutoRepairFactor setting in XmlSiege.cs to allow you to specify the fraction of HitsMax to be repaired on each OnTick of the autorepair system. (thanks to Prohor Meletevich for the suggestion)

CODE
public virtual double AutoRepairFactor { get { return 0.1; } } // fraction of HitsMax to repair on each autorepair OnTick. A value of 1 will fully repair.

- added the XmlChestSiege attachment which is a version of the XmlSiege attachment that can be put onto containers to allow them to spill their contents when destroyed.
New to version 0.5
updated 4/6/06
- added the AutoRepairTime property to XmlSiege attachments that allow them to automatically restore destroyed objects back to their fully repaired state after some period of time. This can be used under conditions where you would like to have players use the siege capability to destroy structures, but not leave them permanently destroyed. For example having permanently locked dungeon doors or wall barriers that can only be passed by breaking them down.
Giving it a value of zero disables auto repair. The default is no auto repair.
Auto repair only occurs when an object is destroyed (hits == 0), not when it is just damaged.
- added a few static functions that can be used by external scripts to access siege damage information. GetHits and GetHitsMax will return a value of -1 if the target does not support siege damage. Refer to them like

CODE
int hits = XmlSiege.GetHits(targetobject);

CODE
public static int GetHits(object target) public static int GetHitsMax(object target) public static void Attack(Mobile from, object target, int firedamage, int physicaldamage)

- added support for handheld siege weapons. Any equippable weapon can be given the ability to apply siege damage to a target. This is accomplished with the new HandSiegeAttack attachment that lets the object that it is attached to do damage to a target that has the XmlSiege attachment on it.
For example, by adding this to a weapon script such as Mace.cs

CODE
public override void OnDoubleClick(Mobile from) { HandSiegeAttack.SelectTarget(from, this); }

you can siege attack a target object by double clicking on the mace and targeting the object. In this case, you dont actually have to worry about adding the HandSiegeAttack attachment to the weapon - it will be done automatically in the SelectTarget routine if it hasnt already been added.
You will also have to add this to the top of the specific weapon script

CODE
using Server.Engines.XmlSpawner2;

The speed of attack and damage done can be modified by changing the value of these constants in HandSiegeAttack.cs

CODE
private const double DamageScaleFactor = 0.5; // multiplier of weapon min/max damage used to calculate siege damage. private const double BaseWeaponDelay = 9.0; // base delay in seconds between attacks. Actual delay will be reduced by weapon speed.

Anything that can be attacked with the other siege weapons can also be hand attacked. Attacks will automatically continue until either the attacker or target move.
Always knock before entering... or was that knock down..
I asked them not to park here
I got your key right here.
New to version 0.4
updated 4/5/06
- added a minimum targeting distance to each weapon so that you cannot attack things that are too close. This will also prevent them from targeting themselves.
- firing animation no longer follows moving mobiles.
- cannons and catapults can now target ground locations. Projectiles with area damage, will cause damage to objects around the targeted ground location when the projectile hits.
- modified weapon dragging to automatically release if the mobile dragging it goes offline or is stabled.
- damage to mobiles is now appropriately modified by their physical and fire resistances if AOS is enabled.
- an allowharmful check is made on mobiles before applying damage.
- added new base classes for weapons and projectiles. This will simplify adding new weapons but this changes the serialization of the existing siegecannonballs, siegecatapults, and siegecannons. To convert existing objects from beta 0.3 or earlier to the new type, just follow these steps:
1) temporarily modify the deserialization for the abstract SiegeCannonball class at the beginning of SiegeCannonball.cs to look like this

CODE
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); //int version = reader.ReadInt(); }

and do the same thing in SiegeCannon.cs and SiegeCatapult.cs
2) restart the server
3) do a save
4) uncomment the

CODE
int version = reader.ReadInt();

lines that you commented out in those files.
New to version 0.3a
updated 4/4/06
- added deeds for cannons and catapults. (thanks to Anvil for the suggestion) Note, these can only be used once and the weapons are not re-deedable.
New to version 0.3
updated 4/3/06
- added the new SiegeCatapult weapon. They are similar to cannons, but are not restricted by line-of-sight when choosing targets. The base weapon loading delay is 5 seconds longer than cannons. They accept the same ammunition as cannons.
Note that there are firing animations for all facings except for North. If anyone can find the catapult launch arm itemids for that facing let me know.
fire!
- cannons and catapults can now be dragged by a mobile. The new Connect/Release context menu options have been added to support this function.
Just select Connect from the context menu and target a mobile. When the mobile moves the weapon will be pulled behind it. Selecting Release will disconnect the weapon from the mobile.
This feature makes use of the new XmlDrag attachment that allows any object with the attachment to be dragged by a mobile.
Only newly created cannons or catapults will have this attachment automatically added. Existing weapons will need to have them manually added. This can be done with a command like
[global addatt xmldrag where siegecannon
- added the IsDraggable and IsPackable properties to cannons and catapults to control how you would like to allow them to be moved. Both are true by default.
- added FixedFacing property to the cannons and catapults to allow them to be setup so that they cannot be reoriented.
- added new constructors for the xmlsiege attachmets that allow optionally specification of the DestroyedItemID as well as the hits, resistances, and repair resources.
The [availatt will list all available attachments and their constructors, so you can see the list using that command.
- added some additional effects properties to fiddle around with. The LightDamageEffectID, MediumDamageEffectID, and HeavyDamageEffectID. By setting these you can experiment with different effects at different levels of damage.
- adjusted the firing effect of the fierycannonball to look like a fireball instead of a regular cannonball.
- improved the firing animations so that the firing effect more accurately reflects the weapon and target locations. This should fix the 'underground' cannonball effects.
- added mouseover information on the siege weapons as to whether or not they are loaded and what they are loaded with.
- added access to the siege weapon properties through the siege addon components, so you can do a [props on any component, and set the corresponding properties on base weapon addon.
- damage is now delayed to correspond to the time when the projectile actually reaches the target instead of being applied as soon as the weapon is fired.
New to version 0.2b
updated 3/25/06
- fixed a line of sight problem that was giving the "Cannot see target" message for certain target items and mobiles.
New to version 0.2a
updated 3/25/06
- fixed a problem with the Next/Previous option for siege cannons that was incorrectly placing them at a Z of 0 when rotating instead of leaving them in their current location.
New to version 0.2
updated 3/23/06
- added support for multis such as boats, camps, and player houses.
To add an attachment to a multi use a command like
[area addatt xmlsiege where basemulti
and target around the multi.
Cannons can attack multis by simply targeting any part of the multi that is within the line of sight of the cannon.
To access attachments on multis, use xmlfind with the Range restriction to search for nearby basemultis and then access the siege attachment by selecting the blue button shown on the individual search result listings.
[xmlfind basemulti 20
will set up a search for all basemultis within 20 tiles.
Let that woman go!
Two cannons are better than one
Now this is what I call a house-warming party
- changed the damage display to use flame effects instead of rehueing.
Flame color and density will change with damage level.
Either or both can be selected by changing the UseEffectsDamageIndicator or UseColorDamageIndicator settings in xmlsiege.cs
The flame effects depend on nearby player movement, so they only get sent when players are nearby.
- the DestroyedItemID for multis is automatically put into multi range and so will have 0x4000 added to whatever value you assign.
- repair can now be area-based. You can repair an object by just targeting within 2 tiles of it. This makes it easy to repair things that are difficult to target directly, such as addons and multis. For multis, you still need to target near the 'handle' for the multi, which is generally near the center.
- repairing a structure from the destroyed state now incurs a penalty in time and resources (default is 3x more for each).
- staff have instant repair with no resource cost.
DESCRIPTION:
This system makes use of the XmlSpawner2 attachment system and the XmlSpawner2 package must be installed to support it. You dont need to use the xmlspawners themselves, and it doesnt matter whether you use the standard distribution spawners or any other spawning system but you do need the XmlSpawner2 package installed.
Because the attachment system neither requires nor makes any changes to serialization/deserializations of any item or mobile, it can be safely added and removed at any time now or in the future without interfering with any other systems that you might have installed.
You can safely add the XmlSiege attachment to any object. The damage effects are fully reversable and no permanent changes will be made. If you delete the attachment, the object will be restored to its original itemid and color (for the exception, see the section below on the option of permanent destruction).
INSTALLATION:
- have the latest version of xmlspawner2 installed.
- drop in the Xmlsiege scripts and go. No modifications to any other scripts are required.
UNINSTALLING THE SYSTEM:
If you have tried it out and wish to uninstall the system and undo any siege damage effects, you should first delete all of the XmlSiege attachments to restore objects to their original form before removing the scripts. The following command will do this:
[global delatt xmlsiege
Then just remove all of the scripts for the system.
FEATURES:
Note that ANY non-frozen object can be made damageable - walls, doors, signs, trees, multis, addons - anything. You just have to tag them with the xmlsiege attachment.
Creating damageable objects
To create a damageable object, just tack an XmlSiege attachment onto it, with
[addatt xmlsiege
and target the object. That will add the default 1000 hits to the structure, with 30% fire and physical resistance, and a repair requirement of 1 stone, 20 iron, 20 wood to repair 100 hits.
You can also specify optional arguments to the attachment. The additional constructors that take arguments are
xmlsiege hitsmax
xmlsiege hitsmax resistfire resistphysical
xmlsiege hitsmax resistfire resistphysical wood iron stone
HitsMax specifies the maximum number of hits the structure can take before being destroyed.
ResistFire and ResistPhysical are the percentage reduction in that type of damage that the object will take.
Wood, Iron, Stone - are the amount of each resource that will be required to repair 100 hits of damage on the object using the SiegeRepairTool
If you target an addon component, such as part of a structure spawned with the MULTIADDON keyword, then that part of the addon will become damageable.
If you attach it to the entire addon (which is hard to do with manual targeting), then the entire addon will become damageable.
For example, spawn the example wall.txt multi file with
MULTIADDON,wall.txt/attach/xmlsiege
and now the entire addon will take damage if any part of it is hit.
If you just spawned it and then added the attachment to individual wall segments, then only those segments would take damage.
Modifying XmlSiege settings on an object
To modify the xmlsiege settings on a damageable object with an XmlSiege attachment already on it, open up the attachment list gump using the getattachment command
[getatt
and target the object that you wish to modify/inspect. The gump will list the attachments on the object. Click the scroll to the left of the XmlSiege entry and it will open the properties gump for the attachment.
Seeing object damage
Once an object is damaged it will change color to indicate the level of damage.
The default colors are
green=67-99% of max
yellow=34-66%
red=1-33%
Blue is also temporarily assigned to objects that have just had the XmlSiege attachment added to them so that you can see what is damageable.
I dont really like the color system for damage indication, but I'm still working on possible alternatives at the moment.
Once the Hits for an object reach zero, then the ItemID of the object will be changed to the value specified in the DestroyedItemID propery of the xmlsiege attachment.
Individual attachments can have their own DestroyedItemID settings.
The default is a lava pool.
Permanent destruction
If you change DestroyedItemID setting to zero, then when the Hits of the object reach zero the object will be permanently destroyed - gone, no repair, never to return. Use this with care. Any other setting of DestroyedItemID is fully reversable and will not lead to any permanent changes to the target.
You might want to apply this setting for objects like cannons to allow them to be actually destroyed.
Repairing damageable objects
SiegeRepairTool - this is used to repair damaged objects.
Adding the tool
To add one of these, just do an
[add siegerepairtool
Using the tool - Just double-click to use and target the damaged object to be repaired. It can be given either limited (set UsesRemaining to a value > 0) or unlimited number of uses (set UsesRemaining to a value < 0).
Repair resources
You must have the required resources to repair the targeted object. The default setting is to repair 100 hits of damage per use.
Objects can require wood, iron, and/or stone for repair.
Iron = IronIngot
Wood = Board
Stone = Granite
The required resources for any given object can be specified in the XmlSiege attachment.
All of the resources must be in the pack of the person doing the repair.
Repair time
The speed of the repair will depend on their Blacksmith and Carpentry skills as well as dexterity. With max skill and dex it can be as fast as 3 seconds. With no skill it can take up to 15 seconds.
If you are missing any of the resources, the repair will not be done but any of the other resources that were needed and that you were carrying will be consumed.
Siege Cannon
Placing a cannon
you can use the [add command to place one. It requires a facing argument of 0-3, like
[add siegecannon 0
Changing the cannon facing
Then you can change the facing while it is placed using the 'Previous/Next' options in the context menu that comes up when you click it.
Moving a cannon
To move a cannon you must first pack it up using the 'Backpack' context menu option. This takes time (15 seconds) and you must be next to it at the beginning and end of packing. When finished you will have a crate in your pack that you can place anywhere.
Firing a cannon
To fire a cannon you must first load a cannonball into it. Then double-click the cannon and select the target.
The target must be within the cannonball range, and within the firing arc of the cannon. Note, that you can target mobiles as well as structures, and mobiles will also take splash damage from area damage cannonball attacks.
Taking damage
The cannon is configured with an xmlsiege attachment by default, so it can take damage from other cannons as well.
Cannonballs
I have added a few different types of premade cannonballs, but you can easily modify them or add your own. You can even create them and change their settings on the fly since all of their properties are accessible.
Cannonballs have the following configurable properties:
Range - maximum range in tiles
Area - number of tiles surrounding the target that will also take damage
AccuracyBonus - mod that affects chance of hitting the target
FiringSpeed - mod that reduces the minimum interval between firing.
PhysicalDamage - amount of physical damage delivered
FireDamage - amount of fire damage delivered
If you want to see more dramatic damage effects, just try increasing the Area, FireDamage or PhysicalDamage settings on them.
To allow you to fire them faster, change the FiringSpeed. Higher is better.
For longer range attacks, change the Range property.
The premade cannonballs included are
lightcannonball, ironcannonball, explodingcannonball, fierycannonball
To try some, just use the [add command like
[add ironcannonball 30
The ones included are sort of balanced by range, damage, and area effects.
iron has medium range (15), no area, high damage (100)
light as longer range (17), no area, medium damage (80)
exploding has shorter range (11), small area (1), lower damage (60)
fiery has shortest range (8), large area (2), lowest damage (40)
note that that cannonballs with area damage may do low damage to individual targets, but can actually do the most total damage if used in the right spot since a fiery cannonball could actually do 40 damage to each target in a a 5x5 area and an exploding does 60 damage to a 3x3 area.
There are also accuracy and speed balance tradeoffs for each.
light has good accuracy (0), fastest speed (35)
iron has good accuracy (0), medium speed (25)
exploding has lower accuracy (-10), slower speed (20)
fiery has lowest accuracy (-20), slowest speed (10)
and the fiery and exploding are the only ones with fire damage.
Loading a cannonball
Just double-click a ball and then target a cannon. You must be close enough to both, although you can dclick the ball, and then move to the cannon.
Screenshots
Using a fierycannonball on an addon with each component individually damageable, and an orc in the wrong place at the wrong time
Files:
XmlSiege-20-v07-beta.zip version for RunUO 2.0