コード例 #1
0
ファイル: Emino.cs プロジェクト: FreeReign/imaginenation
		public override void OnTalk( PlayerMobile player, bool contextMenu )
		{
			QuestSystem qs = player.Quest;

			if ( qs is EminosUndertakingQuest )
			{
				if ( EminosUndertakingQuest.HasLostNoteForZoel( player ) )
				{
					Item note = new NoteForZoel();

					if ( player.PlaceInBackpack( note ) )
					{
						qs.AddConversation( new LostNoteConversation() );
					}
					else
					{
						note.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 if ( EminosUndertakingQuest.HasLostEminosKatana( player ) )
				{
					qs.AddConversation( new LostSwordConversation() );
				}
				else
				{
					QuestObjective obj = qs.FindObjective( typeof( FindEminoBeginObjective ) );

					if ( obj != null && !obj.Completed )
					{
						obj.Complete();
					}
					else
					{
						obj = qs.FindObjective( typeof( UseTeleporterObjective ) );

						if ( obj != null && !obj.Completed )
						{
							Item note = new NoteForZoel();

							if ( player.PlaceInBackpack( note ) )
							{
								obj.Complete();

								player.AddToBackpack( new LeatherNinjaPants() );
								player.AddToBackpack( new LeatherNinjaMitts() );
							}
							else
							{
								note.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
						{
							obj = qs.FindObjective( typeof( ReturnFromInnObjective ) );

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

								for ( int i = 0; i < 10; i++ )
									cont.DropItem( new LesserHealPotion() );

								cont.DropItem( new LeatherNinjaHood() );
								cont.DropItem( new LeatherNinjaJacket() );

								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
							{
								if ( qs.IsObjectiveInProgress( typeof( SlayHenchmenObjective ) ) )
								{
									qs.AddConversation( new ContinueSlayHenchmenConversation() );
								}
								else
								{
									obj = qs.FindObjective( typeof( GiveEminoSwordObjective ) );

									if ( obj != null && !obj.Completed )
									{
										Item katana = null;

										if ( player.Backpack != null )
											katana = player.Backpack.FindItemByType( typeof( EminosKatana ) );

										if ( katana != null )
										{
											bool stolenTreasure = false;

											HallwayWalkObjective walk = qs.FindObjective( typeof( HallwayWalkObjective ) ) as HallwayWalkObjective;
											if ( walk != null )
												stolenTreasure = walk.StolenTreasure;

											Kama kama = new Kama();

											if ( stolenTreasure )
												BaseRunicTool.ApplyAttributesTo( kama, 1, 10, 20 );
											else
												BaseRunicTool.ApplyAttributesTo( kama, 1, 10, 30 );

											if ( player.PlaceInBackpack( kama ) )
											{
												katana.Delete();
												obj.Complete();

												if ( stolenTreasure )
													qs.AddConversation( new EarnLessGiftsConversation() );
												else
													qs.AddConversation( new EarnGiftsConversation() );
											}
											else
											{
												kama.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.
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
コード例 #2
0
ファイル: DaimyoEmino.cs プロジェクト: Ravenwolfe/xrunuo
        public override void OnTalk( PlayerMobile player, bool contextMenu )
        {
            Direction = this.GetDirectionTo( player );

            QuestSystem qs = player.Quest;

            if ( qs is EminosUndertakingQuest )
            {
                if ( qs.IsObjectiveInProgress( typeof( FindDaimyoEminoObjective ) ) )
                {
                    QuestObjective obj = qs.FindObjective( typeof( FindDaimyoEminoObjective ) );

                    if ( obj != null )
                    {
                        obj.Complete();
                    }

                    qs.AddConversation( new DaimyoEminoBeginConversation() );

                    qs.AddObjective( new FindEliteNinjaZoelObjective() );
                }

                if ( qs.IsObjectiveInProgress( typeof( TakeGreenTeleporterObjective ) ) )
                {
                    QuestObjective obj = qs.FindObjective( typeof( TakeGreenTeleporterObjective ) );

                    if ( obj != null )
                    {
                        obj.Complete();
                    }

                    qs.AddConversation( new EminoSecondConversation() );

                    player.AddToBackpack( new NoteForZoel() );

                    player.AddToBackpack( new LeatherNinjaPants() );

                    player.AddToBackpack( new LeatherNinjaMitts() );

                    qs.AddObjective( new BringNoteToZoelObjective() );
                }

                if ( qs.IsObjectiveInProgress( typeof( GoBackBlueTeleporterObjective ) ) )
                {
                    QuestObjective obj = qs.FindObjective( typeof( GoBackBlueTeleporterObjective ) );

                    if ( obj != null )
                    {
                        obj.Complete();
                    }

                    qs.AddConversation( new FrownsConversation() );

                    Bag bag = new Bag();

                    bag.Hue = 0x660;

                    bag.DropItem( new LeatherNinjaJacket() );
                    bag.DropItem( new LeatherNinjaHood() );

                    for ( int i = 0; i < 10; i++ )
                    {
                        bag.DropItem( new LesserHealPotion() );
                    }

                    player.AddToBackpack( bag );

                    qs.AddObjective( new TakeWhiteTeleporterObjective() );
                }

                if ( qs.IsObjectiveInProgress( typeof( KillHenchmensObjective ) ) )
                {
                    qs.AddConversation( new ContinueKillHenchmensConversation() );
                }

                if ( qs.IsObjectiveInProgress( typeof( ReturnToDaimyoObjective ) ) )
                {
                    List<Item> list = player.Backpack.Items;

                    DaimyoEminosKatana katana = null;

                    for ( int i = 0; i < list.Count; i++ )
                    {
                        if ( list[i] is DaimyoEminosKatana )
                        {
                            katana = list[i] as DaimyoEminosKatana;

                            break;
                        }
                    }

                    if ( katana == null )
                    {
                        qs.AddConversation( new TakeSwordAgainConversation() );
                    }
                    else
                    {
                        katana.Delete();

                        QuestObjective obj = qs.FindObjective( typeof( ReturnToDaimyoObjective ) );

                        if ( obj != null )
                        {
                            obj.Complete();
                        }

                        qs.AddConversation( new GiftsConversation() );

                        Kama kama = new Kama();

                        BaseRunicTool.ApplyAttributesTo( kama, 1, 10, 30 );

                        player.AddToBackpack( kama );

                        qs.Complete();
                    }
                }
            }
        }