Пример #1
0
        /// <summary>
        /// 获取第index个的跟随NPC的名字
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        public string GetFollowNpcName(int index)
        {
            if (FollowNpcs != null && FollowNpcs.Count > index)
            {
                NpcScenePosition npc        = FollowNpcs[index];
                uint             instanceId = npc.SceneId;
                uint             npcId      = npc.NpcId;
                return(NpcHelper.GetNpcName(instanceId, npcId));
            }

            return(string.Empty);
        }
Пример #2
0
        public string GetStepFixedDescription(int stepIndex)
        {
            var step = GetStep(stepIndex);

            if (step == null || step.Description == null)
            {
                return(string.Empty);
            }

            string result = DBConstText.GetText(step.Description);

            // 对目标名字进行替换
            if (step.Goal == GameConst.GOAL_TALK)
            {
                result = string.Format(result, NpcHelper.GetNpcName(step.InstanceId, step.NpcId));
            }
            else if (step.Goal == GameConst.GOAL_KILL_MON)
            {
                result = string.Format(result, RoleHelp.GetActorName(step.MonsterId));
            }
            else if (step.Goal == GameConst.GOAL_INTERACT)
            {
                result = string.Format(result, RoleHelp.GetActorName(NpcHelper.MakeNpcDefine(step.NpcId).ActorId));
            }
            else if (step.Goal == GameConst.GOAL_KILL_COLLECT)
            {
                result = string.Format(result, GoodsHelper.GetGoodsOriginalNameByTypeId(step.GoodsId));
            }
            else if (step.Goal == GameConst.GOAL_COLLECT_GOODS)
            {
                if (step.MinWorldBossSpecialMonId > 0 && step.MaxWorldBossSpecialMonId > 0)
                {
                    DBSpecialMon dbSpecialMon = DBManager.Instance.GetDB <DBSpecialMon>();
                    uint         minLevel     = dbSpecialMon.GetSpecialMonLevel(step.MinWorldBossSpecialMonId);
                    uint         maxLevel     = dbSpecialMon.GetSpecialMonLevel(step.MaxWorldBossSpecialMonId);
                    result = string.Format(result, minLevel, maxLevel, GoodsHelper.GetGoodsOriginalNameByTypeId(step.GoodsId));
                }
                else
                {
                    result = string.Format(result, GoodsHelper.GetGoodsOriginalNameByTypeId(step.GoodsId));
                }
            }
            else if (step.Goal == GameConst.GOAL_WAR_WIN || step.Goal == GameConst.GOAL_WAR_ENTER || step.Goal == GameConst.GOAL_WAR_GRADE)
            {
                result = string.Format(result, InstanceHelper.GetInstanceName(step.InstanceId2));
            }
            else if (step.Goal == GameConst.GOAL_EQUIP_SUBMIT)
            {
                result = string.Format(result, GoodsHelper.GetGoodsColorName(step.EquipColor) + xc.Equip.EquipHelper.GetEquipLvStepName(step.EquipLvStep));
            }
            else if (step.Goal == GameConst.GOAL_SECRET_AREA)
            {
                result = string.Format(result, InstanceHelper.GetKungfuGodInstanceName(step.SecretAreaId));
            }
            else if (step.Goal == GameConst.GOAL_TRIGRAM)
            {
                result = string.Format(result, TaskHelper.GetTrigramName(step.TrigramId));
            }
            else if (step.Goal == GameConst.GOAL_EQUIP_WEAR)
            {
                result = string.Format(result, GoodsHelper.GetGoodsColorName(step.EquipColor) + xc.Equip.EquipHelper.GetEquipLvStepName(step.EquipLvStep));
            }
            else if (step.Goal == GameConst.GOAL_EQUIP_STRENGTH)
            {
                result = string.Format(result, step.EquipStrenghtLv);
            }
            else if (step.Goal == GameConst.GOAL_EQUIP_GEM)
            {
            }
            else if (step.Goal == GameConst.GOAL_PET_LV)
            {
                result = string.Format(result, step.PetLv);
            }
            else if (step.Goal == GameConst.GOAL_GROW_LV)
            {
            }
            else if (step.Goal == GameConst.GOAL_STIGMA_LV)
            {
                DBStigma dbStigma = DBManager.Instance.GetDB <DBStigma>();
                DBStigma.DBStigmaInfo stigmaInfo = dbStigma.GetOneDBStigmaInfo(step.StigmaId);
                if (stigmaInfo != null)
                {
                    string name = stigmaInfo.Name;
                    result = string.Format(result, name);
                }
                else
                {
                    GameDebug.LogError("GetStepFixedDescription error, can not find stigma info by id " + step.StigmaId);
                }
            }
            else if (step.Goal == GameConst.GOAL_DRAGON_SOUL)
            {
                result = string.Format(result, step.ExpectResult);
            }
            else if (step.Goal == GameConst.GOAL_EQUIP_STRENGTH_TLV)
            {
                result = string.Format(result, step.EquipStrenghtLv);
            }
            else if (step.Goal == GameConst.GOAL_KILL_BOSS)
            {
                if (step.MonsterLevel > 0)
                {
                    result = string.Format(result, step.ExpectResult, step.MonsterLevel);
                }
                else
                {
                    result = string.Format(result, step.ExpectResult);
                }
            }
            else if (step.Goal == GameConst.GOAL_LIGHT_EQUIP)
            {
                List <string> names = DBManager.Instance.QuerySqliteField <string>(GlobalConfig.DBFile, "data_light_equip", "id", step.LightEquipLv.ToString(), "desc");
                if (names != null && names.Count > 0)
                {
                    result = string.Format(result, names[0]);
                }
            }
            else
            {
                result = TaskHelper.GetStepFixedDescriptionByLua(step);
            }
            return(result);
        }