private Challenge CreateChallenge(ChallengeConfig challengeConfig, List <IAction> actions, DungeonLogic dungeonLogic) { Trigger startTrigger = CreateTrigger(challengeConfig.StartTrigger()); SpawnOverTime sot = CreateSpawnOverTime(challengeConfig.SpawnConfig()); List <TrackerConfig> trackerConfigs = challengeConfig.SpawnConfig().TrackerConfigs(); foreach (TrackerConfig trackerConfig in trackerConfigs) { if (!trackerConfig.IsActive()) { continue; } Tracker tracker = CreateTracker(trackerConfig); sot.AddTracker(tracker); } // List<ActionConfig> actionConfigs = challengeConfig.SpawnConfig().ActionConfigs(); // foreach (ActionConfig actionConfig in actionConfigs) // { // if (actionConfig.IsDisabled()) continue; // // IAction action = CreateAction(actionConfig, dungeonLogic); // sot.AddAction(action); // } foreach (IAction action in actions) { sot.AddAction(action); } DefaultChallenge challenge = new DefaultChallenge(startTrigger, sot); return(challenge); }
public static void SendChallengeResultMessage(IPacketReceiver client, DefaultChallenge challenge) { client.Send(new ChallengeResultMessage((short)challenge.Id, challenge.Status == ChallengeStatusEnum.SUCCESS)); }
public static void SendChallengeInfoMessage(IPacketReceiver client, DefaultChallenge challenge) { client.Send(new ChallengeInfoMessage((short)challenge.Id, challenge.Target != null ? challenge.Target.Id : -1, challenge.Bonus, challenge.Bonus)); }