public override Type MutateType(Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { bool deepWater = SpecialFishingNet.FullValidation(map, loc.X, loc.Y); double skillBase = from.Skills[SkillName.Fishing].Base; double skillValue = from.Skills[SkillName.Fishing].Value; for (int i = 0; i < m_MutateTable.Length; ++i) { MutateEntry entry = m_MutateTable[i]; if (!deepWater && entry.m_DeepWater) { continue; } if (skillBase >= entry.m_ReqSkill) { double chance = (skillValue - entry.m_MinSkill) / (entry.m_MaxSkill - entry.m_MinSkill); if (chance > Utility.RandomDouble()) { return(entry.m_Types[Utility.Random(entry.m_Types.Length)]); } } } return(type); }
public override Type MutateType(Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { bool deepWater = SpecialFishingNet.FullValidation(map, loc.X, loc.Y); double skillBase = from.Skills[SkillName.Fishing].Base; double skillValue = from.Skills[SkillName.Fishing].Value; for (int i = 0; i < m_MutateTable.Length; ++i) { // Determine the chance to fish up the Mutate Table items, and... // pick the *first* Type that passes the random chance test MutateEntry entry = m_MutateTable[i]; if (!deepWater && entry.m_DeepWater) { continue; } if (skillBase >= entry.m_ReqSkill) { double chance = (skillValue - entry.m_MinSkill) / (entry.m_MaxSkill - entry.m_MinSkill); if (chance > Utility.RandomDouble()) { return(entry.m_Types[Utility.Random(entry.m_Types.Length)]); } // This checks Net/BF/Map/MIB chances first, before doing easy items } } return(type); }
public Type Ditiles(Type type, Mobile from, bool tile) { double skillBase = from.Skills[SkillName.TasteID].Base; double skillValue = from.Skills[SkillName.TasteID].Value; for (int i = 0; i < m_MutateTable.Length; ++i) { MutateEntry entry = m_MutateTable[i]; if (tile && !entry.m_dirt) { continue; } if (skillBase >= entry.m_ReqSkill) { double chance = (skillValue - entry.m_MinSkill) / (entry.m_MaxSkill - entry.m_MinSkill); if (chance > Utility.RandomDouble()) { return(entry.m_Types[Utility.Random(entry.m_Types.Length)]); } } } return(type); }
public override Type MutateType(Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { bool deepWater = SpecialFishingNet.FullValidation(map, loc.X, loc.Y); if (deepWater && CheckDock(from.Location, from.Map)) { deepWater = false; } double skillBase = from.Skills[SkillName.Fishing].Base; double skillValue = from.Skills[SkillName.Fishing].Value; BaseBoat ownerBoat = BaseBoat.FindBoatAt(from.Location, from.Map); double chanceModifier = 1; for (int i = 0; i < m_MutateTable.Length; ++i) { MutateEntry entry = m_MutateTable[i]; if (!deepWater && entry.m_DeepWater) { continue; } if (skillBase >= entry.m_ReqSkill) { double chance = (skillValue - entry.m_MinSkill) / (entry.m_MaxSkill - entry.m_MinSkill); chance *= chanceModifier; if (from.AccessLevel >= AccessLevel.GameMaster) { string typename = "null"; if (entry.m_Types[0] != null) { typename = entry.m_Types[0].Name.ToLower(); } from.SendMessage(0x22, String.Format("{0} : {1:P2} chance", typename, chance)); } if (chance > Utility.RandomDouble()) { return(entry.m_Types[Utility.Random(entry.m_Types.Length)]); } } } return(type); }
public override Type MutateType(Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { if (FishInfo.IsRareFish(type)) { return(type); } bool deepWater = IsDeepWater(loc, map); bool junkproof = HasTypeHook(tool, HookType.JunkProof); double skillBase = from.Skills[SkillName.Fishing].Base; double skillValue = from.Skills[SkillName.Fishing].Value; MutateEntry[] table = Siege.SiegeShard ? m_SiegeMutateTable : m_MutateTable; for (int i = 0; i < table.Length; ++i) { MutateEntry entry = m_MutateTable[i]; // RedHerring / MudPuppy if (i == 6 && (from.Region == null || !from.Region.IsPartOf("Underworld"))) { continue; } if (junkproof && i == 5 && 0.80 >= Utility.RandomDouble()) { continue; } if (!deepWater && entry.m_DeepWater) { continue; } if (skillBase >= entry.m_ReqSkill) { double chance = (skillValue - entry.m_MinSkill) / (entry.m_MaxSkill - entry.m_MinSkill); if (chance > Utility.RandomDouble()) { return(entry.m_Types[Utility.Random(entry.m_Types.Length)]); } } } return(type); }
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.SearingWeapon = true; wep.Attributes.Brittle = 1; wep.MaxHitPoints = 200; wep.HitPoints = 200; BaseRunicTool.ApplyAttributesTo(wep, Utility.Random(1, 4), 45, 100); from.AddToBackpack(wep); from.SendMessage("You have pulled out an item : a searing weapon!"); return(typeof(BaseWeapon)); } } } } } return(newType); }
public override Type MutateType(Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { #region SA Quests PlayerMobile pm = from as PlayerMobile; if (pm != null && pm.Region.IsPartOf("Underworld")) { if (QuestHelper.HasQuest <ScrapingTheBottomQuest>(pm) && 5 > Utility.Random(100)) { return(typeof(MudPuppy)); } if (QuestHelper.HasQuest <SomethingFishyQuest>(pm) && 5 > Utility.Random(100)) { return(typeof(RedHerring)); } } #endregion bool deepWater = SpecialFishingNet.FullValidation(map, loc.X, loc.Y); double skillBase = from.Skills[SkillName.Fishing].Base; double skillValue = from.Skills[SkillName.Fishing].Value; for (int i = 0; i < m_MutateTable.Length; ++i) { MutateEntry entry = m_MutateTable[i]; if (!deepWater && entry.m_DeepWater) { continue; } if (skillBase >= entry.m_ReqSkill) { double chance = (skillValue - entry.m_MinSkill) / (entry.m_MaxSkill - entry.m_MinSkill); if (chance > Utility.RandomDouble()) { return(entry.m_Types[Utility.Random(entry.m_Types.Length)]); } } } return(type); }
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; }
public override Type MutateType(Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { bool deepWater = SpecialFishingNet.FullValidation(map, loc.X, loc.Y); double skillBase = from.Skills[SkillName.Fishing].Base; double skillValue = from.Skills[SkillName.Fishing].Value; for (int i = 0; i < m_MutateTable.Length; ++i) { MutateEntry entry = m_MutateTable[i]; // no deepwater check if you are in a fishing hotspot if (GoodFishingHere(from, new Point2D(loc)) == false) { if (!deepWater && entry.m_DeepWater) { continue; } } if (skillBase >= entry.m_ReqSkill) { double chance = (skillValue - entry.m_MinSkill) / (entry.m_MaxSkill - entry.m_MinSkill); // check for sea quest bonus if (GoodFishingHere(from, new Point2D(loc))) { chance *= GoodFishingBonus(from, new Point2D(loc)); } if (chance > Utility.RandomDouble()) { return(entry.m_Types[Utility.Random(entry.m_Types.Length)]); } } } return(type); }
public override Type MutateType(Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource) { bool deepWater = SpecialFishingNet.FullValidation(map, loc.X, loc.Y); bool dungeon = false; Region region = from.Region; if (region is DungeonRegion) { dungeon = true; } double skillBase = from.Skills[SkillName.Fishing].Base; double skillValue = from.Skills[SkillName.Fishing].Value; if (FSHSR.HSRTournamentSystem.TournamentRunning() && skillValue > 60.0) { double chance = (skillValue - 60.0) / 300; // Default 20% chance at 120 / 13% chance at 100 if (DateTime.UtcNow.DayOfWeek == FSHSR.HSRTournamentSystem.TournyOne && dungeon == true && chance > Utility.RandomDouble()) { return(typeof(ToxicTrout)); } else if (DateTime.UtcNow.DayOfWeek == FSHSR.HSRTournamentSystem.TournyTwo && deepWater == true && chance > Utility.RandomDouble()) { return(typeof(CottonCandySwordfish)); } else if (DateTime.UtcNow.DayOfWeek == FSHSR.HSRTournamentSystem.TournyThree && from.Map == Map.Malas && chance > Utility.RandomDouble()) { return(typeof(MalasMoonfish)); } } for (int i = 0; i < m_MutateTable.Length; ++i) { MutateEntry entry = m_MutateTable[i]; if (!deepWater && entry.m_DeepWater) { continue; } if (!dungeon && entry.m_RequiresDungeon) { continue; } if (entry.m_RequiredRegion != null && region.Name != entry.m_RequiredRegion) { continue; } if (entry.m_RequiredMap != null && map != entry.m_RequiredMap) { continue; } if (skillBase >= entry.m_ReqSkill) { double chance = (skillValue - entry.m_MinSkill) / (entry.m_MaxSkill - entry.m_MinSkill); if (chance > Utility.RandomDouble()) { return(entry.m_Types[Utility.Random(entry.m_Types.Length)]); } } } return(type); }