示例#1
0
        private ServerNpcModel buildRandomNPC(int npcLevel, int npcTeamID, RarityType minRarityType, RarityType maxRarityType)
        {
            RarityType npcRarity = RarityConstants.GetRandomRarityRange(minRarityType, maxRarityType);
            NpcRole    npcRole   = (NpcRole)RandomGen.GetIntRange(0, NumNpcRoles - 1);
            NpcRace    npcRace   = (NpcRace)RandomGen.GetIntRange(0, NumNpcRaces - 1);
            NpcSize    npcSize   = (NpcSize)RandomGen.GetIntRange(0, NumNpcSizes - 1);

            // TODO: determine better naming scheme. For now just join Size+Race+Role;
            string npcName = npcSize.ToString() + " " + npcRace.ToString() + " " + npcRole.ToString();

            // Build combatant model
            AbilityItemModel[] randomAbilities = getRandomNPCAbilities((int)npcRarity + 1, npcLevel);
            CombatantModel     combatantModel  = BuildCombatantSCMD.Execute(npcLevel, npcTeamID, randomAbilities, npcRarity);

            // TODO: determine behaviour based on role. For now use default
            CombatBehaviourBase combatBehaviour = new AbilityCycleBehaviour();

            ServerNpcModel serverNpcModel = new ServerNpcModel(combatBehaviour, "", npcName, npcRole, npcRace, npcSize, npcRarity, combatantModel);

            DetermineNPCDropTableSCMD.Execute(serverNpcModel);
            return(serverNpcModel);
        }