public override bool Give(Mobile from, Item item, bool placeAtFeet) { if (item is TreasureMap || item is MessageInABottle || item is SpecialFishingNet) { BaseCreature serp; if (0.25 > Utility.RandomDouble()) { serp = new DeepSeaSerpent(); } else { serp = new SeaSerpent(); } serp.m_WasFishedUp = true; int x = from.X, y = from.Y; Map map = from.Map; for (int i = 0; map != null && i < 20; ++i) { int tx = from.X - 10 + Utility.Random(21); int ty = from.Y - 10 + Utility.Random(21); LandTile t = map.Tiles.GetLandTile(tx, ty); if (t.Z == -5 && ((t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137)) && !Spells.SpellHelper.CheckMulti(new Point3D(tx, ty, -5), map)) { x = tx; y = ty; break; } } serp.MoveToWorld(new Point3D(x, y, -5), map); serp.Home = serp.Location; serp.RangeHome = 10; //TEST: FIX //serp.PackItem(item); from.SendLocalizedMessage(503170); // Uh oh! That doesn't look like a fish! return(true); } if (item is WoodenChest || item is MetalGoldenChest) { placeAtFeet = true; } from.PlaySound(0x025); return(base.Give(from, item, placeAtFeet)); }
protected virtual void FinishEffect(Point3D p, Map map, Mobile from) { from.RevealingAction(); int count = GetSpawnCount(); for (int i = 0; map != null && i < count; ++i) { BaseCreature spawn; switch (Utility.Random(4)) { default: case 0: spawn = new SeaSerpent(); break; case 1: spawn = new DeepSeaSerpent(); break; case 2: spawn = new WaterElemental(); break; case 3: spawn = new Kraken(); break; } Spawn(p, map, spawn); spawn.Combatant = from; } Delete(); }
private void FinishEffect(Point3D p) { int count = Utility.RandomMinMax(5, 7); if (Hue != 0x8A0) { count += Utility.RandomMinMax(1, 2); } Map map = this.Map; Leviathan lev = new Leviathan(); lev.MoveToWorld(p, map); for (int i = 0; map != null && i < count; ++i) { BaseCreature spawn; switch (Utility.Random(4)) { default: case 0: spawn = new SeaSerpent(); break; case 1: spawn = new DeepSeaSerpent(); break; case 2: spawn = new WaterElemental(); break; case 3: spawn = new Kraken(); break; } int x = p.X, y = p.Y; for (int j = 0; j < 20; ++j) { int tx = p.X - 5 + Utility.Random(11); int ty = p.Y - 5 + Utility.Random(11); Tile t = map.Tiles.GetLandTile(tx, ty); if (t.Z == p.Z && ((t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137)) && !Spells.SpellHelper.CheckMulti(new Point3D(tx, ty, p.Z), map)) { x = tx; y = ty; break; } } spawn.MoveToWorld(new Point3D(x, y, p.Z), map); if (spawn is Kraken && 0.2 > Utility.RandomDouble()) { spawn.PackItem(new MessageInABottle(map == Map.Felucca ? Map.Felucca : Map.Trammel)); } } Delete(); }
public override bool Give(Mobile m, Item item, bool placeAtFeet) { if (item is TreasureMap || item is MessageInABottle || item is SpecialFishingNet) { BaseCreature serp; if (0.25 > Utility.RandomDouble()) { serp = new DeepSeaSerpent(); } else { serp = new SeaSerpent(); } int x = m.X, y = m.Y; Map map = m.Map; for (int i = 0; map != null && i < 20; ++i) { int tx = m.X - 10 + Utility.Random(21); int ty = m.Y - 10 + Utility.Random(21); LandTile t = map.Tiles.GetLandTile(tx, ty); if (t.Z == -5 && (t.ID >= 0xA8 && t.ID <= 0xAB || t.ID >= 0x136 && t.ID <= 0x137) && new Point3D(tx, ty, -5).GetMulti(map) == null ) { x = tx; y = ty; break; } } serp.MoveToWorld(new Point3D(x, y, -5), map); serp.Home = serp.Location; serp.RangeHome = 10; serp.PackItem(item); m.SendLocalizedMessage(503170); // Uh oh! That doesn't look like a fish! return(true); // we don't want to give the item to the player, it's on the serpent } if (item is BigFish || item is WoodenChest || item is MetalGoldenChest) { placeAtFeet = true; } return(base.Give(m, item, placeAtFeet)); }
protected virtual void SpawnBaddies(Point3D p, Map map, Mobile from) { if (from != null || map != null) { from.RevealingAction(); int count = GetSpawnCount(); BaseCreature spawn; for (int i = 0; i < count; ++i) { switch (Utility.Random(4)) { default: case 0: spawn = new SeaSerpent(); break; case 1: spawn = new DeepSeaSerpent(); break; case 2: spawn = new WaterElemental(); break; case 3: spawn = new Kraken(); break; } Spawn(p, map, spawn); spawn.Combatant = from; } } }
public override bool Give(Mobile m, Item item, bool placeAtFeet) { if (item is TreasureMap || item is MessageInABottle || item is SpecialFishingNet) { BaseCreature serp; if (0.25 > Utility.RandomDouble()) { serp = new DeepSeaSerpent(); } else { serp = new SeaSerpent(); } int x = m.X, y = m.Y; Map map = m.Map; for (int i = 0; map != null && i < 20; ++i) { int tx = m.X - 10 + Utility.Random(21); int ty = m.Y - 10 + Utility.Random(21); LandTile t = map.Tiles.GetLandTile(tx, ty); if (t.Z == -5 && ((t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137)) && !Spells.SpellHelper.CheckMulti(new Point3D(tx, ty, -5), map)) { x = tx; y = ty; break; } } serp.MoveToWorld(new Point3D(x, y, -5), map); serp.Home = serp.Location; serp.RangeHome = 10; serp.PackItem(item); m.SendLocalizedMessage(503170); // Uh oh! That doesn't look like a fish! return(true); // we don't want to give the item to the player, it's on the serpent } if (item is BigFish || item is LockableContainer) { placeAtFeet = true; } #region High Seas if (item is RareFish) { RareFish fish = (RareFish)item; if (FishInfo.IsRareFish(fish.GetType())) { fish.Fisher = m; fish.DateCaught = DateTime.Now; fish.Stackable = false; fish.Weight = Math.Max(1, 200 - (int)Math.Sqrt(Utility.RandomMinMax(0, 40000))); } } #endregion return(base.Give(m, item, placeAtFeet)); }
public void FindCreature(Mobile from, int creatureLevel) { if (from == null) { return; } PlayerMobile player = from as PlayerMobile; if (player == null) { return; } int waterLocationChecks = 20; int minSpawnRadius = 3; int maxSpawnRadius = 6; bool foundWaterSpot = false; bool spawnedCreatures = false; Point3D spawnLocation = Location; Point3D newLocation = new Point3D(); for (int a = 0; a < waterLocationChecks; a++) { int x = X; int xOffset = Utility.RandomMinMax(minSpawnRadius, maxSpawnRadius); if (Utility.RandomDouble() >= .5) { xOffset *= -1; } x += xOffset; int y = Y; int yOffset = Utility.RandomMinMax(minSpawnRadius, maxSpawnRadius); if (Utility.RandomDouble() >= .5) { yOffset *= -1; } y += yOffset; newLocation.X = x; newLocation.Y = y; newLocation.Z = -5; bool waterTile = BaseBoat.IsWaterTile(newLocation, Map); if (waterTile) { if (BaseBoat.FindBoatAt(newLocation, Map) != null) { continue; } SpellHelper.AdjustField(ref spawnLocation, Map, 12, false); foundWaterSpot = true; break; } } if (!foundWaterSpot) { return; } int count = 0; switch (creatureLevel) { case 1: count = Utility.RandomMinMax(1, 2); for (int a = 0; a < count; a++) { BaseCreature bc_Creature = new Puddle(); bc_Creature.m_WasFishedUp = true; bc_Creature.MoveToWorld(spawnLocation, from.Map); spawnedCreatures = true; } if (spawnedCreatures) { from.PublicOverheadMessage(MessageType.Regular, 0, false, "*something rises from the water*"); } break; case 2: count = Utility.RandomMinMax(1, 2); for (int a = 0; a < count; a++) { BaseCreature bc_Creature = new WaterElemental(); bc_Creature.m_WasFishedUp = true; bc_Creature.MoveToWorld(spawnLocation, from.Map); spawnedCreatures = true; } if (spawnedCreatures) { from.PublicOverheadMessage(MessageType.Regular, 0, false, "*something rises from the water*"); } break; case 3: count = Utility.RandomMinMax(1, 2); for (int a = 0; a < count; a++) { BaseCreature bc_Creature = new DeepSeaSerpent(); bc_Creature.m_WasFishedUp = true; bc_Creature.MoveToWorld(spawnLocation, from.Map); spawnedCreatures = true; } if (spawnedCreatures) { from.PublicOverheadMessage(MessageType.Regular, 0, false, "*something rises from the water*"); } break; case 4: count = Utility.RandomMinMax(1, 2); for (int a = 0; a < count; a++) { BaseCreature bc_Creature = new Kraken(); bc_Creature.m_WasFishedUp = true; bc_Creature.MoveToWorld(spawnLocation, from.Map); spawnedCreatures = true; } if (spawnedCreatures) { from.PublicOverheadMessage(MessageType.Regular, 0, false, "*something rises from the water*"); } break; } }
protected virtual void FinishEffect(Point3D p, Map map, Mobile from) { from.RevealingAction(); Server.Engines.Harvest.Fishing.FishingSkill(from, 8); int count = Utility.RandomMinMax(1, 1); int onBoat = 0; string monster = ""; Point3D SpawnAt = p; switch (Utility.Random(8)) { case 0: monster = "WaterNaga"; break; case 1: monster = "SeaHagGreater"; SpawnAt = from.Location; onBoat = 1; break; case 2: monster = "SeaDragon"; break; case 3: monster = "SeaGiant"; break; case 4: monster = "DeepSeaSerpent"; break; case 5: monster = "DemonOfTheSea"; SpawnAt = from.Location; onBoat = 1; break; case 6: monster = "RottingSquid"; break; case 7: monster = "DeepWaterElemental"; break; } for (int i = 0; map != null && i < count; ++i) { BaseCreature spawn = new WaterNaga(); if (monster == "WaterNaga") { spawn = new WaterNaga(); } else if (monster == "SeaHagGreater") { spawn = new SeaHagGreater(); } else if (monster == "SeaDragon") { spawn = new SeaDragon(); } else if (monster == "SeaGiant") { spawn = new SeaGiant(); } else if (monster == "DeepSeaSerpent") { spawn = new DeepSeaSerpent(); } else if (monster == "DemonOfTheSea") { spawn = new DemonOfTheSea(); } else if (monster == "RottingSquid") { spawn = new RottingSquid(); } else if (monster == "DeepWaterElemental") { spawn = new DeepWaterElemental(); } Spawn(SpawnAt, map, spawn, onBoat); spawn.WhisperHue = 999; // SO TASK MANAGER DELETES THEM EVENTUALLY spawn.Combatant = from; } Delete(); }
public void FindCreature(Mobile from, int creatureLevel) { if (from == null) { return; } PlayerMobile player = from as PlayerMobile; if (player == null) { return; } int waterLocationChecks = 20; int minSpawnRadius = 3; int maxSpawnRadius = 6; bool foundWaterSpot = false; bool spawnedCreatures = false; Point3D spawnLocation = Location; Point3D newLocation = new Point3D(); for (int a = 0; a < waterLocationChecks; a++) { int x = X; int xOffset = Utility.RandomMinMax(minSpawnRadius, maxSpawnRadius); if (Utility.RandomDouble() >= .5) { xOffset *= -1; } x += xOffset; int y = Y; int yOffset = Utility.RandomMinMax(minSpawnRadius, maxSpawnRadius); if (Utility.RandomDouble() >= .5) { yOffset *= -1; } y += yOffset; newLocation.X = x; newLocation.Y = y; newLocation.Z = -5; bool waterTile = BaseShip.IsWaterTile(newLocation, Map); if (waterTile) { if (BaseShip.FindShipAt(newLocation, Map) != null) { continue; } SpellHelper.AdjustField(ref spawnLocation, Map, 12, false); foundWaterSpot = true; break; } } if (!foundWaterSpot) { return; } int count = 0; switch (creatureLevel) { case 1: count = Utility.RandomMinMax(1, 2); for (int a = 0; a < count; a++) { BaseCreature bc_Creature = new Puddle(); bc_Creature.m_WasFishedUp = true; bc_Creature.MoveToWorld(spawnLocation, from.Map); spawnedCreatures = true; } if (spawnedCreatures) { from.PublicOverheadMessage(MessageType.Regular, 0, false, "*something was hiding in the wreckage!*"); } break; case 2: if (player.ShipOccupied != null) { if (!player.ShipOccupied.Deleted && player.ShipOccupied.m_SinkTimer == null) { count = Utility.RandomMinMax(2, 4); for (int a = 0; a < count; a++) { BaseCreature bc_Creature = new ColossusTermite(); bc_Creature.m_WasFishedUp = true; bc_Creature.MoveToWorld(player.ShipOccupied.GetRandomEmbarkLocation(false), from.Map); spawnedCreatures = true; } } } if (spawnedCreatures) { from.PublicOverheadMessage(MessageType.Regular, 0, false, "*the wreckage was full of termites!*"); } break; case 3: count = Utility.RandomMinMax(1, 2); for (int a = 0; a < count; a++) { BaseCreature bc_Creature = new DeepSeaSerpent(); bc_Creature.m_WasFishedUp = true; bc_Creature.MoveToWorld(spawnLocation, from.Map); spawnedCreatures = true; } if (spawnedCreatures) { from.PublicOverheadMessage(MessageType.Regular, 0, false, "*something was hiding in the wreckage!*"); } break; case 4: count = Utility.RandomMinMax(1, 2); for (int a = 0; a < count; a++) { BaseCreature bc_Creature = new Kraken(); bc_Creature.m_WasFishedUp = true; bc_Creature.MoveToWorld(spawnLocation, from.Map); spawnedCreatures = true; } if (spawnedCreatures) { from.PublicOverheadMessage(MessageType.Regular, 0, false, "*something was hiding in the wreckage!*"); } break; } }
public override void SendSuccessTo(Mobile from, Item item, HarvestResource resource) { if (item is BigFish) { // Deleted this message since you can now get loot, which is notta fish // I wish I knew how to send "custom" message to the screen like... // "Whoa! You just reeled in something very interesting" // from.SendLocalizedMessage( 1042635 ); // Your fishing pole bends as you pull a big fish from the depths! ((BigFish)item).Fisher = from; } else if (item is WoodenChest) { from.SendLocalizedMessage(503175); // You pull up a heavy chest from the depths of the ocean! } else { int number; string name; if (item is BaseMagicFish) { number = 1008124; name = "a mess of small fish"; } else if (item is Fish) { number = 1008124; name = "a fish"; } else if (item is BaseShoes) { number = 1008124; name = item.ItemData.Name; } else if (item is TreasureMap) { number = 1008125; name = "a sodden piece of parchment"; } else if (item is MessageInABottle) { number = 1008125; name = "a bottle, with a message in it"; } else if (item is SpecialFishingNet) { number = 1008125; name = "a special fishing net"; // TODO: this is just a guess--what should it really be named? } else { number = 1043297; // It's Some Other Stuff... // Console.WriteLine(item.ItemData.Name); if ((item.ItemData.Flags & TileFlag.ArticleA) != 0) { name = "a " + item.ItemData.Name; } else if ((item.ItemData.Flags & TileFlag.ArticleAn) != 0) { name = "an " + item.ItemData.Name; } else { name = item.ItemData.Name; } if (number == 1043297) { from.SendLocalizedMessage(number, name); } else { from.SendLocalizedMessage(number, true, name); } } double temp_random_dbl = Utility.RandomDouble(); // Console.WriteLine("Trying to spawn Random Monster when 0.05 > {0}", temp_random_dbl); if (0.05 > temp_random_dbl) // Spawn a monster ~ every 20 tries { BaseCreature serp2; switch (Utility.Random(11)) { case 0: { serp2 = new DeepSeaSnake(); break; } case 1: { serp2 = new DeepWaterElemental(); break; } case 2: { serp2 = new FlameShark(); break; } case 3: { serp2 = new HurricaneElemental(); break; } case 4: { serp2 = new IcebergElemental(); break; } case 5: { serp2 = new RoamingKraken(); break; } case 6: { serp2 = new StormSerpent(); break; } case 7: { serp2 = new TsunamiSerpent(); break; } case 8: { serp2 = new GiantWaterStrider(); break; } case 9: { serp2 = new DeepSeaSerpent(); break; } default: { serp2 = new SeaSerpent(); break; } } int x = from.X, y = from.Y; Map map = from.Map; for (int i = 0; map != null && i < 20; ++i) { int tx = from.X - 10 + Utility.Random(21); int ty = from.Y - 10 + Utility.Random(21); Tile t = map.Tiles.GetLandTile(tx, ty); if (t.Z == -5 && ((t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137)) && !Spells.SpellHelper.CheckMulti(new Point3D(tx, ty, -5), map)) { x = tx; y = ty; break; } } serp2.MoveToWorld(new Point3D(x, y, -5), map); serp2.Home = serp2.Location; serp2.RangeHome = 10; from.SendLocalizedMessage(503170); // Uh oh! That doesn't look like a fish! } } }
public override bool Give(Mobile m, Item item, bool placeAtFeet) { // This code is triggered when you've harvested a Map/MIB/Net. You first // spawn a critter and then add the special item to his/her pack for loot if (item is TreasureMap || item is MessageInABottle || item is SpecialFishingNet) { BaseCreature serp; switch (Utility.Random(11)) { case 0: { serp = new DeepSeaSnake(); break; } case 1: { serp = new DeepWaterElemental(); break; } case 2: { serp = new FlameShark(); break; } case 3: { serp = new HurricaneElemental(); break; } case 4: { serp = new IcebergElemental(); break; } case 5: { serp = new RoamingKraken(); break; } case 6: { serp = new StormSerpent(); break; } case 7: { serp = new TsunamiSerpent(); break; } case 8: { serp = new GiantWaterStrider(); break; } case 9: { serp = new DeepSeaSerpent(); break; } default: { serp = new SeaSerpent(); break; } } int x = m.X, y = m.Y; Map map = m.Map; for (int i = 0; map != null && i < 20; ++i) { int tx = m.X - 10 + Utility.Random(21); int ty = m.Y - 10 + Utility.Random(21); Tile t = map.Tiles.GetLandTile(tx, ty); if (t.Z == -5 && ((t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137)) && !Spells.SpellHelper.CheckMulti(new Point3D(tx, ty, -5), map)) { x = tx; y = ty; break; } } serp.MoveToWorld(new Point3D(x, y, -5), map); serp.Home = serp.Location; serp.RangeHome = 10; serp.PackItem(item); m.SendLocalizedMessage(503170); // Uh oh! That doesn't look like a fish! return(true); // we don't want to give the item to the player, it's on the serpent } // BigFish go into the pack, but why does it look like they are put at feet? R12? if (item is BigFish || item is WoodenChest) { placeAtFeet = true; } // Here's where we sometimes replace the Big fish with a Special Item. // Note that we have to trigger on the Big Fish to stop folks from // macroing on the shore (shallow water) for Magic Weps. This method // does not have the right variables for deepwater check if (item is BigFish) // We know we're in Deepwater, and it's a rare event { double leet_loot_chance = 0.1; if (leet_loot_chance > Utility.RandomDouble()) { switch (Utility.Random(2)) { case 0: { BaseWeapon temp_weapon = Loot.RandomWeapon(); temp_weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(6); temp_weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(6); temp_weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(1); // Item was in the water forever...shouldn't be very durable item = (Item)temp_weapon; break; } default: { BaseArmor temp_armor = Loot.RandomArmor(); temp_armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(4); temp_armor.Durability = (ArmorDurabilityLevel)Utility.Random(1); // Item was in the water forever...shouldn't be very durable item = (Item)temp_armor; break; } } } // else just give the fisher a Big Fish } // Could also easily add variations on the following...but I've left it at Weps/Armor // item = Loot.RandomShield(); // item = Loot.RandomJewelry(); // item = Loot.RandomInstrument(); // item = Loot.RandomScroll(2, 8, SpellbookType.Regular); // item = Loot.RandomPotion(); // item = new BankCheck( 1000000 ); // item = new ShipwreckedItem(5055); // Chain tunic with Shipwreck Label return(base.Give(m, item, placeAtFeet)); // Here's where you GIVE player the "item" }