コード例 #1
0
        /* This is our callback hook that will be called when the player clicks
         * on any button in the quest offer dialog. We check if he accepts or
         * declines here...
         */

        private static void CheckPlayerAbortQuest(GamePlayer player, byte response)
        {
            AfterTheAccident quest = player.IsDoingQuest(typeof(AfterTheAccident)) as AfterTheAccident;

            if (quest == null)
            {
                return;
            }

            if (response == 0x00)
            {
                SendSystemMessage(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Alb.AfterTheAccident.CheckPlayerAbortQuest.Text1"));
            }
            else
            {
                SendSystemMessage(player, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Alb.AfterTheAccident.CheckPlayerAbortQuest.Text2", questTitle));
                quest.AbortQuest();
            }
        }
コード例 #2
0
ファイル: AfterTheAccident.cs プロジェクト: mywebext/DOL
        protected static void TalkToSirPrescott(DOLEvent e, object sender, EventArgs args)
        {
            //We get the player from the event arguments and check if he qualifies
            GamePlayer player = ((SourceEventArgs)args).Source as GamePlayer;

            if (player == null)
            {
                return;
            }

            if (SirPrescott.CanGiveQuest(typeof(AfterTheAccident), player) <= 0)
            {
                return;
            }


            AfterTheAccident quest = player.IsDoingQuest(typeof(AfterTheAccident)) as AfterTheAccident;

            SirPrescott.TurnTo(player);

            if (e == GameObjectEvent.Interact)
            {
                if (quest == null)
                {
                    quest            = new AfterTheAccident();
                    quest.QuestGiver = SirPrescott;
                    quest.OfferQuest(player);
                }
                else
                {
                    if (quest.Step == 1 && quest.punySkeletonGoal.IsAchieved)
                    {
                        quest.ChooseRewards(player);
                    }
                }
            }
        }
コード例 #3
0
ファイル: AfterTheAccident.cs プロジェクト: mynew4/DAoC
        protected static void TalkToSirPrescott(DOLEvent e, object sender, EventArgs args)
        {
            //We get the player from the event arguments and check if he qualifies
            GamePlayer player = ((SourceEventArgs)args).Source as GamePlayer;
            if (player == null)
                return;

            if (SirPrescott.CanGiveQuest(typeof(AfterTheAccident), player) <= 0)
                return;

            AfterTheAccident quest = player.IsDoingQuest(typeof(AfterTheAccident)) as AfterTheAccident;
            SirPrescott.TurnTo(player);

            if (e == GameObjectEvent.Interact)
            {
                if (quest == null)
                {
                    quest = new AfterTheAccident();
                    quest.QuestGiver = SirPrescott;
                    quest.OfferQuest(player);
                }
                else
                {
                    if (quest.Step == 1 && quest.punySkeletonGoal.IsAchieved)
                        quest.ChooseRewards(player);
                }
            }
        }