Exemplo n.º 1
0
        public override void AddNameProperty(ObjectPropertyList list)
        {
            object label = FishInfo.GetFishLabel(m_Index);

            if (m_Enhanced)
            {
                //~1_token~ ~2_token~ bait
                if (label is int)
                {
                    list.Add(1116464, "#{0}\t#{1}", 1116470, (int)label);
                }
                else if (label is string)
                {
                    list.Add(1116464, "#{0}\t{1}", 1116470, (string)label);
                }
            }
            else if (label is int)
            {
                list.Add(1116465, string.Format("#{0}", (int)label)); //~1_token~ bait
            }
            else if (label is string)
            {
                list.Add(1116465, (string)label);
            }
        }
Exemplo n.º 2
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)2); // version

            writer.Write(m_OriginalHue);

            writer.Write(FishInfo.GetIndexFromType(m_BaitType));
            writer.Write((int)m_HookType);
            writer.Write(m_HookUses);
            writer.Write(m_BaitUses);
            writer.Write(m_EnhancedBait);

            SaveFlag flags = SaveFlag.None;

            SetSaveFlag(ref flags, SaveFlag.xAttributes, !m_AosAttributes.IsEmpty);
            SetSaveFlag(ref flags, SaveFlag.SkillBonuses, !m_AosSkillBonuses.IsEmpty);

            writer.Write((int)flags);

            if (GetSaveFlag(flags, SaveFlag.xAttributes))
            {
                m_AosAttributes.Serialize(writer);
            }

            if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
            {
                m_AosSkillBonuses.Serialize(writer);
            }
        }
Exemplo n.º 3
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            int index = reader.ReadInt();

            m_BaitType = FishInfo.GetTypeFromIndex(index);

            m_Bobs         = reader.ReadInt();
            m_InUse        = reader.ReadBool();
            m_Owner        = reader.ReadMobile();
            m_BaitUses     = reader.ReadInt();
            m_EnhancedBait = reader.ReadBool();

            if (m_BaitType != null && m_BaitUses <= 0)
            {
                BaitType = null;
            }

            if (m_InUse)
            {
                StartTimer();
            }
        }
Exemplo n.º 4
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write(0);

            int index = FishInfo.GetIndexFromType(m_BaitType);

            writer.Write(index);
            writer.Write(m_Bobs);
            writer.Write(m_InUse);
            writer.Write(m_Owner);
            writer.Write(m_BaitUses);
            writer.Write(m_EnhancedBait);
        }
Exemplo n.º 5
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            if (m_BaitType != null)
            {
                object label = FishInfo.GetFishLabel(m_BaitType);
                if (label is int)
                {
                    list.Add(1116468, String.Format("#{0}", (int)label)); //baited to attract: ~1_val~
                }
                else if (label is string)
                {
                    list.Add(1116468, (string)label);
                }

                list.Add(1116466, m_BaitUses.ToString());
            }
        }
Exemplo n.º 6
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            m_UsesRemaining = reader.ReadInt();
            m_Index         = reader.ReadInt();
            m_Enhanced      = reader.ReadBool();

            if (m_Index < 0)
            {
                m_Index = 0;
            }
            if (m_Index >= FishInfo.FishInfos.Count)
            {
                m_Index = FishInfo.FishInfos.Count - 1;
            }

            m_BaitType = FishInfo.FishInfos[m_Index].Type;
            //Hue = FishInfo.FishInfos[m_Index].Hue;
            m_Label = FishInfo.GetFishLabel(m_Index);
        }
Exemplo n.º 7
0
 public SummerDragonfishPie()
 {
     Hue = FishInfo.GetFishHue(typeof(SummerDragonfish));
 }
Exemplo n.º 8
0
 public HolyMackerelPie()
 {
     Hue = FishInfo.GetFishHue(typeof(HolyMackerel));
 }
Exemplo n.º 9
0
 public LavaFishPie()
 {
     Hue = FishInfo.GetFishHue(typeof(LavaFish));
 }
Exemplo n.º 10
0
 public YellowtailBarracuda()
     : base(Utility.RandomMinMax(17603, 17604))
 {
     Hue = FishInfo.GetFishHue(GetType());
 }
Exemplo n.º 11
0
 public GiantKoiPie()
 {
     Hue = FishInfo.GetFishHue(typeof(GiantKoi));
 }
Exemplo n.º 12
0
 public StoneCrabPie()
 {
     Hue = FishInfo.GetFishHue(typeof(StoneCrab));
 }
Exemplo n.º 13
0
 public FireFishSteak()
 {
     Hue = FishInfo.GetFishHue(typeof(FireFish));
 }
Exemplo n.º 14
0
 public AutumnDragonfishPie()
 {
     Hue = FishInfo.GetFishHue(typeof(AutumnDragonfish));
 }
Exemplo n.º 15
0
 public BullFishPie()
 {
     Hue = FishInfo.GetFishHue(typeof(BullFish));
 }
Exemplo n.º 16
0
 public BullFish()
     : base(Utility.RandomMinMax(17605, 17606))
 {
     Hue = FishInfo.GetFishHue(GetType());
 }
Exemplo n.º 17
0
        public static Type GetSpecialItem(Mobile from, Item harvestItem, Point3D pnt, double bump, bool rareOnly)
        {
            InvalidateLocations();

            Map     map     = from.Map;
            Point3D fromLoc = from.Location;

            Region reg = from.Region;

            if (reg.Parent != null)
            {
                reg = reg.Parent;
            }

            double skill   = from.Skills[SkillName.Fishing].Value;
            bool   fishing = harvestItem is FishingPole;

            Type bait     = null;
            Type item     = null;
            bool enhanced = false;

            if (harvestItem is FishingPole)
            {
                bait     = ((FishingPole)harvestItem).BaitType;
                enhanced = ((FishingPole)harvestItem).EnhancedBait;
            }
            else if (harvestItem is LobsterTrap)
            {
                bait     = ((LobsterTrap)harvestItem).BaitType;
                enhanced = ((LobsterTrap)harvestItem).EnhancedBait;
            }

            //insertion of baited type first to increase chances of fishing it up!
            List <FishInfo> infos = new List <FishInfo>(m_FishInfos);

            if (bait != null)
            {
                for (int i = 0; i < infos.Count; i++)
                {
                    FishInfo info = infos[i];
                    if (info.Type == bait)
                    {
                        infos.Remove(info);
                        infos.Insert(0, info);
                    }
                }
            }

            for (int i = 0; i < infos.Count; i++)
            {
                FishInfo info = infos[i];

                double baitStr = info.GetBaitStrength(bait, from, enhanced);

                if ((info.RequiresDeepWater && !IsDeepWater(pnt, map, reg)) || skill < info.MinSkill)
                {
                    continue;
                }

                if (fishing && info.Type.IsSubclassOf(typeof(BaseCrabAndLobster)))
                {
                    continue;
                }

                if (!fishing && !info.Type.IsSubclassOf(typeof(BaseCrabAndLobster)))
                {
                    continue;
                }

                if (info.Location is string)
                {
                    string loc = (string)info.Location;

                    if (loc.ToLower() == "cannotfishup")
                    {
                        continue;
                    }

                    if (loc.ToLower() == "t2a" && Server.Spells.SpellHelper.IsAnyT2A(map, fromLoc) && info.Roll(from, baitStr, bump))
                    {
                        item = info.Type;
                    }

                    if (loc.ToLower() == "trammelandfelucca" && (map == Map.Trammel || map == Map.Felucca) && !Server.Spells.SpellHelper.IsAnyT2A(map, fromLoc) && info.Roll(from, baitStr, bump))
                    {
                        item = info.Type;
                    }

                    if (loc.ToLower() == "fire island" && (map == Map.Felucca || map == Map.Trammel) && (from.X > 4559 && from.X < 4636 && from.Y > 3548 && from.Y < 3627 ||
                                                                                                         from.X > 4465 && from.X < 4493 && from.Y > 4479 && from.Y < 3746) && info.Roll(from, baitStr, bump))
                    {
                        item = info.Type;
                    }

                    if (from.Region != null && from.Region.IsPartOf(loc) && info.Roll(from, baitStr, bump))
                    {
                        item = info.Type;
                    }
                }
                else if (info.Location is Map)
                {
                    Map locMap = (Map)info.Location;

                    if (map == locMap && info.Roll(from, baitStr, bump))
                    {
                        item = info.Type;
                    }
                }
            }

            ColUtility.Free(infos);

            if (!rareOnly && item == null && from is PlayerMobile)
            {
                double chance = skill / 121.5;

                bool dungeon = IsDungeon(pnt, map, reg);
                bool shore   = IsShore(pnt, map, reg);
                bool deep    = IsDeepWater(pnt, map, reg);

                if (fishing && chance >= Utility.RandomDouble())
                {
                    if (dungeon && skill >= 106.0)
                    {
                        item = BaseHighseasFish.DungeonFish[Utility.Random(BaseHighseasFish.DungeonFish.Length)];
                    }
                    else if (deep && skill >= 80.0)
                    {
                        item = BaseHighseasFish.DeepWaterFish[Utility.Random(BaseHighseasFish.DeepWaterFish.Length)];
                    }
                    else if (shore && skill >= 50.0)
                    {
                        item = BaseHighseasFish.ShoreFish[Utility.Random(BaseHighseasFish.ShoreFish.Length)];
                    }
                }
                else if (skill >= 50.0 && !fishing && chance >= Utility.RandomDouble())
                {
                    item = BaseHighseasFish.LobstersAndCrabs[Utility.Random(BaseHighseasFish.LobstersAndCrabs.Length)];
                }
            }

            return(item);
        }
Exemplo n.º 18
0
 public LavaFishSteak()
 {
     Hue = FishInfo.GetFishHue(typeof(LavaFish));
 }
Exemplo n.º 19
0
 public AutumnDragonfish()
     : base(Utility.RandomMinMax(17637, 17638))
 {
     Hue = FishInfo.GetFishHue(GetType());
 }
Exemplo n.º 20
0
 public GiantKoiSteak()
 {
     Hue = FishInfo.GetFishHue(typeof(GiantKoi));
 }
Exemplo n.º 21
0
 public UnicornFishPie()
 {
     Hue = FishInfo.GetFishHue(typeof(UnicornFish));
 }
Exemplo n.º 22
0
 public BlueLobsterPie()
 {
     Hue = FishInfo.GetFishHue(typeof(BlueLobster));
 }
Exemplo n.º 23
0
 public YellowtailBarracudaPie()
 {
     Hue = FishInfo.GetFishHue(typeof(YellowtailBarracuda));
 }
Exemplo n.º 24
0
        public void OnTick()
        {
            m_Bobs++;

            PublicOverheadMessage(MessageType.Regular, 0, 1116364); //**bob**

            if (m_Owner != null && (!SpecialFishingNet.ValidateDeepWater(Map, X, Y) || m_Owner.Skills[SkillName.Fishing].Base >= 75.0))
            {
                m_Owner.CheckSkill(SkillName.Fishing, 0, m_Owner.Skills[SkillName.Fishing].Cap);
            }

            if (!m_InUse)
            {
                EndTimer(null);
                return;
            }

            if (m_Bobs * 5 > Utility.Random(100))
            {
                OnTrapLost();
                return;
            }

            bool   rare = true;
            double bump = m_Bobs / 100.0;

            Type type = FishInfo.GetSpecialItem(m_Owner, this, Location, bump, this is LavaLobsterTrap);

            if (type != null)
            {
                Item item = Loot.Construct(type);
                DropItem(item);

                if (item is RareCrabAndLobster && rare)
                {
                    RareCrabAndLobster fish = (RareCrabAndLobster)item;

                    fish.Fisher     = m_Owner;
                    fish.DateCaught = DateTime.UtcNow;
                    fish.Weight     = Utility.RandomMinMax(10, 200);
                    fish.Stackable  = false;
                }

                if (m_Owner != null)
                {
                    m_Owner.SendMessage("It looks like you caught something!");
                }

                CheckBait();
            }
            else if (Utility.RandomBool())
            {
                Item item;

                if (Utility.RandomBool())
                {
                    item = new Crab();
                }
                else
                {
                    item = new Lobster();
                }

                if (m_Owner != null)
                {
                    m_Owner.SendMessage("It looks like you caught something!");
                }

                DropItem(item);
                CheckBait();
            }
        }
Exemplo n.º 25
0
 public SpiderCrabPie()
 {
     Hue = FishInfo.GetFishHue(typeof(SpiderCrab));
 }
Exemplo n.º 26
0
 public BullFishSteak()
 {
     Hue = FishInfo.GetFishHue(typeof(BullFish));
 }
Exemplo n.º 27
0
 public FairySalmonPie()
 {
     Hue = FishInfo.GetFishHue(typeof(FairySalmon));
 }
Exemplo n.º 28
0
 public FireFishPie()
 {
     Hue = FishInfo.GetFishHue(typeof(FireFish));
 }
Exemplo n.º 29
0
 public CrystalFishPie()
 {
     Hue = FishInfo.GetFishHue(typeof(CrystalFish));
 }
Exemplo n.º 30
0
 public UnicornFish()
     : base(Utility.RandomMinMax(17156, 17157))
 {
     Hue = FishInfo.GetFishHue(GetType());
 }