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); } }
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); } }
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(); } }
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); }
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()); } }
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); }
public SummerDragonfishPie() { Hue = FishInfo.GetFishHue(typeof(SummerDragonfish)); }
public HolyMackerelPie() { Hue = FishInfo.GetFishHue(typeof(HolyMackerel)); }
public LavaFishPie() { Hue = FishInfo.GetFishHue(typeof(LavaFish)); }
public YellowtailBarracuda() : base(Utility.RandomMinMax(17603, 17604)) { Hue = FishInfo.GetFishHue(GetType()); }
public GiantKoiPie() { Hue = FishInfo.GetFishHue(typeof(GiantKoi)); }
public StoneCrabPie() { Hue = FishInfo.GetFishHue(typeof(StoneCrab)); }
public FireFishSteak() { Hue = FishInfo.GetFishHue(typeof(FireFish)); }
public AutumnDragonfishPie() { Hue = FishInfo.GetFishHue(typeof(AutumnDragonfish)); }
public BullFishPie() { Hue = FishInfo.GetFishHue(typeof(BullFish)); }
public BullFish() : base(Utility.RandomMinMax(17605, 17606)) { Hue = FishInfo.GetFishHue(GetType()); }
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); }
public LavaFishSteak() { Hue = FishInfo.GetFishHue(typeof(LavaFish)); }
public AutumnDragonfish() : base(Utility.RandomMinMax(17637, 17638)) { Hue = FishInfo.GetFishHue(GetType()); }
public GiantKoiSteak() { Hue = FishInfo.GetFishHue(typeof(GiantKoi)); }
public UnicornFishPie() { Hue = FishInfo.GetFishHue(typeof(UnicornFish)); }
public BlueLobsterPie() { Hue = FishInfo.GetFishHue(typeof(BlueLobster)); }
public YellowtailBarracudaPie() { Hue = FishInfo.GetFishHue(typeof(YellowtailBarracuda)); }
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(); } }
public SpiderCrabPie() { Hue = FishInfo.GetFishHue(typeof(SpiderCrab)); }
public BullFishSteak() { Hue = FishInfo.GetFishHue(typeof(BullFish)); }
public FairySalmonPie() { Hue = FishInfo.GetFishHue(typeof(FairySalmon)); }
public FireFishPie() { Hue = FishInfo.GetFishHue(typeof(FireFish)); }
public CrystalFishPie() { Hue = FishInfo.GetFishHue(typeof(CrystalFish)); }
public UnicornFish() : base(Utility.RandomMinMax(17156, 17157)) { Hue = FishInfo.GetFishHue(GetType()); }