コード例 #1
0
 public override bool FireEvent(Event E)
 {
     if (E.ID == "PlayerBeginConversation")
     {
         QudUX_ConversationHelper.PlayerBody = XRLCore.Core.Game.Player.Body;
         GameObject speaker = E.GetGameObjectParameter("Speaker");
         if (speaker != null)
         {
             QudUX_ConversationHelper.ConversationPartner = speaker;
             if (QudUX_ConversationHelper.CurrentInteractionZoneID != speaker.CurrentCell.ParentZone.ZoneID)
             {
                 QudUX_ConversationHelper.ZoneTradersTradedWith.Clear();
                 QudUX_ConversationHelper.CurrentInteractionZoneID = speaker.CurrentCell.ParentZone.ZoneID;
             }
             string       questID = speaker.GetStringProperty("GivesDynamicQuest", string.Empty);
             Conversation convo   = E.GetParameter <Conversation>("Conversation");
             if (speaker.HasPart("GenericInventoryRestocker") || speaker.HasPart("Restocker"))
             {
                 try
                 {
                     QudUX_ConversationHelper.AddChoiceToRestockers(convo, speaker);
                 }
                 catch (Exception ex)
                 {
                     Debug.Log("QudUX: (Error) Encountered exception while adding conversation choice to merchant to ask about restock duration.\nException details: \n" + ex.ToString());
                 }
             }
             if (questID == string.Empty || XRLCore.Core.Game.FinishedQuests.ContainsKey(questID)) //speaker has no dynamic quests
             {
                 try
                 {
                     this.AddChoiceToIdentifyQuestGivers(convo, speaker);
                 }
                 catch (Exception ex)
                 {
                     Debug.Log("QudUX: (Error) Encountered exception while adding conversation choices to identify village quest givers.\nException details: \n" + ex.ToString());
                 }
             }
         }
     }
     return(base.FireEvent(E));
 }
コード例 #2
0
 public static void SetTraderInteraction(GameObject trader)
 {
     QudUX_ConversationHelper.ZoneTradersTradedWith.Add(trader);
     QudUX_ConversationHelper.AddChoiceToRestockers();
 }