Exemple #1
0
        public Type GetSpecialLavaItem(Mobile from, Item type, Map map, Point3D pnt, object toHarvest)
        {
            Type newType = null;

            double skillBase  = from.Skills[SkillName.Fishing].Base;
            double skillValue = Math.Min(120.0, from.Skills[SkillName.Fishing].Value);

            //Same method as mutate entries
            for (int i = 0; i < m_LavaMutateTable.Length; ++i)
            {
                MutateEntry entry = m_LavaMutateTable[i];

                if (skillBase >= entry.m_ReqSkill)
                {
                    double chance = (skillValue - entry.m_MinSkill) / (entry.m_MaxSkill - entry.m_MinSkill);

                    if (map != null && map.Rules == MapRules.FeluccaRules)
                    {
                        chance *= 1.5;
                    }

                    if (chance > Utility.RandomDouble())
                    {
                        newType = entry.m_Types[Utility.Random(entry.m_Types.Length)];

                        if (newType == typeof(BaseWeapon))
                        {
                            BaseWeapon wep = Loot.RandomWeapon();

                            if (wep != null)
                            {
                                wep.AttachSocket(new SearingWeapon(wep));

                                from.AddToBackpack(wep);
                                from.SendMessage("You have pulled out an item : mysterious weapon");
                                return(typeof(BaseWeapon));
                            }
                        }
                    }
                }
            }

            return(newType);
        }