コード例 #1
0
        protected override void OnTarget(Mobile from, object targeted)
        {
            if (!(targeted is BaseAttackPiece))
                return;

            m_Blade = targeted as BaseAttackPiece;

            if (m_Blade is ShortBlade)
            {
                Dagger weapon = new Dagger();
                weapon.NewCrafting = true;
                weapon.QualityDamage = m_Hilt.Damage + m_Blade.Damage;
                weapon.QualitySpeed = m_Hilt.Speed + m_Blade.Speed;
                weapon.QualityAccuracy = m_Hilt.Attack + m_Blade.Attack;
                weapon.QualityDefense = m_Hilt.Defense + m_Blade.Defense;
                weapon.Resource = m_Blade.Resource;
                int quality = (int)(m_Blade.Durability * 0.6 + m_Hilt.Durability * 0.4);
                weapon.MaxHitPoints = quality; weapon.HitPoints = quality;
                weapon.Crafter = from;
                weapon.CraftersOriginalName = from.Name;
                quality = (int)(m_Blade.Quality * 0.6 + m_Hilt.Quality * 0.4);
                if (quality == 500)
                    weapon.Quality = WeaponQuality.Legendary;
                if (quality < 500)
                    weapon.Quality = WeaponQuality.Masterwork;
                if (quality < 450)
                    weapon.Quality = WeaponQuality.Illustrious;
                if (quality < 400)
                    weapon.Quality = WeaponQuality.Extraordinary;
                if (quality < 350)
                    weapon.Quality = WeaponQuality.Remarkable;
                if (quality < 300)
                    weapon.Quality = WeaponQuality.Exceptional;
                if (quality < 250)
                    weapon.Quality = WeaponQuality.Superior;
                if (quality < 200)
                    weapon.Quality = WeaponQuality.Regular;
                if (quality < 150)
                    weapon.Quality = WeaponQuality.Inferior;
                if (quality < 100)
                    weapon.Quality = WeaponQuality.Low;
                if (quality < 50)
                    weapon.Quality = WeaponQuality.Poor;
                weapon.BetaNerf = true;
                weapon.InvalidateProperties();
                from.AddToBackpack(weapon);
                weapon.AddItem(m_Blade);
                weapon.AddItem(m_Hilt);
            }
            if (m_Blade is CurvedBlade && ((PlayerMobile)from).Nation == Nation.Khemetar)
                from.Prompt = new SCrucHCurvedBladePrompt(from, m_Hilt, (CurvedBlade)m_Blade);
            if (m_Blade is MediumBlade)
            {
                if (((PlayerMobile)from).Nation == Nation.Vhalurian)
                    from.Prompt = new SCrucHMediumBladePrompt(from, m_Hilt, (MediumBlade)m_Blade);
                else
                {
                    Shortsword weapon = new Shortsword();
                    weapon.NewCrafting = true;
                    weapon.QualityDamage = m_Hilt.Damage + m_Blade.Damage;
                    weapon.QualitySpeed = m_Hilt.Speed + m_Blade.Speed;
                    weapon.QualityAccuracy = m_Hilt.Attack + m_Blade.Attack;
                    weapon.QualityDefense = m_Hilt.Defense + m_Blade.Defense;
                    weapon.Resource = m_Blade.Resource;
                    int quality = (int)(m_Blade.Durability * 0.65 + m_Hilt.Durability * 0.35);
                    weapon.MaxHitPoints = quality; weapon.HitPoints = quality;
                    weapon.Crafter = from;
                    weapon.CraftersOriginalName = from.Name;
                    quality = (int)(m_Blade.Quality * 0.65 + m_Hilt.Quality * 0.35);
                    if (quality == 500)
                        weapon.Quality = WeaponQuality.Legendary;
                    if (quality < 500)
                        weapon.Quality = WeaponQuality.Masterwork;
                    if (quality < 450)
                        weapon.Quality = WeaponQuality.Illustrious;
                    if (quality < 400)
                        weapon.Quality = WeaponQuality.Extraordinary;
                    if (quality < 350)
                        weapon.Quality = WeaponQuality.Remarkable;
                    if (quality < 300)
                        weapon.Quality = WeaponQuality.Exceptional;
                    if (quality < 250)
                        weapon.Quality = WeaponQuality.Superior;
                    if (quality < 200)
                        weapon.Quality = WeaponQuality.Regular;
                    if (quality < 150)
                        weapon.Quality = WeaponQuality.Inferior;
                    if (quality < 100)
                        weapon.Quality = WeaponQuality.Low;
                    if (quality < 50)
                        weapon.Quality = WeaponQuality.Poor;
                    weapon.BetaNerf = true;
                    weapon.InvalidateProperties();
                    from.AddToBackpack(weapon);
                    weapon.AddItem(m_Blade);
                    weapon.AddItem(m_Hilt);
                }
            }
            if (m_Blade is LongBlade)
            {
                if (((PlayerMobile)from).Nation == Nation.Tyrean)
                    from.Prompt = new SCrucHLongBladePrompt(from, m_Hilt, (LongBlade)m_Blade);
                else
                {
                    Longsword weapon = new Longsword();
                    weapon.NewCrafting = true;
                    weapon.QualityDamage = m_Hilt.Damage + m_Blade.Damage;
                    weapon.QualitySpeed = m_Hilt.Speed + m_Blade.Speed;
                    weapon.QualityAccuracy = m_Hilt.Attack + m_Blade.Attack;
                    weapon.QualityDefense = m_Hilt.Defense + m_Blade.Defense;
                    weapon.Resource = m_Blade.Resource;
                    int quality = (int)(m_Blade.Durability * 0.8 + m_Hilt.Durability * 0.2);
                    weapon.MaxHitPoints = quality; weapon.HitPoints = quality;
                    weapon.Crafter = from;
                    weapon.CraftersOriginalName = from.Name;
                    quality = (int)(m_Blade.Quality * 0.8 + m_Hilt.Quality * 0.2);
                    if (quality == 500)
                        weapon.Quality = WeaponQuality.Legendary;
                    if (quality < 500)
                        weapon.Quality = WeaponQuality.Masterwork;
                    if (quality < 450)
                        weapon.Quality = WeaponQuality.Illustrious;
                    if (quality < 400)
                        weapon.Quality = WeaponQuality.Extraordinary;
                    if (quality < 350)
                        weapon.Quality = WeaponQuality.Remarkable;
                    if (quality < 300)
                        weapon.Quality = WeaponQuality.Exceptional;
                    if (quality < 250)
                        weapon.Quality = WeaponQuality.Superior;
                    if (quality < 200)
                        weapon.Quality = WeaponQuality.Regular;
                    if (quality < 150)
                        weapon.Quality = WeaponQuality.Inferior;
                    if (quality < 100)
                        weapon.Quality = WeaponQuality.Low;
                    if (quality < 50)
                        weapon.Quality = WeaponQuality.Poor;
                    weapon.BetaNerf = true;
                    weapon.InvalidateProperties();
                    from.AddToBackpack(weapon);
                    weapon.AddItem(m_Blade);
                    weapon.AddItem(m_Hilt);
                }
            }
        }
コード例 #2
0
        public override void OnResponse(Mobile from, string text)
        {
            if (text == null)
                return;

            int index = 0;

            if (int.TryParse(text, out index))
            {
                if (index < 1 || index > 2)
                {
                    from.SendMessage("Invalid code.");
                    return;
                }

                if (index == 1)
                {
                    Longsword weapon = new Longsword();
                    weapon.NewCrafting = true;
                    weapon.QualityDamage = m_Hilt.Damage + m_Blade.Damage;
                    weapon.QualitySpeed = m_Hilt.Speed + m_Blade.Speed;
                    weapon.QualityAccuracy = m_Hilt.Attack + m_Blade.Attack;
                    weapon.QualityDefense = m_Hilt.Defense + m_Blade.Defense;
                    weapon.Resource = m_Blade.Resource;
                    int quality = (int)(m_Blade.Durability * 0.8 + m_Hilt.Durability * 0.2);
                    weapon.MaxHitPoints = quality; weapon.HitPoints = quality;
                    weapon.Crafter = from;
                    weapon.CraftersOriginalName = from.Name;
                    quality = (int)(m_Blade.Quality * 0.8 + m_Hilt.Quality * 0.2);
                    if (quality == 500)
                        weapon.Quality = WeaponQuality.Legendary;
                    if (quality < 500)
                        weapon.Quality = WeaponQuality.Masterwork;
                    if (quality < 450)
                        weapon.Quality = WeaponQuality.Illustrious;
                    if (quality < 400)
                        weapon.Quality = WeaponQuality.Extraordinary;
                    if (quality < 350)
                        weapon.Quality = WeaponQuality.Remarkable;
                    if (quality < 300)
                        weapon.Quality = WeaponQuality.Exceptional;
                    if (quality < 250)
                        weapon.Quality = WeaponQuality.Superior;
                    if (quality < 200)
                        weapon.Quality = WeaponQuality.Regular;
                    if (quality < 150)
                        weapon.Quality = WeaponQuality.Inferior;
                    if (quality < 100)
                        weapon.Quality = WeaponQuality.Low;
                    if (quality < 50)
                        weapon.Quality = WeaponQuality.Poor;
                    weapon.BetaNerf = true;
                    weapon.InvalidateProperties();
                    from.AddToBackpack(weapon);
                    weapon.AddItem(m_Blade);
                    weapon.AddItem(m_Hilt);
                }
                else if (index == 2)
                {
                    TyreanBroadsword weapon = new TyreanBroadsword();
                    weapon.NewCrafting = true;
                    weapon.QualityDamage = m_Hilt.Damage + m_Blade.Damage;
                    weapon.QualitySpeed = m_Hilt.Speed + m_Blade.Speed;
                    weapon.QualityAccuracy = m_Hilt.Attack + m_Blade.Attack;
                    weapon.QualityDefense = m_Hilt.Defense + m_Blade.Defense;
                    weapon.Resource = m_Blade.Resource;
                    int quality = (int)(m_Blade.Durability * 0.8 + m_Hilt.Durability * 0.2);
                    weapon.MaxHitPoints = quality; weapon.HitPoints = quality;
                    weapon.Crafter = from;
                    weapon.CraftersOriginalName = from.Name;
                    quality = (int)(m_Blade.Quality * 0.8 + m_Hilt.Quality * 0.2);
                    if (quality == 500)
                        weapon.Quality = WeaponQuality.Legendary;
                    if (quality < 500)
                        weapon.Quality = WeaponQuality.Masterwork;
                    if (quality < 450)
                        weapon.Quality = WeaponQuality.Illustrious;
                    if (quality < 400)
                        weapon.Quality = WeaponQuality.Extraordinary;
                    if (quality < 350)
                        weapon.Quality = WeaponQuality.Remarkable;
                    if (quality < 300)
                        weapon.Quality = WeaponQuality.Exceptional;
                    if (quality < 250)
                        weapon.Quality = WeaponQuality.Superior;
                    if (quality < 200)
                        weapon.Quality = WeaponQuality.Regular;
                    if (quality < 150)
                        weapon.Quality = WeaponQuality.Inferior;
                    if (quality < 100)
                        weapon.Quality = WeaponQuality.Low;
                    if (quality < 50)
                        weapon.Quality = WeaponQuality.Poor;
                    weapon.BetaNerf = true;
                    weapon.InvalidateProperties();
                    from.AddToBackpack(weapon);
                    weapon.AddItem(m_Blade);
                    weapon.AddItem(m_Hilt);
                }
            }
        }