drewwales

Initiate
ServUO Version
Publish 57
Ultima Expansion
Endless Journey
ok so heres my construct, but when I compile i get.

C#:
C:\ServUO\Scripts\Custom\Items\Weapons\Fire\CinderFang-FT2.cs(43,38): error CS1061: 'AosWeaponAttributes' does not contain a definition for 'HitFireBall' and no accessible extension method 'HitFireBall' accepting a first argument of type 'AosWeaponAttributes' could be found (are you missing a using directive or an assembly reference?)

Am I missing something? also if i take out the hit fireball it compiles with no errors but never adds HitMagicArrow....

The construct:
[Constructable]
    public CinderFang()
    {
        Name = "Cinder Fang";
        Hue = 2736;
        Attributes.WeaponDamage = 30;

        AosElementDamages.Physical = 0;
        AosElementDamages.Fire = 100;
        AosElementDamages.Cold = 0;
        AosElementDamages.Poison = 0;
        AosElementDamages.Energy = 0;

        // 50% chance to add one random fire effect between 50-100%
        if (Utility.RandomDouble() <= 0.5)
        {
            int effectStrength = Utility.RandomMinMax(50, 100);
            int choice = Utility.Random(3);

            switch (choice)
            {
                case 0:
                    WeaponAttributes.HitMagicArrow = effectStrength;
                    break;
                case 1:
                    WeaponAttributes.HitFireBall = effectStrength;
                    break;
                case 2:
                    WeaponAttributes.HitFireArea = effectStrength;
                    break;
            }
        }
    }
 
HitFireBall should be HitFireball

Refactored Version!:
// 50% chance to add one random fire effect between 50-100%

        int effectStrength = Utility.RandomMinMax(0, 100);

        if (effectStrength > 49)
        {
            switch (Utility.Random(3))
            {
                case 0:
                    WeaponAttributes.HitMagicArrow = effectStrength;
                    break;

                case 1:
                    WeaponAttributes.HitFireball = effectStrength;
                    break;

                case 2:
                    WeaponAttributes.HitFireArea = effectStrength;
                    break;
            }
        }
 
Last edited:
That would be another cause as these fields are for baseweapon, also, the correction in the spelling still stands as it would cause a error otherwise and my refractor is a better way to perform the task with min variables!
 
Turns out the solution was that public class wasnt inside

namespace Server.Items
{
}
Just a quick tip, this is why it's a bad idea to only share parts of the code, instead of the whole code file. If the whole file had been shared, someone would have seen that immediately, but where only a snippet was shared, there was no way for anyone to know. :)
 

Active Shards

Donations

Total amount
$5.00
Goal
$500.00
Back