瀏覽代碼

【优化】MMO-21011: 宠物仅分担人物来自怪物的伤害

meijun 3 年之前
父節點
當前提交
80ccbbaecd

+ 2 - 2
Common/CommonAI/Zone/Instance/InstanceUnit.cs

@@ -1094,9 +1094,9 @@ namespace CommonAI.Zone.Instance
 						hp = (int)(hp * XmdsConstConfig.PET_HEALD_RATIO);
 					}
 				}
-				else if(this.IsPlayer)
+				else if(this.IsPlayer && attacker.IsMonster)
 				{
-					//2.2 如果为玩家,伤害来源存在且为怪物,宠物可以分担伤害
+					//2.3 如果玩家受伤,伤害来源存在且为怪物,宠物可以分担伤害
 					InstanceUnit petUnit = this.Virtual.GetPetUnit();
 					if(petUnit != null)
 					{

+ 1 - 1
Common/CommonAI/Zone/Instance/InstanceZone.cs

@@ -816,7 +816,7 @@ namespace CommonAI.Zone.Instance
             add = null;
 			if (mObjects.UnitsCount >= mMaxUnitCount)
 			{
-				log.Warn(string.Format("Zone Unit TryAdd max: {0}, {1}, 单位数量:{2}", this.TerrainSrc.ID, info.TemplateID, mObjects.UnitsCount));
+				log.Warn(string.Format("--Zone AddUnit to max: {0}, UUID: {1}, ID: {2} 单位数量:{3}", this.GetSceneID(), this.UUID, info.TemplateID, mObjects.UnitsCount));
 				return null;
 			}
 

+ 2 - 2
Common/CommonAI/Zone/ZoneEditor/EditorDatas.cs

@@ -678,10 +678,10 @@ namespace CommonAI.Zone.ZoneEditor
 
         //---------------------------------------------------------
 
-        [DescAttribute("最大支持玩家数量", "战斗")]
+        [DescAttribute("最大支持玩家数量-废弃", "战斗")]
         public int MaxPlayer = 10;
         [DescAttribute("最大单位数量", "战斗")]
-        public int MaxUnit = 10000;
+        public int MaxUnit = 500;
 
 		[DescAttribute("连斩时间间隔", "战斗")]
 		public int killInterval = 0;

+ 1 - 1
Common/CommonAI/Zone/ZoneEditor/EditorScene.cs

@@ -147,7 +147,7 @@ namespace CommonAI.Zone.ZoneEditor
                     int f_value = (int)fv.FieldValue;
                     if (f_value == 0)
                     {
-                       // log.Info(string.Format("配平单位等级: {0} {1} {2}", fv.FieldOwner, fv.Field.Name, scene.DefaultUnitLevel));
+                        log.Info(string.Format("配平单位等级: 场景{0},filed:{1}-{2} -> {3}", scene.TemplateID, fv.FieldOwner, fv.Field.Name, scene.DefaultUnitLevel));
                         fv.Field.SetValue(fv.FieldOwner, scene.DefaultUnitLevel);
                     }
                 }

+ 1 - 1
XmdsServerCS/XmdsServerEdgeJS/Zone/ZoneService.cs

@@ -136,7 +136,7 @@ namespace XmdsServerEdgeJS.Zone
 			eventStat.Player = PlayerCount;
 			eventStat.Memory_MB = ProcessPrivateMemoryMB;
 			eventStat.Pool = ObjectPoolStatus.TotalActive + "/" + ObjectPoolStatus.TotalCount;
-			//monitorLog.Warn(eventStat);
+			monitorLog.Info(eventStat);
 
 			// 输出统计日志
 			if (JSGServerProfile.CheckPrintAllData())