// ------------- // Spawn Robot // ------------- string RobotArray[25]; int WeaponArray[18]; if (var_demoVersion == 0) { RobotArray[0] = "ce01"; RobotArray[1] = "ce02"; RobotArray[2] = "ce03"; RobotArray[3] = "ce04"; RobotArray[4] = "ce05"; RobotArray[5] = "ce06"; RobotArray[6] = "ce07"; RobotArray[7] = "ce08"; RobotArray[8] = "ce10"; RobotArray[9] = "ce11"; RobotArray[10] = "ce12"; RobotArray[11] = "ce13"; RobotArray[12] = "ce14"; RobotArray[13] = "ce15"; RobotArray[14] = "ce16"; RobotArray[15] = "cw01"; RobotArray[16] = "cw02"; RobotArray[17] = "cw03"; RobotArray[18] = "cw04"; RobotArray[19] = "cw05"; RobotArray[20] = "cw06"; RobotArray[21] = "cw07"; RobotArray[22] = "cw08"; RobotArray[23] = "cw10"; RobotArray[24] = "cw11"; WeaponArray[0] = 10; WeaponArray[1] = 12; WeaponArray[2] = 20; WeaponArray[3] = 22; WeaponArray[4] = 30; WeaponArray[5] = 32; WeaponArray[6] = 40; WeaponArray[7] = 42; WeaponArray[8] = 50; WeaponArray[9] = 52; WeaponArray[10] = 60; WeaponArray[11] = 62; WeaponArray[12] = 70; WeaponArray[13] = 72; WeaponArray[14] = 80; WeaponArray[15] = 82; WeaponArray[16] = 90; WeaponArray[17] = 92; } else { RobotArray[0] = "cw01"; RobotArray[1] = "cw01"; RobotArray[2] = "cw01"; RobotArray[3] = "cw01"; RobotArray[4] = "cw01"; RobotArray[5] = "cw01"; RobotArray[6] = "cw03"; RobotArray[7] = "cw03"; RobotArray[8] = "cw03"; RobotArray[9] = "cw03"; RobotArray[10] = "cw03"; RobotArray[11] = "cw03"; RobotArray[12] = "cw05"; RobotArray[13] = "cw05"; RobotArray[14] = "cw05"; RobotArray[15] = "cw05"; RobotArray[16] = "cw05"; RobotArray[17] = "cw05"; RobotArray[18] = "ce04"; RobotArray[19] = "ce04"; RobotArray[20] = "ce04"; RobotArray[21] = "ce04"; RobotArray[22] = "ce04"; RobotArray[23] = "ce04"; RobotArray[24] = "ce04"; WeaponArray[0] = 20; WeaponArray[1] = 20; WeaponArray[2] = 20; WeaponArray[3] = 20; WeaponArray[4] = 40; WeaponArray[5] = 40; WeaponArray[6] = 40; WeaponArray[7] = 40; WeaponArray[8] = 50; WeaponArray[9] = 50; WeaponArray[10] = 50; WeaponArray[11] = 50; WeaponArray[12] = 70; WeaponArray[13] = 70; WeaponArray[14] = 70; WeaponArray[15] = 70; WeaponArray[16] = 50; WeaponArray[17] = 70; } void SetAIDifficulty(int charaId) { SetCharaWeapon(charaId, WeaponArray[rand()%18]); if (var_AIPlayerLevel == 0) { AI_Easy(0, charaId); var_aiLockCountLimit = 3; } else if (var_AIPlayerLevel == 1) { AI_Normal(0, charaId); var_aiLockCountLimit = 4; } else if (var_AIPlayerLevel == 2) { AI_Hard(0, charaId); var_aiLockCountLimit = 5; } } void SpawnRobot() { // if (GetRound() != 0) // return; float x, y, z, dx; int charaID, i, c, t; int numAI, numTeamA, numTeamB; numAI = numTeamA = numTeamB = 0; // get current AI number for (i = 0 ; i < GetNumCharas() ; i++) { c = GetChara(i); if (!GetCharaPlayer(c)) numAI++; t = GetCharaAttrib(c, CHARA_TEAM); if (t == 1) numTeamA++; else if (t == 2) numTeamB++; } if (var_rule == RULE_DEATH_MATCH) { for (i = numAI ; i < var_numAIPlayers ; i++) { if (GetNumCharas() >= var_ruleMaxPlayers) return; GetCharaSpawnPoint(0, x, y, z, dx); charaID = SpawnChara(RobotArray[rand()%25], x, y, z, dx); SetAIDifficulty(charaID); } } else if (var_rule == RULE_GIANT_KILL) { for (i = numAI ; i < var_numAIPlayers ; i++) { if (GetNumCharas() >= var_ruleMaxPlayers) return; if ( (numTeamA < 2) && (numTeamB >= numTeamA*7) ) { GetCharaSpawnPoint(1, x, y, z, dx); charaID = SpawnChara(RobotArray[rand()%25], x, y, z, dx, 1); SetAIDifficulty(charaID); numTeamA++; } else { GetCharaSpawnPoint(2, x, y, z, dx); charaID = SpawnChara(RobotArray[rand()%25], x, y, z, dx, 2); SetAIDifficulty(charaID); numTeamB++; } } } else if ( (var_rule == RULE_TEAM_DEATH_MATCH) || (var_rule == RULE_VIP) ) { for (i = numAI ; i < var_numAIPlayers ; i++) { if (GetNumCharas() >= var_ruleMaxPlayers) return; if (numTeamA > numTeamB) { GetCharaSpawnPoint(2, x, y, z, dx); charaID = SpawnChara(RobotArray[rand()%25], x, y, z, dx, 2); numTeamB++; } else { GetCharaSpawnPoint(1, x, y, z, dx); charaID = SpawnChara(RobotArray[rand()%25], x, y, z, dx, 1); numTeamA++; } SetAIDifficulty(charaID); } } else if ( var_rule == RULE_ONE_ON_ONE ) { for (i = numAI ; i < var_numAIPlayers ; i++) { if (GetNumCharas() >= var_ruleMaxPlayers) return; GetCharaSpawnPoint(0, x, y, z, dx); charaID = SpawnChara(RobotArray[rand()%25], x, y, z, dx, 1); SetAIDifficulty(charaID); } } }