Not tested ....
Code:
public override void OnTrigger(int missionNumber, string shortName, active)
{
base.OnTrigger(missionNumber, shortName, active);
if ("F1".Equals(shortName) && active)
{
AiAction action = GamePlay.gpGetAction(shortName);
if (action != null)
{
// action.Do(); // doesn't matter what the pre-set trigger action was, we'll do something different
List<string> RandomMissions = GetFilenamesFromDirectory(CLOD_PATH + FILE_PATH + "/red", "bomber"); // bomber missions from the red directory
if (RandomMissions.Count > 0)
{
string RandomMission = RandomMissions[random.Next(RandomMissions.Count)];
GamePlay.gpPostMissionLoad(RandomMission);
}
}
GamePlay.gpGetTrigger("F1").Enable = true; // need to reactivate the trigger, can be time delayed if u want
}
}
Bookmarks