Theres something wrong with Xmlstr.

for example

Harpy/ATTACH/XmlSTR,500,5 is not working at all, the harpy spawns with like 20% hitpoints that means the str got increased then after few seconds the hitpoints go back to 100% if i do

.getatt there are no attachments

im trying the next thing

Decrease every player STR by X amount after a mobile gets killed but i cant attach xmlstr to a creature.

harpy/ATTACH/<xmldeathaction/action/,*,playermobile/ATTACH/XmlStr,3,2 (doesnt work gives me an error)

xmlstr.png

If i do .global addatt xmlstr -50 where playermobile it works

Every player gets -50 str for 60 seconds (default time duration) and again the .getatt doesnt show the XmlStr attachment

Same goes to xmlint.. xmldex...

Any idea?

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

namespace Server.Engines.XmlSpawner2
{
    public class XmlStr : XmlAttachment
    {
        private TimeSpan m_Duration = TimeSpan.FromSeconds(60.0);       // default 30 sec duration
        private int m_Value = 10;       // default value of 10

        [CommandProperty(AccessLevel.GameMaster)]
        public int Value { get { return m_Value; } set { m_Value = 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 XmlStr(ASerial serial)
            : base(serial)
        {
        }

        [Attachable]
        public XmlStr()
        {
        }

        [Attachable]
        public XmlStr(int value)
        {
            m_Value = value;
        }

        [Attachable]
        public XmlStr(int value, double duration)
        {
            m_Value = value;
            m_Duration = TimeSpan.FromSeconds(duration);
        }

        public override void OnAttach()
        {
            base.OnAttach();

            // apply the mod
            if (AttachedTo is Mobile)
            {
                ((Mobile)AttachedTo).AddStatMod(new StatMod(StatType.Str, "XmlStr" + Name, m_Value, m_Duration));
            }
            // and then remove the attachment
            Timer.DelayCall(TimeSpan.Zero, new TimerCallback(Delete));

            //Delete();
        }
    }
}

In xmlmobfactions reward stone theres a reward that gives +20 str for 1 day, it doesnt work either, the attachment doenst get added.

Code:
MobFactionsRewardList.Add( new XmlMobFactionsRewards( null, 0, typeof(XmlStr), "+20 Strength for 1 day", 10000, 0, new object[] { 20, 86400.0 }));

EDIT:

Quote by arte gordon:

the way that those attachments work is that when you add them, they apply a standard skill/stat mod using the built-in RunUO skill/statmod system, and then delete themselves.
So when you look for the attachments, you wont find anything even though the mod has been applied.

The most recent version of of the attachments doesnt produce the messages like "Attachment Skill not added" when successfully applied.

You could definitely make up a race system using attachments. It would allow you to add race mods without having to make edits to playermobile serialization.

Okay so how to add an xmlstr attach to every player after a mob gets killed?
 
Last edited:
Back