示例#1
0
        public DungeonPlacement(string scene, string locator, Hashtable data)
        {
            this.locator = locator;
            role         = EB.Dot.String("role", data, string.Empty);
            pos          = EB.Dot.String("pos", data, string.Empty);
            attr         = EB.Dot.String("tag_attribute", data, string.Empty);
            is_fighting  = EB.Dot.Bool("busy", data, false);
            if (role == NPC_ROLE.CAMPAIGN_ENEMY || role == NPC_ROLE.CAMPAIGN_BOX)
            {
                var tpl = Hotfix_LT.Data.SceneTemplateManager.Instance.GetEncounter(scene, locator);
                isappearing  = tpl.is_appearing;
                appearingway = tpl.encounter_appearing_way;
                encounter    = tpl.encounter_prefab;
                script       = tpl.script;
                layout       = tpl.combat_layout_name;
            }
            else if (role == NPC_ROLE.GHOST)
            {
                string tmp = locator.Remove(locator.LastIndexOf("_") + 1);
                var    tpl = Hotfix_LT.Data.SceneTemplateManager.Instance.GetMainLandsGhost(scene, tmp);
                isappearing  = 1;
                appearingway = 1;
                encounter    = tpl.encounter_prefab;
                script       = tpl.script;
                layout       = tpl.combat_layout_name;
            }
            else if (role == NPC_ROLE.ALLIANCE_CAMPAIGN_ENEMY || role == NPC_ROLE.ALLIANCE_CAMPAIGN_BOSS)
            {
                var tpl = Hotfix_LT.Data.SceneTemplateManager.Instance.GetAllianceEncounter(scene, locator);
                isappearing  = tpl.is_appearing;
                appearingway = tpl.encounter_appearing_way;
                encounter    = tpl.encounter_prefab;
                script       = tpl.script;
                layout       = tpl.combat_layout_name;
            }
            else if (role == NPC_ROLE.WORLD_BOSS)
            {
                var tpl = Hotfix_LT.Data.SceneTemplateManager.Instance.GetMainLandEncounter(scene, locator);
                isappearing  = tpl.is_appearing;
                appearingway = tpl.encounter_appearing_way;

                //encounter = tpl.encounter_prefab;
                string[] split     = tpl.encounter_prefab.Split(',');
                string   curLayout = EB.Dot.String("bossLayoutId", data, string.Empty);
                if (string.IsNullOrEmpty(curLayout))
                {
                    if (!DataLookupsCache.Instance.SearchDataByID("mainlands.lastWeekBossLayoutId", out curLayout))
                    {
                        curLayout = "Layout50103";
                    }
                }
                int bossIndex = Hotfix_LT.Data.EventTemplateManager.Instance.GetWorldBossIndex(curLayout);
                encounter = bossIndex < 0 ? string.Empty : split[bossIndex];

                script = tpl.script;
                layout = tpl.combat_layout_name;
            }
            else if (role == NPC_ROLE.ARENA_MODLE)//角斗场胜利者模型
            {
                var tpl = Hotfix_LT.Data.SceneTemplateManager.Instance.GetMainLandEncounter(scene, locator);
                isappearing  = tpl.is_appearing;
                appearingway = tpl.encounter_appearing_way;
                //ArenaModelData AData = ArenaManager.Instance.GetArenaModelData();
                string Tid;
                DataLookupsCache.Instance.SearchDataByID <string>(ArenaManager.ArenaModelDataId + ".templateId", out Tid);
                Tid = (Tid == null || Tid.CompareTo("") == 0) ? "15011" : Tid;

                string characterid = Hotfix_LT.Data.CharacterTemplateManager.Instance.TemplateidToCharacterid(Tid);
                int    Skin;
                DataLookupsCache.Instance.SearchIntByID(ArenaManager.ArenaModelDataId + ".skin", out Skin);
                var    charTpl = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(characterid, Skin);
                string ModelId = charTpl.model_name; //需添加皮肤
                encounter = ModelId == null ? tpl.encounter_prefab : ModelId;
                script    = tpl.script;
                layout    = tpl.combat_layout_name;
            }
            else
            {
                var tpl = Hotfix_LT.Data.SceneTemplateManager.Instance.GetMainLandEncounter(scene, locator);
                if (tpl != null)
                {
                    isappearing  = tpl.is_appearing;
                    appearingway = tpl.encounter_appearing_way;
                    encounter    = tpl.encounter_prefab;
                    script       = tpl.script;
                    layout       = tpl.combat_layout_name;
                }
            }
        }