Esempio n. 1
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. 2
0
        /// <summary>
        /// General Dialogs from character
        /// changed: 01.10.05
        /// </summary>
        public override void OnHello( Character c )
        {
            if ( Reputation( c ) > 0.5f )
            {
                GMenu gMenu = new GMenu();
                GQMenu gQMenu = new GQMenu();

                if ( HaveQuests )
                {
                    if ( HaveRewardOnHello( c ) ) return;			// if ready Rewarded onHello

                    BaseQuest[] Qlist = GetQuestsFor( c );			// get all quests for this character

                    if ( Qlist.Length == 1 )
                    {
                        DoQuestEvents( c, Qlist[0] );
                        return;
                    }
                    for ( int i = 0; i< Qlist.Length; i++ )
                    {
                        gQMenu.Add( (uint)Qlist[i].Id, Qlist[i].QuestStatus( this, c ), Qlist[i].Name );
                    }
                    if ( OnlyQuests )
                    {
                        if ( gQMenu.Count > 0 )
                        {
                            c.QuestList( this, GetRndQLMessage, GetQLEmote, Qlist );
                        }
                        else
                        {
                            c.SendGossip( this, (int)NPCMenuId.Hello, null, null );
                            //c.ResponseMessage( this, (int)NPCMenuId.Hello, Message_Hello );
                        }
                        return;
                    }
                }

                if ( Taxi )			gMenu.Add( (int)NPCSubMenuId.Taxi,		GMenuIcons.Taxi,		false, Dialog_Taxi );
                if ( Vendor )		gMenu.Add( (int)NPCSubMenuId.Vendor,	GMenuIcons.Vendor,	false, Dialog_Vendor );
                if ( Trainer )		gMenu.Add( (int)NPCSubMenuId.Trainer,	GMenuIcons.Trainer,	false, Dialog_Teach );
                if ( Banker )		gMenu.Add( (int)NPCSubMenuId.Banker,	GMenuIcons.Banker,	false, Dialog_Bank );
                if ( InKeeper )
                {
                    gMenu.Add( (int)NPCSubMenuId.Vendor,		GMenuIcons.Vendor,	false, Dialog_Vendor );
                    gMenu.Add( (int)NPCSubMenuId.InKeeperBind,	GMenuIcons.Binder,	false, Dialog_Inkeeper_Bind );
                    //NPCSubMenuId.InKeeperMsg
                }

                if ( gMenu.Count > 0 || gQMenu.Count > 0 )
                {
                    c.SendGossip( this, (int)NPCMenuId.MainMenu, gMenu, gQMenu );
                }
                else
                {
                    c.SendGossip( this, (int)NPCMenuId.Hello, null, null );
                    //c.ResponseMessage( this, (int)NPCMenuId.Hello, Message_Hello );
                }
            }
            else c.SendGossip( this, (int)NPCMenuId.HelloBad, null, null );//*/
            //else c.ResponseMessage( this, (int)NPCMenuId.HelloBad, "Get lost skum.." );
        }