From ea185afc20a915d15eae8adb07d0acd837f3c210 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期一, 01 十二月 2025 11:37:29 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts

---
 Main/System/InternalAffairs/FuncNPCManager.cs |   35 +++++++++++++++++++++++++++++++++--
 1 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/Main/System/InternalAffairs/FuncNPCManager.cs b/Main/System/InternalAffairs/FuncNPCManager.cs
index e2d3b72..6d482f2 100644
--- a/Main/System/InternalAffairs/FuncNPCManager.cs
+++ b/Main/System/InternalAffairs/FuncNPCManager.cs
@@ -1,6 +1,5 @@
 锘縰sing System.Collections.Generic;
 using System.Linq;
-using Codice.Client.Common;
 using LitJson;
 using UnityEngine;
 
@@ -17,6 +16,10 @@
     public List<int> guildTalkIndexList = new List<int>();
     public float lastGuildTalkTime;
     public int lastGuildRandomIndex;
+
+    //琛屽晢鐗规畩澶勭悊
+    public bool isHawkerShowNow = false; //琛屽晢鐘舵�侊紝true 琛屽晢璧板嚭鏉ュ拰绔欏矖涓紝false 琛屽晢璧板嚭鍘诲拰澶栧嚭涓�
+    public bool isHawkerStandBy = false; //琛屽晢鐘舵�侊紝true 琛屽晢绔欏矖涓紝鍙湁true鎵嶈兘鍙備笌鍠婅瘽锛涚Щ鍔ㄦ垨鑰呮秷澶遍兘涓篺alse
 
 
     public override void Init()
@@ -70,9 +73,28 @@
 
     public int GetRandomGuildNpcTalk()
     {
-        int index = Random.Range(0, guildTalkIndexList.Count);
+        //琛屽晢鐗规畩澶勭悊锛岃鍟嗛潪绔欏矖涓笉鍙備笌鍠婅瘽
+        int index;
+        if (isHawkerStandBy)
+        {
+            index = Random.Range(0, guildTalkIndexList.Count);
+        }
+        else
+        {
+            if (guildTalkIndexList.Count == 1)
+            {
+                return -1;
+            }
+            index = Random.Range(1, guildTalkIndexList.Count);
+        }
         if (index == lastGuildRandomIndex)
         {
+            if (guildTalkIndexList.Count == 1)
+            {
+                //鍙湁涓�涓殑鎯呭喌
+                lastGuildRandomIndex = -1;
+                return -1;
+            }
             index = (index + 1) % guildTalkIndexList.Count;
         }
         lastGuildRandomIndex = index;
@@ -88,5 +110,14 @@
         }
         return null;
     }
+
+    public string GetGuildTalk(int skinID)
+    {
+        if (guildNpcTalkDic.ContainsKey(skinID))
+        {       
+            return guildNpcTalkDic[skinID][Random.Range(0, guildNpcTalkDic[skinID].Length)];
+        }
+        return null;
+    }
 }
 

--
Gitblit v1.8.0