Esempio n. 1
0
 /// <summary>
 /// On Quest Events
 /// added: 02.10.05
 /// </summary>
 public override void OnChooseQuest( Character c, int id )
 {
     foreach ( BaseQuest bq in Quests )
     {
         if ( bq!=null && bq.Id == id )
         {
             DoQuestEvents( c, bq );
             return;
         }
     }
     c.QuestFailed( qFailedReason.Failed );
 }
Esempio n. 2
0
        /// <summary>
        /// private internal Events on quest selections
        /// changed: 02.10.05
        /// </summary>
        private void DoQuestEvents( Character c, BaseQuest bq )
        {
            if ( c.QuestDone( bq ) ) return;

            if ( !c.QuestCompleted( bq ) )
            {
                if ( !c.HaveQuest( bq ) )
                {
                    if ( bq.HaveDeliveryObj && !HaveFreeSlot( c ) ) // quest need free slot
                    {
                        c.QuestFailed( qFailedReason.InventoryFull );
                    }
                    else if ( AmountActiveQuests( c ) >= 20 ) // questLog is full
                    {
                        c.QuestLogIsFull();
                    }
                    else // can get quest
                    {//need add questEmotion[] on get quest
                        c.ResponseQuestDetails( this, bq.Id, bq.Name, bq.Desc, bq.Details, getEmoteOnStart( bq ) );
                        //c.ResponseQuestDetails( this, bq.Id, bq.Name, bq.Desc, bq.Details, new qEmote[] { new qEmote( Emote.ONESHOT_TALK, 500 ) } );
                    }
                }
                else
                {
                    //c.QuestInvalid( qInvalidReason.ReadyHaveThatQuest );
                    c.SendGossip( this, OnlyQuests ? (int)NPCMenuId.Quests : (int)NPCMenuId.MainMenu, null, null );
                    //c.ResponseMessage( this, OnlyQuests ? (int)NPCMenuId.Quests : (int)NPCMenuId.MainMenu, bq.ProgressDialog );
                }
            }
            else if ( c.QuestCompleted( bq ) )
            {//need add questEmotion[] on complete quest
                c.OfferReward( this, bq.Id, bq.FinishTitle, bq.FinishDialog, getEmoteOnEnd( bq ) );
                //c.OfferReward( this, bq.Id, bq.FinishTitle, bq.FinishDialog, new qEmote[] { new qEmote( Emote.ONESHOT_TALK, 500 ) } );
            }
        }
Esempio n. 3
0
 public bool HaveRewardOnHello( Character c )
 {
     bool result = false;
     ActiveQuest[] list = c.GetActiveQuests;
     if ( list != null )
     {
         foreach ( ActiveQuest aq in list )
         {
             if ( aq != null && aq.baseQuest != null )
             {
                 BaseQuest bq = aq.baseQuest;
                 if ( bq.HaveNPCTargetId && bq.NPCTargetId == this.Id )
                 {
                     if ( bq.HasReward() || bq.HasRewardChoice() )
                     {
                         if ( HaveFreeSlot( c ) )
                         {
                             c.OfferReward( this, bq.Id, bq.FinishTitle, bq.FinishDialog, getEmoteOnEnd( bq ) );
                         }
                         else
                         {
                             c.QuestFailed( qFailedReason.InventoryFull );
                         }
                     }
                     else
                     {
                         c.OfferReward( this, bq.Id, bq.FinishTitle, bq.FinishDialog, getEmoteOnEnd( bq ) );
                     }
                     result = true;
                     break;
                 }
             }
         }
     }
     return result;
 }