예제 #1
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            QuestSystem qs = player.Quest;

            if (qs is TerribleHatchlingsQuest)
            {
                if (qs.IsObjectiveInProgress(typeof(FirstKillObjective)))
                {
                    qs.AddConversation(new DirectionConversation());
                }
                else if (qs.IsObjectiveInProgress(typeof(SecondKillObjective)) ||
                         qs.IsObjectiveInProgress(typeof(ThirdKillObjective)))
                {
                    qs.AddConversation(new TakeCareConversation());
                }
                else
                {
                    QuestObjective obj = qs.FindObjective(typeof(ReturnObjective));

                    if (obj != null && !obj.Completed)
                    {
                        Container cont = GetNewContainer();

                        cont.DropItem(new Gold(Utility.RandomMinMax(100, 200)));

                        if (Utility.RandomBool())
                        {
                            BaseWeapon weapon = Loot.Construct(Loot.SEWeaponTypes) as BaseWeapon;

                            if (weapon != null)
                            {
                                BaseRunicTool.ApplyAttributesTo(weapon, 3, 10, 30);
                                cont.DropItem(weapon);
                            }
                        }
                        else
                        {
                            BaseArmor armor = Loot.Construct(Loot.SEArmorTypes) as BaseArmor;

                            if (armor != null)
                            {
                                BaseRunicTool.ApplyAttributesTo(armor, 1, 10, 20);
                                cont.DropItem(armor);
                            }
                        }

                        if (player.PlaceInBackpack(cont))
                        {
                            obj.Complete();
                        }
                        else
                        {
                            cont.Delete();
                            player.SendLocalizedMessage(1046260);                               // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                        }
                    }
                }
            }
            else
            {
                TerribleHatchlingsQuest newQuest = new TerribleHatchlingsQuest(player);
                bool inRestartPeriod             = false;

                if (qs != null)
                {
                    if (contextMenu)
                    {
                        SayTo(player, 1063322);                           // Before you can help me with the Terrible Hatchlings, you'll need to finish the quest you've already taken!
                    }
                }
                else if (QuestSystem.CanOfferQuest(player, typeof(TerribleHatchlingsQuest), out inRestartPeriod))
                {
                    newQuest.SendOffer();
                }
                else if (inRestartPeriod && contextMenu)
                {
                    SayTo(player, 1049357);                       // I have nothing more for you at this time.
                }
            }
        }
예제 #2
0
        public override void OnTalk( PlayerMobile player, bool contextMenu )
        {
            QuestSystem qs = player.Quest;

            if ( qs is TerribleHatchlingsQuest )
            {
                if ( qs.IsObjectiveInProgress( typeof( FirstKillObjective ) ) )
                {
                    qs.AddConversation( new DirectionConversation() );
                }
                else if ( qs.IsObjectiveInProgress( typeof( SecondKillObjective ) )
                    || qs.IsObjectiveInProgress( typeof( ThirdKillObjective ) ) )
                {
                    qs.AddConversation( new TakeCareConversation() );
                }
                else
                {
                    QuestObjective obj = qs.FindObjective( typeof( ReturnObjective ) );

                    if ( obj != null && !obj.Completed )
                    {
                        Container cont = GetNewContainer();

                        cont.DropItem( new Gold( Utility.RandomMinMax( 100, 200 ) ) );

                        if ( Utility.RandomBool() )
                        {
                            BaseWeapon weapon = Loot.RandomWeapon( true );
                            BaseRunicTool.ApplyAttributesTo( weapon, 3, 10, 30 );

                            cont.DropItem( weapon );
                        }
                        else
                        {
                            BaseArmor armor = Loot.RandomArmor( true );
                            BaseRunicTool.ApplyAttributesTo( armor, 1, 10, 20 );

                            cont.DropItem( armor );
                        }

                        if ( player.PlaceInBackpack( cont ) )
                        {
                            obj.Complete();
                        }
                        else
                        {
                            cont.Delete();
                            player.SendLocalizedMessage( 1046260 ); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                        }
                    }
                }
            }
            else
            {
                TerribleHatchlingsQuest newQuest = new TerribleHatchlingsQuest( player );
                bool inRestartPeriod = false;

                if ( qs != null )
                {
                    if ( contextMenu )
                        SayTo( player, 1063322 ); // Before you can help me with the Terrible Hatchlings, you'll need to finish the quest you've already taken!
                }
                else if ( QuestSystem.CanOfferQuest( player, typeof( TerribleHatchlingsQuest ), out inRestartPeriod ) )
                {
                    newQuest.SendOffer();
                }
                else if ( inRestartPeriod && contextMenu )
                {
                    SayTo( player, 1049357 ); // I have nothing more for you at this time.
                }
            }
        }