예제 #1
0
    static int GetSkillConfig(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        Games.Module.Wars.WarEnterData obj = (Games.Module.Wars.WarEnterData)LuaScriptMgr.GetNetObjectSelf(L, 1, "Games.Module.Wars.WarEnterData");
        int arg0 = (int)LuaScriptMgr.GetNumber(L, 2);

        Games.Module.Wars.ISkillConfig o = obj.GetSkillConfig(arg0);
        LuaScriptMgr.PushObject(L, o);
        return(1);
    }
예제 #2
0
        void CreateHero(int itemLegionId, int itemHeroId, int avatarId, string name, int quality, int skillId, int skillLevel, float[] hero2BuildProps, float[] props)
        {
            // 创建英雄单位数据UnitData
            UnitData unitData = new UnitData();

            unitData.unitType = UnitType.Hero;
            unitData.id       = GetHeroUID(itemHeroId, itemLegionId);

            // 将“英雄单位数据UnitData”保存到”势力数据LegionData“里
            LegionData legionData = legionDict[itemLegionId];

            legionData.heroUnitDatas.Add(itemHeroId, unitData);

            unitData.legionId = legionData.legionId;

            // 创建英雄数据HeroData
            HeroData heroData = new HeroData();

            heroData.heroUid        = unitData.id;
            heroData.heroId         = itemHeroId;
            heroData.name           = name;
            heroData.quality        = quality;
            heroData.avatarId       = avatarId;
            heroData.originalLegion = legionData.legionId;
            legionData.heroDatas.Add(heroData.heroId, heroData);
            legionData.heroInitProp.Add(heroData.heroId, props);
            legionData.hero2BuildProp.Add(heroData.heroId, hero2BuildProps);



            // 如果英雄技能激活了,生成英雄技能操作数据
            if (skillId > 0)
            {
                SkillOperateData skillData = new SkillOperateData();
                skillData.skillId     = skillId;
                skillData.uid         = GetSkillUID(skillData.skillId, legionData.legionId, heroData.heroId);
                skillData.skillLevel  = skillLevel;
                skillData.heroData    = heroData;
                skillData.skillConfig = enterData.GetSkillConfig(skillData.skillId);
                skillData.Init();
                heroData.skillOperateData = skillData;
                legionData.skillDatas.Add(skillData.uid, skillData);
                skillOperateDataForUID.Add(skillData.uid, skillData);
            }
        }