Esempio n. 1
0
        public bool CanAccept(ClientQuestInfo quest)
        {
            if (quest.MinLevelNeeded > User.Level || quest.MaxLevelNeeded < User.Level)
                return false;

            if (!quest.ClassNeeded.HasFlag(RequiredClass.None))
            {
                switch (User.Class)
                {
                    case MirClass.Warrior:
                        if (!quest.ClassNeeded.HasFlag(RequiredClass.Warrior))
                            return false;
                        break;
                    case MirClass.Wizard:
                        if (!quest.ClassNeeded.HasFlag(RequiredClass.Wizard))
                            return false;
                        break;
                    case MirClass.Taoist:
                        if (!quest.ClassNeeded.HasFlag(RequiredClass.Taoist))
                            return false;
                        break;
                    case MirClass.Assassin:
                        if (!quest.ClassNeeded.HasFlag(RequiredClass.Assassin))
                            return false;
                        break;
                    case MirClass.Archer:
                        if (!quest.ClassNeeded.HasFlag(RequiredClass.Archer))
                            return false;
                        break;
                }
            }

            //check against active quest list
            return quest.QuestNeeded <= 0 || User.CompletedQuests.Contains(quest.QuestNeeded);
        }
Esempio n. 2
0
        public bool CanAccept(ClientQuestInfo quest)
        {
            if (quest.MinLevelNeeded > User.Level || quest.MaxLevelNeeded < User.Level)
            {
                return(false);
            }

            if (quest.Hero && (!GameScene.User.HasHero || GameScene.User.HeroState != HeroState.Spawned))
            {
                return(false);
            }

            if (!quest.ClassNeeded.HasFlag(RequiredClass.None))
            {
                switch (User.Class)
                {
                case MirClass.Warrior:
                    if (!quest.ClassNeeded.HasFlag(RequiredClass.Warrior))
                    {
                        return(false);
                    }
                    break;

                case MirClass.Wizard:
                    if (!quest.ClassNeeded.HasFlag(RequiredClass.Wizard))
                    {
                        return(false);
                    }
                    break;

                case MirClass.Taoist:
                    if (!quest.ClassNeeded.HasFlag(RequiredClass.Taoist))
                    {
                        return(false);
                    }
                    break;

                case MirClass.Assassin:
                    if (!quest.ClassNeeded.HasFlag(RequiredClass.Assassin))
                    {
                        return(false);
                    }
                    break;

                case MirClass.Archer:
                    if (!quest.ClassNeeded.HasFlag(RequiredClass.Archer))
                    {
                        return(false);
                    }
                    break;
                }
            }

            //check against active quest list
            return(quest.QuestNeeded <= 0 || User.CompletedQuests.Contains(quest.QuestNeeded));
        }
Esempio n. 3
0
        public bool CanAccept(ClientQuestInfo quest)
        {
            if (quest.MinLevelNeeded > User.Level || quest.MaxLevelNeeded < User.Level)
            {
                return(false);
            }

            if (!Functions.EqualClass(RequiredClass.None, User.Class))
            {
                if (!Functions.EqualClass(quest.ClassNeeded, User.Class))
                {
                    return(false);
                }
            }

            //check against active quest list
            return(quest.QuestNeeded <= 0 || User.CompletedQuests.Contains(quest.QuestNeeded));
        }
Esempio n. 4
0
 protected override void ReadPacket(BinaryReader reader)
 {
     Info = new ClientQuestInfo(reader);
 }
Esempio n. 5
0
        public bool CanAccept(ClientQuestInfo quest)
        {
            if (quest.MinLevelNeeded > User.Level || quest.MaxLevelNeeded < User.Level)
            {
                return(false);
            }

            if (!quest.ClassNeeded.HasFlag(RequiredClass.通用))
            {
                switch (User.Class)
                {
                case MirClass.战士:
                    if (!quest.ClassNeeded.HasFlag(RequiredClass.战士))
                    {
                        return(false);
                    }
                    break;

                case MirClass.法师:
                    if (!quest.ClassNeeded.HasFlag(RequiredClass.法师))
                    {
                        return(false);
                    }
                    break;

                case MirClass.道士:
                    if (!quest.ClassNeeded.HasFlag(RequiredClass.道士))
                    {
                        return(false);
                    }
                    break;

                case MirClass.刺客:
                    if (!quest.ClassNeeded.HasFlag(RequiredClass.刺客))
                    {
                        return(false);
                    }
                    break;

                case MirClass.弓箭手:
                    if (!quest.ClassNeeded.HasFlag(RequiredClass.弓箭手))
                    {
                        return(false);
                    }
                    break;

                case MirClass.碧血战士:
                    if (!quest.ClassNeeded.HasFlag(RequiredClass.碧血战士))
                    {
                        return(false);
                    }
                    break;

                case MirClass.虹玄法师:
                    if (!quest.ClassNeeded.HasFlag(RequiredClass.虹玄法师))
                    {
                        return(false);
                    }
                    break;

                case MirClass.翊仙道士:
                    if (!quest.ClassNeeded.HasFlag(RequiredClass.翊仙道士))
                    {
                        return(false);
                    }
                    break;

                case MirClass.飞燕刺客:
                    if (!quest.ClassNeeded.HasFlag(RequiredClass.飞燕刺客))
                    {
                        return(false);
                    }
                    break;

                case MirClass.暗鬼弓手:
                    if (!quest.ClassNeeded.HasFlag(RequiredClass.暗鬼弓手))
                    {
                        return(false);
                    }
                    break;
                }
            }

            //check against active quest list
            return(quest.QuestNeeded <= 0 || User.CompletedQuests.Contains(quest.QuestNeeded));
        }