public void SendDialog(Quest quest = null, QuestReward reward = null)
        {
            new SpShowDialog(Npc, Stage, Buttons, DialogId, Special1, Special2, Page, Uid, quest, reward).Send(Player.Connection);

            Global.VisibleService.Send(Player, new SpCharacterEmotions(Player, PlayerEmotion.Dialog));
            Global.VisibleService.Send(Npc, new SpNpcEmotion(Npc, Player, new Random().Next(1, 3)));
        }
        public QuestProcessor(Quest quest)
        {
            Quest = quest;

            // ReSharper disable CanBeReplacedWithTryCastAndCheckForNull
            for (int i = 0; i < quest.Steps.Count; i++)
            {
                if (quest.Steps[i] is QTaskVisit)
                    Steps.Add(new QStepVisit((QTaskVisit)quest.Steps[i]));
                else if (quest.Steps[i] is QTaskHunting)
                    Steps.Add(new QStepHunting((QTaskHunting)quest.Steps[i]));
                else if (quest.Steps[i] is QTaskHuntingDelivery)
                    Steps.Add(new QStepHuntingDelivery((QTaskHuntingDelivery)quest.Steps[i]));
                else if (quest.Steps[i] is QTaskPlaybackVideo)
                    Steps.Add(new QStepPlayCinematic((QTaskPlaybackVideo)quest.Steps[i]));
                else if (quest.Steps[i] is QTaskConditions)
                    Steps.Add(new QStepCondition((QTaskConditions)quest.Steps[i]));
                else if (quest.Steps[i] is QTaskItemThatStabbedPassed)
                    Steps.Add(new QStepItemThatStabbedPassed((QTaskItemThatStabbedPassed)quest.Steps[i]));
                else if (quest.Steps[i] is QTaskMovePC)
                    Steps.Add(new QStepMovePc((QTaskMovePC)quest.Steps[i]));
                else
                    Steps.Add(new QStepDefault());

                Steps[Steps.Count - 1].Quest = quest;
                Steps[Steps.Count - 1].Processor = this;
            }
            // ReSharper restore CanBeReplacedWithTryCastAndCheckForNull
        }
Beispiel #3
0
 public SpShowDialog(Npc npc, int stage, List<DialogButton> buttons, int dialogId, int special1, int special2, int page, int dialogUid, Quest quest = null, QuestReward reward = null)
 {
     Npc = npc;
     Stage = stage;
     Buttons = buttons;
     DialogUid = dialogUid;
     DialogId = dialogId;
     Special1 = special1;
     Special2 = special2;
     Page = page;
     Quest = quest;
     Reward = reward;
 }
Beispiel #4
0
        public QuestReward GetRewardForPlayer(Player player, Quest quest)
        {
            if (quest.QuestRewardType == QuestRewardType.Allpay)
                return quest.Rewards.Count > 0 ? quest.Rewards[0] : null;

            if (quest.QuestRewardType == QuestRewardType.Class)
                for (int i = 0; i < quest.Rewards.Count; i++)
                {
                    if (quest.Rewards[i].PlayerClass == player.PlayerData.Class)
                        return quest.Rewards[i];
                }

            //todo Switchable reward

            return null;
        }