示例#1
0
        public override bool SpecialHarvest(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc)
        {
            PlayerMobile player = from as PlayerMobile;

                        Container pack = from.Backpack;

            if (player != null)
            {
                QuestSystem qs = player.Quest;

                if (qs is CollectorQuest)
                {
                    QuestObjective obj = qs.FindObjective(typeof(FishPearlsObjective));

                    if (obj != null && !obj.Completed)
                    {
                        if (Utility.RandomDouble() < 0.5)
                        {
                            player.SendLocalizedMessage(1055086, "", 0x59); // You pull a shellfish out of the water, and find a rainbow pearl inside of it.

                            obj.CurProgress++;
                        }
                        else
                        {
                            player.SendLocalizedMessage(1055087, "", 0x2C); // You pull a shellfish out of the water, but it doesn't have a rainbow pearl.
                        }

						return true;
					}
				}    

                foreach ( BaseQuest quest in player.Quests )
                {
                    if ( quest is SomethingFishy )
                    {   							
						if ( Utility.RandomDouble() < 0.1 && ( from.Region != null && from.Region.IsPartOf( "AbyssEntrance" ) ) )
						{
							Item red = new RedHerring(); 
							pack.AddItem( red );
                            player.SendLocalizedMessage( 1095047, "", 0x23 ); // You pull a shellfish out of the water, but it doesn't have a rainbow pearl.
                            break;
						}	
                        return true;
				    }
                        
					if ( quest is ScrapingtheBottom )
                    {
                        if ( Utility.RandomDouble() < 0.1 && ( from.Region != null && from.Region.IsPartOf( "AbyssEntrance" ) ) )
						{
							Item mug = new MudPuppy(); 
                            pack.AddItem( mug );
                            player.SendLocalizedMessage( 1095064, "", 0x23 ); // You pull a shellfish out of the water, but it doesn't have a rainbow pearl.
                            break;
				        }	
						return true;
                    }					
				}				
			}

            return false;
        }
示例#2
0
        public override bool SpecialHarvest(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc)
        {
            PlayerMobile player = from as PlayerMobile;

            Container pack = from.Backpack;

            if (player != null)
            {
                QuestSystem qs = player.Quest;

                if (qs is CollectorQuest)
                {
                    QuestObjective obj = qs.FindObjective(typeof(FishPearlsObjective));

                    if (obj != null && !obj.Completed)
                    {
                        if (Utility.RandomDouble() < 0.5)
                        {
                            player.SendLocalizedMessage(1055086, "", 0x59); // You pull a shellfish out of the water, and find a rainbow pearl inside of it.

                            obj.CurProgress++;
                        }
                        else
                        {
                            player.SendLocalizedMessage(1055087, "", 0x2C); // You pull a shellfish out of the water, but it doesn't have a rainbow pearl.
                        }

                        return true;
                    }
                }

                foreach (BaseQuest quest in player.Quests)
                {
                    if (quest is SomethingFishy)
                    {
                        if (Utility.RandomDouble() < 0.1 && (from.Region != null && from.Region.IsPartOf("AbyssEntrance")))
                        {
                            Item red = new RedHerring();
                            pack.AddItem(red);
                            player.SendLocalizedMessage(1095047, "", 0x23); // You pull a shellfish out of the water, but it doesn't have a rainbow pearl.
                            break;
                        }
                        return true;
                    }

                    if (quest is ScrapingtheBottom)
                    {
                        if (Utility.RandomDouble() < 0.1 && (from.Region != null && from.Region.IsPartOf("AbyssEntrance")))
                        {
                            Item mug = new MudPuppy();
                            pack.AddItem(mug);
                            player.SendLocalizedMessage(1095064, "", 0x23); // You pull a shellfish out of the water, but it doesn't have a rainbow pearl.
                            break;
                        }
                        return true;
                    }
                }

                #region High Seas Charydbis
                if (Core.HS && tool is FishingPole && CharydbisSpawner.SpawnInstance != null && CharydbisSpawner.SpawnInstance.IsSummoned)
                {
                    if (pack == null)
                        return false;

                    Item oracle = pack.FindItemByType(typeof(OracleOfTheSea));
                    FishingPole pole = tool as FishingPole;
                    CharydbisSpawner sp = CharydbisSpawner.SpawnInstance;

                    if (oracle != null && sp != null)
                    {
                        if (from.Map != sp.Map)
                            from.SendLocalizedMessage(1150861); //Charybdis have never been seen in these waters, try somewhere else.

                        else if (pole.BaitType == typeof(Charydbis) && from.Skills[SkillName.Fishing].Value >= 100)
                        {
                            if (sp.Charydbis == null && !sp.HasSpawned && sp.CurrentLocation.Contains(loc))
                            {
                                Server.Multis.BaseBoat boat = Server.Multis.BaseBoat.FindBoatAt(from, from.Map);
                                sp.SpawnCharydbis(from, loc, sp.Map, boat);
                                sp.HasSpawned = true;
                                pole.OnFishedHarvest(from, true);
                                return true;
                            }
                            else if (sp.LastLocation.Contains(loc))
                            {
                                from.SendLocalizedMessage(1150862); //The charybdis has moved on from this location, consult Oracle Of The Seas again.
                            }
                        }
                        else
                            from.SendLocalizedMessage(1150858); //You see a few bubbles, but no charybdis.
                    }
                }
                #endregion
            }

            return false;
        }