Beispiel #1
0
        static public List <int> GetSpawnPointMonsterID(int levelID)
        {
            List <int> m_monsterIDs = new List <int>();

            if (SpawnPointLevelData.dataMap.ContainsKey(levelID))
            {
                var ids = SpawnPointLevelData.dataMap.Get(levelID).monsterId;
                if (ids != null)
                {
                    m_monsterIDs.AddRange(ids);
                }
            }
            List <int> models = new List <int>();

            foreach (var item in m_monsterIDs)
            {
                if (MonsterData.dataMap.ContainsKey(item))
                {
                    int model = MonsterData.GetData(item).model;
                    if (model > 0)
                    {
                        models.Add(model);
                    }
                }
                else
                {
                    LoggerHelper.Error(String.Format("cannot find id {0} in monster.xml", item));
                }
            }
            return(models.Distinct().ToList());
        }
    // 获得怪物信息
    string GetMonsterReportText(int enemyId, int count, bool isDead = false)
    {
        string reportText = "";

        if (MonsterData.dataMap.ContainsKey(enemyId))
        {
            int nameCode = MonsterData.GetData(enemyId).nameCode;
            if (LanguageData.dataMap.ContainsKey(nameCode))
            {
                reportText = LanguageData.dataMap[nameCode].content;
            }
            else
            {
                reportText += enemyId.ToString();
            }
        }
        else
        {
            reportText += enemyId.ToString();
        }
        reportText += "x" + count;

        if (isDead)
        {
            reportText += LanguageData.GetContent(46958);//"    (已击杀)";
        }
        return(reportText);
    }
Beispiel #3
0
        public override void CreateModel()
        {
            if (MogoWorld.inCity)//城里不允许创建
            {
                return;
            }

            if (clientTrapId == 0)
            {
                if (m_monsterId > 0)
                {
                    //Mogo.Util.LoggerHelper.Error("CreateModel:MogoWorld.thePlayer.ApplyMissionID" + MogoWorld.thePlayer.ApplyMissionID + " dif:" + (MogoWorld.thePlayer.ApplyMissionID == Mogo.Game.RandomFB.RAIDID ? MogoWorld.thePlayer.level : (int)m_difficulty));
                    m_monsterData = MonsterData.GetData((int)m_monsterId, MogoWorld.thePlayer.ApplyMissionID == Mogo.Game.RandomFB.RAIDID ? MogoWorld.thePlayer.level : (int)m_difficulty);

                    SetIntAttr("speed", m_monsterData.speed);
                    CreateActualModel();
                }
                else
                {
                    object skills = ObjectAttrs.GetValueOrDefault("skillBag", null);
                    if (skills == null)
                    {
                        return;
                    }

                    LuaTable   idTable = (LuaTable)skills;
                    List <int> args;
                    Mogo.Util.Utils.ParseLuaTable(idTable, out args);
                    List <int> tmpSkills = new List <int>();
                    for (int i = 0; i < args.Count; i++)
                    {
                        //tmpSkills.Add(2061);
                        //Mogo.Util.LoggerHelper.Error("tmpSkills.Add:" + (int)args[i]);
                        tmpSkills.Add((int)args[i]);
                    }
                    if (tmpSkills[0] == 2001)
                    {//战士大剑
                     //tmpSkills[1] = 2004;
                     //tmpSkills[2] = 2005;
                     //tmpSkills[3] = 2001;// 2006;
                     //tmpSkills[4] = 2021;//位移技能
                     //tmpSkills[6] = 2015;//咆哮
                    }
                    if (tmpSkills[0] == 2057)
                    {//刺客匕首
                     //tmpSkills[1] = 2060;
                     //tmpSkills[2] = 2061;
                     //tmpSkills[3] = 2062;
                     //tmpSkills[4] = 2071;//位移技能
                     //tmpSkills[6] = 2074;
                    }
                    if (tmpSkills[0] == 2101)
                    {//弓手弓
                     //tmpSkills[1] = 2104;
                     //tmpSkills[2] = 2105;
                     //tmpSkills[3] = 2106;
                     //tmpSkills[4] = 2121;//位移技能
                     //tmpSkills[6] = 2113;
                    }
                    if (tmpSkills[0] == 2151)
                    {//法师法杖
                     //tmpSkills[1] = 2154;
                     //tmpSkills[2] = 2155;
                     //tmpSkills[3] = 2156;
                     //tmpSkills[4] = 2171;//位移技能
                     //tmpSkills[6] = 2165;
                    }

                    if (m_factionFlag == 0)
                    { //是离线pvp玩家
                        switch (vocation)
                        {
                        case Vocation.Warrior:
                            m_monsterData = MonsterData.MercenaryDataFactory(0, 0, 0, 0, 10201, 5000, tmpSkills);
                            break;

                        case Vocation.Assassin:
                            m_monsterData = MonsterData.MercenaryDataFactory(0, 0, 0, 0, 10202, 5000, tmpSkills);
                            break;

                        case Vocation.Archer:
                            m_monsterData = MonsterData.MercenaryDataFactory(0, 0, 0, 0, 10203, 5000, tmpSkills);
                            break;

                        case Vocation.Mage:
                            m_monsterData = MonsterData.MercenaryDataFactory(0, 0, 0, 0, 10204, 5000, tmpSkills);
                            break;

                        default:
                            m_monsterData = MonsterData.MercenaryDataFactory(0, 0, 0, 0, 10011, 5000, tmpSkills);
                            break;
                        }
                        SetIntAttr("speed", 400);//临时对雇佣兵
                    }
                    else
                    {//是小伙伴
                        switch (vocation)
                        {
                        case Vocation.Warrior:
                            m_monsterData = MonsterData.MercenaryDataFactory(0, 0, 0, 0, 10101, 1000, tmpSkills);
                            break;

                        case Vocation.Assassin:
                            m_monsterData = MonsterData.MercenaryDataFactory(0, 0, 0, 0, 10102, 1000, tmpSkills);
                            break;

                        case Vocation.Archer:
                            m_monsterData = MonsterData.MercenaryDataFactory(0, 0, 0, 0, 10103, 1000, tmpSkills);
                            break;

                        case Vocation.Mage:
                            m_monsterData = MonsterData.MercenaryDataFactory(0, 0, 0, 0, 10104, 1000, tmpSkills);
                            break;

                        default:
                            m_monsterData = MonsterData.MercenaryDataFactory(0, 0, 0, 0, 10002, 1000, tmpSkills);
                            break;
                        }
                        SetIntAttr("speed", 600);//临时对雇佣兵
                    }



                    CreatePlayerActualModel();
                }
            }
            else
            {
                //AttachBuildingModel();
            }
        }
 public static MonsterData GetMonsterData(int monsterId)
 {
     return(MonsterData.GetData(monsterId));
 }