ServUO Version
Publish Unknown
Ultima Expansion
Time Of Legends
Does anyone here do scripts for money? I have two scripts I need merged into one , been trying to make it work now for 3mos and I’m simply exhausted trying. Please me if anyone is interested, and thank you.
 
Well its for a quest weapon really, Excalubur, I want to put Flamestrikek on it however it keeps making reference "undefined default" and "definition of Default" which i completely do not understand, I mean i have gottten better this year but some terms escape me and no matter how i try to guess at it, FS will not go on sword , thinking because "magical property" is .........grr ok i have no idea. Mashing my face over this.
 
Do you mean you want a weapon to have a flamestrikek effect when attacking? Does damage follow the formula of flamestrikek's spell or is it defined differently?
 
Yes i want the sword to flamestrike *chance to hit 1:3* So at least once every three hits it will flamestike the target *man or beast* and will do the damage of Flamestrike , so it will be just like if a mage would of casted it on you or on the beast.
I have been trying to merge for about 3mos nowo with WinMerge and have yet to get it to work, the Define default keeps coming up and i dont understand what a default is or how to define it.
 
Code:
 public override void OnHit(Mobile attacker, IDamageable damageable, double damageBonus)
        {
            base.OnHit(attacker, damageable, damageBonus);

            if (!attacker.CanBeHarmful(damageable, false))
            {
                return;
            }

            attacker.DoHarmful(damageable);

            double damage = GetAosSpellDamage(attacker, damageable as Mobile, 48, 1, 5);

            damageable.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
            damageable.PlaySound(0x208);

            SpellHelper.Damage(TimeSpan.FromSeconds(1.0), damageable, attacker, damage, 0, 100, 0, 0, 0);

            if (ProcessingMultipleHits)
                BlockHitEffects = true;
        }

Put this on whatever weapon you want to add flamestrike to. Be sure to add a reference to Server.Spells at the top there. As far as payment... I will call upon you when it is needed. It might be now, it might be 10 years from now, but whenever I call upon you I expect you to follow my orders without hesitation.
 
Last edited:
C#:
public override void OnHit(Mobile attacker, IDamageable defender, double damageBonus)
    {
        base.OnHit( attacker, defender, damageBonus );
        
        if(attacker.Player)
        {
            PlayerMobile pm = (PlayerMobile)attacker;

            if (defender is Mobile && ((Mobile)defender).Player)
            {
                Effects.SendLocationEffect(new Point3D(defender.X , defender.Y , defender.Z),this.Map, 0x3709, 15, 30);
                AOS.Damage(defender, attacker, pm.(pm.RawStr+pm.RawDex)/10, 25, 60, 25, 25, 25);
                ((Mobile)defender).Stam -= pm.RawStr/2;
            }
            if (defender is Mobile &&  !((Mobile)defender).Player)
            {
                int myluck = (AosAttributes.GetValue(pm, AosAttribute.Luck));
                int x = (myluck/70)*7;
                double random = Utility.RandomDouble();
                double chance = 0.000863316841 * x ;
                
                if (chance >= random )
                {
                    attacker.DoHarmful(((Mobile)defender));
                    Effects.SendLocationEffect(new Point3D(defender.X , defender.Y , defender.Z),this.Map, 0x3709, 15, 30);
                    AOS.Damage(defender, attacker, (pm.RawStr+pm.RawDex)/3, 0, 100, 0, 0, 0);
                }
            }
        }
    }

This is mine, which distinguishes the different damage of players in PvP and PVM.

And the lucky level affects the trigger probability of PVM

Ha ha, I'm a layman. Just to achieve the effect, do not pay attention to whether the code is efficient or concise
 
Yes i want the sword to flamestrike *chance to hit 1:3* So at least once every three hits it will flamestike the target *man or beast* and will do the damage of Flamestrike , so it will be just like if a mage would of casted it on you or on the beast.
I have been trying to merge for about 3mos nowo with WinMerge and have yet to get it to work, the Define default keeps coming up and i dont understand what a default is or how to define it.
Sounds like you are talking about the "default" keyword as in

C#:
int i = default;

the error comes cause you're using a c# version that is pretty old, you can fix this by replacing "default" with the actual default values or upgrading your servers c# version

e.g.: for int or double it would be 0 and for a string it's null etc.

C#:
// uses default literal
string x = default;

// same as above but without using the default literal
string x = null;

See the following links for more:
- default value expressions - C# reference
- Default values of C# types - C# reference
 
HOLY CRAP, I Was sick for the last two weeks and i log on and WOW, you guys are amazing ! I would of paid for this ya know but I am Sooooo grateful for the help !! Now to decide which of the top works best, i LOVE the pvp/pvm option to add and/or take away . Gonna try them BOTH and again thank you BOTH SO DAMN much !!!!
Ok so i went to put it in LOL and something hit me, I see several places to add it , or so it looks, does it matter which place i put it ?
public override int InitMinHits{ get{ return 110; } }
public override int InitMaxHits{ get{ return 250; } }
[Constructable]
public Excaliber()
{
Name = "Excaliber";
Hue = 2998;
ItemID = 9935;

WeaponAttributes.HitLightning = 65;

WeaponAttributes.HitLeechHits = 20;
WeaponAttributes.HitLeechMana = 25;

Attributes.AttackChance = 10;
Attributes.BonusDex = 5;

Attributes.SpellChanneling = 1;
Attributes.WeaponDamage = 30;
Attributes.WeaponSpeed = 20;
WeaponAttributes.SelfRepair = 5;

AosElementDamages.Cold = 70;
SkillBonuses.SetValues( 0, SkillName.Chivalry, 10 );
}
public Excaliber( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
I was thinking right before this line

public Excaliber( Serial serial ) : base( serial )
Sounds like you are talking about the "default" keyword as in

C#:
int i = default;

the error comes cause you're using a c# version that is pretty old, you can fix this by replacing "default" with the actual default values or upgrading your servers c# version

e.g.: for int or double it would be 0 and for a string it's null etc.

C#:
// uses default literal
string x = default;

// same as above but without using the default literal
string x = null;

See the following links for more:
- default value expressions - C# reference
- Default values of C# types - C# reference
Thank you so much for this input, it will be INVALUABLE in scripting to come !
 
Last edited:
Back