public override void OnMissionBehaviourInitialize(Mission mission) { if (!disabled && !mission.HasMissionBehaviour <TournamentXPandedMatchBehavior>() && (mission.HasMissionBehaviour <TournamentArcheryMissionController>() || mission.HasMissionBehaviour <TournamentJoustingMissionController>() || mission.HasMissionBehaviour <TownHorseRaceMissionController>() || mission.HasMissionBehaviour <TournamentFightMissionController>() )) { if (TournamentXPSettings.Instance.BonusRenownFirstKill > 0 || TournamentXPSettings.Instance.BonusRenownLeastDamage > 0 || TournamentXPSettings.Instance.BonusRenownMostDamage > 0 || TournamentXPSettings.Instance.BonusRenownMostKills > 0) { foreach (var t in TournamentsXPandedBehavior.Tournaments) { t.Active = false; } var tournamentInfo = TournamentsXPandedBehavior.GetTournamentInfo(Settlement.CurrentSettlement.Town); tournamentInfo.Rewards = new TournamentReward(); tournamentInfo.Active = true; var mb = mission.GetMissionBehaviour <TournamentBehavior>(); mission.AddMissionBehaviour(new TournamentXPandedMatchBehavior(mb)); mission.AddListener(new TournamentXPandedMatchListener(mb)); } } }
public void StartDialogue(Hero targetHero) { PartyBase heroParty = PartyBase.MainParty; PartyBase targetParty = targetHero.PartyBelongedTo?.Party; bool isCivilian = false; if (targetParty == null) { targetParty = targetHero.CurrentSettlement?.Party ?? targetHero.BornSettlement?.Party; isCivilian = true; } PlayerEncounter.Start(); PlayerEncounter.Current.SetupFields(heroParty, targetParty ?? heroParty); string specialScene = ""; string sceneLevels = ""; Campaign.Current.CurrentConversationContext = ConversationContext.Default; Mission conversationMission = (Mission)Campaign.Current.CampaignMissionManager.OpenConversationMission( new ConversationCharacterData(Hero.MainHero.CharacterObject, heroParty, true, false, false, isCivilian), new ConversationCharacterData(targetHero.CharacterObject, targetParty, true, false, false, isCivilian), specialScene, sceneLevels); conversationMission.AddListener(this); }
public void Initialize(Mission mission) { mission.AddListener(this); }