public override bool Give( Mobile m, Item item, bool placeAtFeet ) { if ( item is MessageInABottle || item is SpecialFishingNet ) { BaseCreature serp; 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.Map = map; serp.Location = new Point3D( x, y, -5 ); 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 ) placeAtFeet = true; return base.Give( m, item, placeAtFeet ); }
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" }