Exemplo n.º 1
0
            protected override void OnTarget(Mobile from, object targetyouselect)
            {
                if (targetyouselect is Item)
                {
                    if (from.CheckTargetSkill(SkillName.ItemID, targetyouselect, 0, 100))
                    {
                        if (((Item)targetyouselect).IsChildOf(from.Backpack))
                        {
                            if (targetyouselect is BaseWeapon && ((BaseWeapon)targetyouselect).SkillBonuses.Skill_1_Value < 1)   //or <= if will let to 2 also
                            {
                                ((BaseWeapon)targetyouselect).SkillBonuses.SetValues(0, SkillName.Chivalry, 1);
                            }
                            else if (targetyouselect is BaseArmor && ((BaseArmor)targetyouselect).SkillBonuses.Skill_1_Value < 1)   //or <= if will let to 2 also
                            {
                                ((BaseArmor)targetyouselect).SkillBonuses.SetValues(0, SkillName.Chivalry, 1);
                            }
                            else if (targetyouselect is BaseJewel && ((BaseJewel)targetyouselect).SkillBonuses.Skill_1_Value < 1)   //or <= if will let to 2 also
                            {
                                ((BaseJewel)targetyouselect).SkillBonuses.SetValues(0, SkillName.Chivalry, 1);
                            }
                            else if (targetyouselect is BaseClothing && ((BaseClothing)targetyouselect).SkillBonuses.Skill_1_Value < 1)   //or <= if will let to 2 also
                            {
                                ((BaseClothing)targetyouselect).SkillBonuses.SetValues(0, SkillName.Chivalry, 1);
                            }
                            else if (targetyouselect is BaseWeapon && ((BaseWeapon)targetyouselect).SkillBonuses.Skill_2_Value < 1)   //or <= if will let to 2 also
                            {
                                ((BaseWeapon)targetyouselect).SkillBonuses.SetValues(1, SkillName.Chivalry, 1);
                            }
                            else if (targetyouselect is BaseArmor && ((BaseArmor)targetyouselect).SkillBonuses.Skill_2_Value < 1)   //or <= if will let to 2 also
                            {
                                ((BaseArmor)targetyouselect).SkillBonuses.SetValues(1, SkillName.Chivalry, 1);
                            }
                            else if (targetyouselect is BaseJewel && ((BaseJewel)targetyouselect).SkillBonuses.Skill_2_Value < 1)   //or <= if will let to 2 also
                            {
                                ((BaseJewel)targetyouselect).SkillBonuses.SetValues(1, SkillName.Chivalry, 1);
                            }
                            else if (targetyouselect is BaseClothing && ((BaseClothing)targetyouselect).SkillBonuses.Skill_2_Value < 1)   //or <= if will let to 2 also
                            {
                                ((BaseClothing)targetyouselect).SkillBonuses.SetValues(1, SkillName.Chivalry, 1);
                            }
                            else
                            {
                                from.SendMessage("That can not be enhanced.");
                                return; //continue might work also
                            }

                            from.SendMessage("You Successfully enhance the Item.");
                            from.PlaySound(Utility.Random(0x520, 0));
                            m_cOrb.Delete();
                        }
                        else
                        {
                            from.SendMessage("The target item must be in your backpack to use this.");
                            return; //continue might work also
                        }
                    }
                    else
                    {
                        from.SendMessage("You fail to enhance the item. Try again."); // You cannot augment that...
                    }
                }
                else if (targetyouselect is Mobile)
                {
                    ((Mobile)targetyouselect).OnSingleClick(from);
                }
                else
                {
                    from.SendMessage("You can only enhance Weapons, Armors, Jewlery, or Clothing.");
                }
            }