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); }
private void StartMeeting(Hero hero) { var heroParty = hero.PartyBelongedTo?.Party; var player = Hero.MainHero; var playerParty = player.PartyBelongedTo?.Party; if (!hero.IsWanderer || heroParty != null) { keepEncounter = PlayerEncounter.Current; keepSettlement = player.PartyBelongedTo.CurrentSettlement; if (heroParty == null && hero.CurrentSettlement != null) { player.PartyBelongedTo.CurrentSettlement = hero.CurrentSettlement; } PlayerEncounter.Start(); PlayerEncounter.Current.SetupFields(playerParty, heroParty ?? playerParty); meetingEncounter = PlayerEncounter.Current; meetingHero = hero; Campaign.Current.TimeControlMode = CampaignTimeControlMode.Stop; Campaign.Current.CurrentConversationContext = ConversationContext.Default; AccessTools.Field(typeof(PlayerEncounter), "_mapEventState").SetValue(PlayerEncounter.Current, PlayerEncounterState.Begin); AccessTools.Field(typeof(PlayerEncounter), "_stateHandled").SetValue(PlayerEncounter.Current, true); AccessTools.Field(typeof(PlayerEncounter), "_meetingDone").SetValue(PlayerEncounter.Current, true); } ConversationCharacterData playerCharacterData = new ConversationCharacterData(CharacterObject.PlayerCharacter, playerParty); ConversationCharacterData conversationPartnerData = new ConversationCharacterData(hero.CharacterObject, heroParty); CampaignMission.OpenConversationMission(playerCharacterData, conversationPartnerData); }