Beispiel #1
0
        public static DeclareMonster Create(int in_armor, int in_armor_if, int in_attack_type, string in_attributeValue, int in_blood, int in_brithVfx, int in_camp, int in_can_be_select, string in_damageInfo, int in_dead_feature, int in_dead_hit_fly, string in_dialog, int in_die_soundid, Int64 in_exp, int in_hit_fly_percent, int in_hP_num, int in_icon, int in_id, int in_level, Int64 in_maxHp, int in_monster_type, string in_name, int in_playerModel, string in_playerModelRes, int in_res, int in_score, int in_size_scale, int in_strike_distance, string in_task_cinematic, string in_taskShow, string in_title, string in_use_skills)
        {
            DeclareMonster tmp = new DeclareMonster();

            tmp._armor           = in_armor;
            tmp._armor_if        = in_armor_if;
            tmp._attack_type     = in_attack_type;
            tmp._attributeValue  = in_attributeValue;
            tmp._blood           = in_blood;
            tmp._brithVfx        = in_brithVfx;
            tmp._camp            = in_camp;
            tmp._can_be_select   = in_can_be_select;
            tmp._damageInfo      = in_damageInfo;
            tmp._dead_feature    = in_dead_feature;
            tmp._dead_hit_fly    = in_dead_hit_fly;
            tmp._dialog          = in_dialog;
            tmp._die_soundid     = in_die_soundid;
            tmp._exp             = in_exp;
            tmp._hit_fly_percent = in_hit_fly_percent;
            tmp._hP_num          = in_hP_num;
            tmp._icon            = in_icon;
            tmp._id              = in_id;
            tmp._level           = in_level;
            tmp._maxHp           = in_maxHp;
            tmp._monster_type    = in_monster_type;
            tmp._name            = in_name;
            tmp._playerModel     = in_playerModel;
            tmp._playerModelRes  = in_playerModelRes;
            tmp._res             = in_res;
            tmp._score           = in_score;
            tmp._size_scale      = in_size_scale;
            tmp._strike_distance = in_strike_distance;
            tmp._task_cinematic  = in_task_cinematic;
            tmp._taskShow        = in_taskShow;
            tmp._title           = in_title;
            tmp._use_skills      = in_use_skills;

            return(tmp);
        }
Beispiel #2
0
        public static void SetData()
        {
            if (_dataCaches == null && LuaEnv.isLoadLuaCfg)
            {
                long startTime = DateTime.Now.Ticks;
                Dictionary <int, int[]> dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataMonster");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataMonster = require 'Lua/Config/DataMonster'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataMonster");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareMonster>(6774);
                    foreach (var item in dic)
                    {
                        DeclareMonster tmp = new DeclareMonster();
                        tmp.Armor          = item.Value[0];
                        tmp.ArmorIf        = item.Value[1];
                        tmp.AttackType     = item.Value[2];
                        tmp.AttributeValue = CfgStringLua.Get(item.Value[3]);
                        tmp.Blood          = item.Value[4];
                        tmp.BrithVfx       = item.Value[5];
                        tmp.Camp           = item.Value[6];
                        tmp.CanBeSelect    = item.Value[7];
                        tmp.DamageInfo     = CfgStringLua.Get(item.Value[8]);
                        tmp.DeadFeature    = item.Value[9];
                        tmp.DeadHitFly     = item.Value[10];
                        tmp.Dialog         = CfgStringLua.Get(item.Value[11]);
                        tmp.DieSoundid     = item.Value[12];
                        tmp.Exp            = item.Value[13];
                        tmp.HitFlyPercent  = item.Value[14];
                        tmp.HPNum          = item.Value[15];
                        tmp.Icon           = item.Value[16];
                        tmp.Id             = item.Value[17];
                        tmp.Level          = item.Value[18];
                        tmp.MaxHp          = item.Value[19];
                        tmp.MonsterType    = item.Value[20];
                        tmp.Name           = CfgStringLua.Get(item.Value[21]);
                        tmp.PlayerModel    = item.Value[22];
                        tmp.PlayerModelRes = CfgStringLua.Get(item.Value[23]);
                        tmp.Res            = item.Value[24];
                        tmp.Score          = item.Value[25];
                        tmp.SizeScale      = item.Value[26];
                        tmp.StrikeDistance = item.Value[27];
                        tmp.TaskCinematic  = CfgStringLua.Get(item.Value[28]);
                        tmp.TaskShow       = CfgStringLua.Get(item.Value[29]);
                        tmp.Title          = CfgStringLua.Get(item.Value[30]);
                        tmp.UseSkills      = CfgStringLua.Get(item.Value[31]);

                        _dataCaches.Add(item.Key, tmp);
                    }
                }
                Record(startTime, DateTime.Now.Ticks, "Monster");
            }
            if (_dataCaches == null && _fillDataCallBack != null)
            {
                if (_dataCaches == null)
                {
                    long startTime = DateTime.Now.Ticks;
                    _dataCaches = new Dictionary <int, DeclareMonster>(6774);
                    _fillDataCallBack(_dataCaches);
                    Record(startTime, DateTime.Now.Ticks, "Monster");
                }
            }
        }