Example #1
0
            public static DNAItem Parse(string szitem)
            {
                if (string.IsNullOrEmpty(szitem))
                {
                    return(null);
                }

                string[] rawMod = szitem.Split(';');

                if (rawMod == null || rawMod.Length != 2)
                {
                    throw new FittingFormatNotRecognisedException(Messages.err_notRecognisedDNAFormat);
                }

                DNAItem item = new DNAItem();

                item.ID    = int.Parse(rawMod[0]);
                item.Units = short.Parse(rawMod[1]);
                return(item);
            }
Example #2
0
        protected override void OnTarget(Mobile from, object target)
        {
            if (target is BaseChampion)
            {
                from.SendMessage("You cannot extract DNA from a champion.");
            }
            else if (target is BaseVendor)
            {
                from.SendMessage("You cannot extract DNA from a vendor.");
            }
            else if (target is PlayerVendor)
            {
                from.SendMessage("You cannot extract DNA from a vendor.");
            }
            //else if ( target is DemonKnight || target is AbysmalHorror || target is DarknightCreeper || target is FleshRenderer || target is ShadowKnight || target is Impaler )
            //{
            //	from.SendMessage( "You cannot extract DNA from a doom boss." );
            //}
            else if (target is BaseCreature)
            {
                BaseCreature bc = (BaseCreature)target;
                if (!from.InRange(((Mobile)bc).Location, 1))
                {
                    from.SendMessage("You are to far away to do that.");
                }
                else if (bc.Blessed != false)
                {
                    from.SendMessage("They cannot be harmed.");
                }
                else if (bc.BodyValue == 400 || bc.BodyValue == 401)
                {
                    from.SendMessage("You cannot extract DNA from a human. ");
                }
                else if (bc.Controlled != true)
                {
                    int qua = bc.Str + bc.HitsMax + bc.PhysicalResistance + bc.DamageMin + bc.DamageMax + bc.VirtualArmor;

                    int chance = qua;

                    if (chance <= 500)
                    {
                        chance = 499;
                    }

                    if (Utility.Random(chance) < 500)
                    {
                        DNAItem dna = new DNAItem();
                        dna.DNAName           = bc.Name;
                        dna.DNAStr            = bc.Str;
                        dna.DNAHits           = bc.HitsMax;
                        dna.DNAPhysicalResist = bc.PhysicalResistance;
                        dna.DNADamageMin      = bc.DamageMin;
                        dna.DNADamageMax      = bc.DamageMax;
                        dna.DNAArmor          = bc.VirtualArmor;
                        dna.DNAType           = DNAType.Prowess;
                        dna.DNAAnatomy        = bc.Skills[SkillName.Anatomy].Base;
                        dna.DNAWrestling      = bc.Skills[SkillName.Wrestling].Base;
                        dna.DNATactics        = bc.Skills[SkillName.Tactics].Base;

                        if (qua <= 200)
                        {
                            dna.DNAQuality = DNAQuality.VeryLow;
                        }
                        else if (qua <= 350)
                        {
                            dna.DNAQuality = DNAQuality.Low;
                        }
                        else if (qua <= 450)
                        {
                            dna.DNAQuality = DNAQuality.BelowAverage;
                        }
                        else if (qua <= 600)
                        {
                            dna.DNAQuality = DNAQuality.Average;
                        }
                        else if (qua <= 900)
                        {
                            dna.DNAQuality = DNAQuality.AboveAverage;
                        }
                        else if (qua <= 2000)
                        {
                            dna.DNAQuality = DNAQuality.High;
                        }
                        else if (qua <= 4500 || qua >= 4500)
                        {
                            dna.DNAQuality = DNAQuality.VeryHigh;
                        }

                        from.AddToBackpack(dna);

                        from.PlaySound(0x240);

                        switch (Utility.Random(3))
                        {
                        case 0:
                            bc.Combatant   = from;
                            from.Combatant = bc;
                            from.SendMessage("You successfully sample the creatures dna, but anger the creature in the progress.");
                            bc.Emote("You have angered the creature");
                            break;

                        case 1:

                            from.SendMessage("You successfully sample the creatures dna.");
                            break;

                        case 2:
                            from.SendMessage("You successfully sample the creatures dna.");
                            break;
                        }

                        if (m_Vial.Amount >= 1)
                        {
                            m_Vial.Amount -= 1;

                            if (m_Vial.Amount == 0)
                            {
                                m_Vial.Delete();
                            }
                        }
                    }
                    else
                    {
                        switch (Utility.Random(2))
                        {
                        case 0:
                            from.SendMessage("You fail to sample this creatures dna.");
                            bc.Combatant   = from;
                            from.Combatant = bc;
                            bc.Emote("You have angered the creature");

                            if (Utility.Random(100) < 35)
                            {
                                if (m_Vial.Amount >= 1)
                                {
                                    m_Vial.Amount -= 1;

                                    if (m_Vial.Amount == 0)
                                    {
                                        m_Vial.Delete();
                                    }
                                }

                                from.PlaySound(Utility.RandomList(62, 63));
                                from.SendMessage("The vial has broken.");
                            }

                            break;

                        case 1:

                            from.SendMessage("You fail to sample this creatures dna.");
                            bc.Combatant   = from;
                            from.Combatant = bc;
                            bc.Emote("You have angered the creature");

                            if (Utility.Random(100) < 35)
                            {
                                if (m_Vial.Amount >= 1)
                                {
                                    m_Vial.Amount -= 1;

                                    if (m_Vial.Amount == 0)
                                    {
                                        m_Vial.Delete();
                                    }
                                }

                                from.PlaySound(Utility.RandomList(62, 63));
                                from.SendMessage("The vial has broken.");
                            }

                            break;
                        }
                    }
                }
                else
                {
                    from.SendMessage("You cannot sample dna from a tamed creature.");
                }
            }
        }
Example #3
0
        protected override void OnTarget(Mobile from, object target)
        {
            if (target is BaseChampion)
            {
                from.SendMessage("You cannot extract DNA from a champion.");
            }
            else if (target is BaseVendor)
            {
                from.SendMessage("You cannot extract DNA from a vendor.");
            }
            else if (target is PlayerVendor)
            {
                from.SendMessage("You cannot extract DNA from a vendor.");
            }
            //else if ( target is DemonKnight || target is AbysmalHorror || target is DarknightCreeper || target is FleshRenderer || target is ShadowKnight || target is Impaler )
            //{
            //from.SendMessage( "You cannot extract DNA from a doom boss." );
            //}
            else if (target is BaseCreature)
            {
                BaseCreature bc = (BaseCreature)target;
                if (!from.InRange(((Mobile)bc).Location, 1))
                {
                    from.SendMessage("You are to far away to do that.");
                }
                else if (bc.Blessed != false)
                {
                    from.SendMessage("They cannot be harmed.");
                }
                else if (bc.BodyValue == 400 || bc.BodyValue == 401)
                {
                    from.SendMessage("You cannot extract DNA from a human. ");
                }
                else if (bc.Controlled != true)
                {
                    DNAItem dna = new DNAItem();
                    dna.DNAName      = bc.Name;
                    dna.DNAType      = DNAType.Mimic;
                    dna.DNABodyValue = bc.BodyValue;
                    dna.DNASoundID   = bc.BaseSoundID;

                    if (bc is BaseMount)
                    {
                        BaseMount bm = (BaseMount)bc;
                        dna.MountID = bm.ItemID;
                    }

                    if (Utility.Random(100) < 15)
                    {
                        switch (Utility.Random(3))
                        {
                        case 0:
                            dna.DNABluntAttack = true;
                            break;

                        case 1:
                            dna.DNAHealAttack = true;
                            break;

                        case 2:
                            dna.DNAPoisonAttack = true;
                            break;
                        }
                    }

                    if (Utility.Random(100) < 15)
                    {
                        switch (Utility.Random(5))
                        {
                        case 0:
                            dna.DNATrialByFire = true;
                            break;

                        case 1:
                            dna.DNAIceBlast = true;
                            break;

                        case 2:
                            dna.DNACometAttack = true;
                            break;

                        case 3:
                            dna.DNACallOfNature = true;
                            break;

                        case 4:
                            dna.DNAAcidRain = true;
                            break;
                        }
                    }

                    from.AddToBackpack(dna);

                    from.PlaySound(0x240);

                    switch (Utility.Random(3))
                    {
                    case 0:
                        bc.Combatant   = from;
                        from.Combatant = bc;
                        from.SendMessage("You successfully sample the creatures dna, but anger the creature in the progress.");
                        bc.Emote("You have angered the creature");
                        break;

                    case 1:
                        bc.Combatant   = from;
                        from.Combatant = bc;
                        from.SendMessage("You successfully sample the creatures dna, but anger the creature in the progress.");
                        bc.Emote("You have angered the creature");
                        break;

                    case 2:
                        from.SendMessage("You successfully sample the creatures dna.");
                        break;
                    }

                    if (m_Vial.Amount >= 1)
                    {
                        m_Vial.Amount -= 1;

                        if (m_Vial.Amount == 0)
                        {
                            m_Vial.Delete();
                        }
                    }
                }
                else
                {
                    switch (Utility.Random(2))
                    {
                    case 0:
                        from.SendMessage("You fail to sample this creatures dna.");
                        bc.Combatant   = from;
                        from.Combatant = bc;
                        bc.Emote("You have angered the creature");

                        if (Utility.Random(100) < 35)
                        {
                            if (m_Vial.Amount >= 1)
                            {
                                m_Vial.Amount -= 1;

                                if (m_Vial.Amount == 0)
                                {
                                    m_Vial.Delete();
                                }
                            }

                            from.PlaySound(Utility.RandomList(62, 63));
                            from.SendMessage("The vial has broken.");
                        }

                        break;

                    case 1:
                        from.SendMessage("You fail to sample this creatures dna.");
                        bc.Combatant   = from;
                        from.Combatant = bc;
                        bc.Emote("You have angered the creature");

                        if (Utility.Random(100) < 35)
                        {
                            if (m_Vial.Amount >= 1)
                            {
                                m_Vial.Amount -= 1;

                                if (m_Vial.Amount == 0)
                                {
                                    m_Vial.Delete();
                                }
                            }

                            from.PlaySound(Utility.RandomList(62, 63));
                            from.SendMessage("The vial has broken.");
                        }

                        break;
                    }
                }
            }
            else
            {
                from.SendMessage("You cannot sample dna from a tamed creature.");
            }
        }
Example #4
0
        public EvilGenetecist() : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            SpeechHue = Utility.RandomDyedHue();
            Title     = "the evil genetecist";
            Hue       = Utility.RandomSkinHue();

            if (this.Female = Utility.RandomBool())
            {
                Body = 0x191;
                Name = NameList.RandomName("female");
            }
            else
            {
                Body = 0x190;
                Name = NameList.RandomName("male");
            }

            SetStr(200, 275);
            SetDex(115, 125);
            SetInt(200, 275);

            SetHits(1900, 2100);
            SetMana(1000);

            SetDamage(10, 23);

            SetSkill(SkillName.Fencing, 66.0, 97.5);
            SetSkill(SkillName.Macing, 65.0, 87.5);
            SetSkill(SkillName.MagicResist, 25.0, 47.5);
            SetSkill(SkillName.Swords, 65.0, 87.5);
            SetSkill(SkillName.Tactics, 65.0, 87.5);
            SetSkill(SkillName.Wrestling, 15.0, 37.5);
            SetSkill(SkillName.EvalInt, 55.0, 67.5);
            SetSkill(SkillName.Magery, 90.0, 105.5);

            Fame  = 5000;
            Karma = -5000;

            AddItem(new Boots());

            int hue = Utility.RandomMinMax(1410, 1450);                //Random Zog Green

            Item robe = new Robe();

            robe.Hue = hue;
            AddItem(robe);

            Item chest = new LeatherChest();

            chest.Hue = hue;
            AddItem(chest);

            Item gloves = new LeatherGloves();

            gloves.Hue = hue;
            AddItem(gloves);

            Item gorget = new LeatherGorget();

            gorget.Hue = hue;
            AddItem(gorget);

            Item legs = new LeatherLegs();

            legs.Hue = hue;
            AddItem(legs);

            Item arms = new LeatherArms();

            arms.Hue = hue;
            AddItem(arms);

            Item hair = new Item(Utility.RandomList(0x203B, 0x2049, 0x2048, 0x204A));

            hair.Hue     = Utility.RandomNondyedHue();
            hair.Layer   = Layer.Hair;
            hair.Movable = false;
            AddItem(hair);

            PackItem(new Organics(Utility.RandomMinMax(250, 400)));

            if (Utility.Random(100) < 35)
            {
                switch (Utility.Random(2))
                {
                case 0: PackItem(new EmptyDNAVial()); break;

                case 1: PackItem(new EmptyDNAVialSet()); break;
                }
            }

            if (Utility.Random(500) < 3)
            {
                DNAItem dna = new DNAItem();

                switch (Utility.Random(4))
                {
                case 0:
                    dna.DNAName           = "a dark father";
                    dna.DNAType           = DNAType.Prowess;
                    dna.DNAQuality        = DNAQuality.VeryHigh;
                    dna.DNAStr            = 500;
                    dna.DNAHits           = 30000;
                    dna.DNADamageMin      = 17;
                    dna.DNADamageMax      = 21;
                    dna.DNAArmor          = 64;
                    dna.DNAPhysicalResist = 30;
                    dna.DNATactics        = 100;
                    dna.DNAWrestling      = 100;
                    PackItem(dna);
                    break;

                case 1:
                    dna.DNAName       = "a fox guardian";
                    dna.DNAType       = DNAType.Environment;
                    dna.DNAQuality    = DNAQuality.VeryHigh;
                    dna.DNADex        = 275;
                    dna.DNAStam       = 300;
                    dna.DNAColdResist = 30;
                    dna.DNAFireResist = 60;
                    dna.DNAPoisoning  = 100;
                    PackItem(dna);
                    break;

                case 2:
                    dna.DNAName         = "Mondain The Wizard";
                    dna.DNAType         = DNAType.Mental;
                    dna.DNAQuality      = DNAQuality.VeryHigh;
                    dna.DNAInt          = 415;
                    dna.DNAMana         = 1000;
                    dna.DNAEnergyResist = 70;
                    dna.DNAPoisonResist = 70;
                    dna.DNAMagery       = 100;
                    dna.DNAEvalInt      = 100;
                    PackItem(dna);
                    break;

                case 3:
                    dna.DNAName        = "a hell chicken";
                    dna.DNAType        = DNAType.Mimic;
                    dna.DNABodyValue   = 208;
                    dna.DNASoundID     = 110;
                    dna.DNAHealAttack  = true;
                    dna.DNATrialByFire = true;
                    PackItem(dna);
                    break;
                }
            }
        }
Example #5
0
        protected override void OnTarget(Mobile from, object target)
        {
            if (target is BaseChampion)
            {
                from.SendMessage("You cannot extract DNA from a champion.");
            }
            else if (target is BaseVendor)
            {
                from.SendMessage("You cannot extract DNA from a vendor.");
            }
            else if (target is PlayerVendor)
            {
                from.SendMessage("You cannot extract DNA from a vendor.");
            }
            else if (target is DemonKnight || target is AbysmalHorror || target is DarknightCreeper || target is FleshRenderer || target is ShadowKnight || target is Impaler)
            {
                from.SendMessage("You cannot extract DNA from a doom boss.");
            }
            else if (target is BaseCreature)
            {
                BaseCreature bc = (BaseCreature)target;
                if (!from.InRange(((Mobile)bc).Location, 1))
                {
                    from.SendMessage("You are to far away to do that.");
                }
                else if (bc.Blessed != false)
                {
                    from.SendMessage("They cannot be harmed.");
                    //}
                    //else if ( bc.BodyValue == 400 || bc.BodyValue == 401 )
                    //{
                    //from.SendMessage( "You cannot extract DNA from a human. " );
                }
                else if (bc.Controlled != true)
                {
                    int qua = bc.Int + bc.ManaMax + bc.EnergyResistance + bc.PoisonResistance;

                    int chance = qua;

                    if (chance <= 200)
                    {
                        chance = 199;
                    }

                    if (Utility.Random(chance) < 200)
                    {
                        DNAItem dna = new DNAItem();
                        dna.DNAName         = bc.Name;
                        dna.DNAInt          = bc.Int;
                        dna.DNAMana         = bc.ManaMax;
                        dna.DNAEnergyResist = bc.EnergyResistance;
                        dna.DNAPoisonResist = bc.PoisonResistance;
                        dna.DNAType         = DNAType.Mental;
                        dna.DNAMagery       = bc.Skills[SkillName.Magery].Base;
                        dna.DNAEvalInt      = bc.Skills[SkillName.EvalInt].Base;
                        dna.DNAMeditation   = bc.Skills[SkillName.Meditation].Base;

                        if (qua <= 100)
                        {
                            dna.DNAQuality = DNAQuality.VeryLow;
                        }
                        else if (qua <= 150)
                        {
                            dna.DNAQuality = DNAQuality.Low;
                        }
                        else if (qua <= 200)
                        {
                            dna.DNAQuality = DNAQuality.BelowAverage;
                        }
                        else if (qua <= 300)
                        {
                            dna.DNAQuality = DNAQuality.Average;
                        }
                        else if (qua <= 600)
                        {
                            dna.DNAQuality = DNAQuality.AboveAverage;
                        }
                        else if (qua <= 1500)
                        {
                            dna.DNAQuality = DNAQuality.High;
                        }
                        else if (qua <= 3500 || qua >= 3500)
                        {
                            dna.DNAQuality = DNAQuality.VeryHigh;
                        }

                        from.AddToBackpack(dna);

                        from.PlaySound(0x240);

                        switch (Utility.Random(3))
                        {
                        case 0:
                            bc.Combatant   = from;
                            from.Combatant = bc;
                            from.SendMessage("You successfully sample the creatures dna, but anger the creature in the progress.");
                            bc.Emote("You have angered the creature");
                            break;

                        case 1:
                            from.SendMessage("You successfully sample the creatures dna, but the tramua of the sample was to great for the creature.");
                            bc.Kill();

                            if (bc.Corpse != null)
                            {
                                bc.Corpse.Delete();
                            }

                            break;

                        case 2:
                            from.SendMessage("You successfully sample the creatures dna.");
                            break;
                        }

                        if (m_Vial.Amount >= 1)
                        {
                            m_Vial.Amount -= 1;

                            if (m_Vial.Amount == 0)
                            {
                                m_Vial.Delete();
                            }
                        }
                    }
                    else
                    {
                        switch (Utility.Random(2))
                        {
                        case 0:
                            from.SendMessage("You fail to sample this creatures dna.");
                            bc.Combatant   = from;
                            from.Combatant = bc;
                            bc.Emote("You have angered the creature");

                            if (Utility.Random(100) < 35)
                            {
                                if (m_Vial.Amount >= 1)
                                {
                                    m_Vial.Amount -= 1;

                                    if (m_Vial.Amount == 0)
                                    {
                                        m_Vial.Delete();
                                    }
                                }

                                from.PlaySound(Utility.RandomList(62, 63));
                                from.SendMessage("The vial has broken.");
                            }

                            break;

                        case 1:
                            from.SendMessage("You fail to sample this creatures dna.");
                            from.SendMessage("The creature has died due to the tramua from the dna sample.");
                            bc.Kill();

                            if (bc.Corpse != null)
                            {
                                bc.Corpse.Delete();
                            }

                            if (Utility.Random(100) < 35)
                            {
                                if (m_Vial.Amount >= 1)
                                {
                                    m_Vial.Amount -= 1;

                                    if (m_Vial.Amount == 0)
                                    {
                                        m_Vial.Delete();
                                    }
                                }

                                from.PlaySound(Utility.RandomList(62, 63));
                                from.SendMessage("The vial has broken.");
                            }

                            break;
                        }
                    }
                }
                else
                {
                    from.SendMessage("You cannot sample dna from a tamed creature.");
                }
            }
        }