Browse Source

【需求】MMO-21747:新增道具释放发生通用事件(新增一个新年道具,爆竹)

meijun 3 years ago
parent
commit
966b3c73f9

+ 9 - 0
XmdsServerCS/XmdsServerEdgeJS/Zone/ZoneServiceICE.cs

@@ -541,6 +541,11 @@ namespace XmdsServerEdgeJS.Zone
 				{
 					try
 					{
+                        if(eventId <= 0)
+                        {
+                            log.Warn("r2b_notify_triggrBattleFunction 错误事件id:" + playerId + ", " + eventId);
+                            return;
+                        }
 						if(value1 == 0 && value2 == 0 && value3 == 0 && value4 == 0 && value5 == 0 && value6 == 0)
 						{
 							XmdsVirtual virtualUnit = (player.BindingActor.Virtual as XmdsVirtual);
@@ -558,6 +563,10 @@ namespace XmdsServerEdgeJS.Zone
 					}					
 				});
 			}
+            else
+            {
+                log.Warn("r2b_notify_triggrBattleFunction player not exists:" + playerId + ", " + eventId);
+            }
         }
 
         /// <summary>

+ 58 - 0
XmdsVSPlugins/XmdsCommonSkill/Plugin/FunctionEvent/base_gs/XmdsBattleFunctionEvent_9501.cs

@@ -0,0 +1,58 @@
+using CommonAI.Zone;
+using CommonAI.Zone.Helper;
+using CommonAI.Zone.Instance;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using XmdsCommon.Plugin;
+using XmdsCommonServer.Plugin;
+using XmdsCommonServer.XLS.Data;
+using XmdsCommonSkill.Plugin.Buffs;
+using XmdsCommonSkill.Plugin.Interface;
+
+namespace XmdsCommonSkill.Plugin.FunctionEvent
+{
+	/** 释放一个法术 */
+	public class XmdsBattleFunctionEvent_9501 : XmdsBattleFunctionEventBase
+    {
+        public static readonly int EventID = 9501;
+		public LaunchSpell mBindSpell;
+		public override int GetEventID() { return EventID; }
+
+		protected override bool OnInit()
+		{
+			BuffConfig config = XmdsDataMgr.GetInstance().GetBuffConfigData(this.GetConfigID());
+			int BindSpellID = System.Int32.Parse(config.ValueSet1);
+
+			mBindSpell = ComSpellTemplate.Instance().GetSpellBySpellID(BindSpellID);
+			return mBindSpell != null;
+		}
+
+		//value1-目标怪物id, value2-目标objId
+		//value3...配置表参数
+		protected override void OnTriggerEvent(XmdsVirtual launcher, int value1, int value2, int value3, int value4, int value5, int value6)
+		{
+			if (this.mBindSpell == null)
+            {
+				log.Warn("XmdsBattleFunctionEvent_9501 法术不存在:" + launcher.mUnit.PlayerUUID + ", " + value1 + ", " + value2);
+				return;
+            }
+
+			InstanceUnit target = (value2 == 0 || value2 == launcher.mUnit.ID) ? launcher.mUnit : launcher.mUnit.Parent.getUnitByID(value2);
+			if(target == null)
+            {
+				log.Warn("XmdsBattleFunctionEvent_9501 目标不存在:" + launcher.mUnit.PlayerUUID + ", " + value1 + ", " + value2);
+				return;
+            }
+			else if(value4 != target.ID)
+            {
+				log.Warn("XmdsBattleFunctionEvent_9501 作用目标异常:" + launcher.mUnit.PlayerUUID + ", " + value1 + ", " + value2
+					+ ", 获取目标:" + target.ID + ", " + target.Info.ID);
+				//return;
+			}
+
+			launcher.mUnit.Parent.unitLaunchSpell(XmdsSkillType.none, launcher.mUnit, this.mBindSpell, launcher.mUnit.X, launcher.mUnit.Y, target.ID);					
+		}
+	}
+}

+ 1 - 0
XmdsVSPlugins/XmdsCommonSkill/XmdsCommonSkill.csproj

@@ -144,6 +144,7 @@
     <Compile Include="Plugin\Buffs\Xmds_Fridge.cs" />
     <Compile Include="Plugin\base\JSGPlayerCardSkillBase.cs" />
     <Compile Include="Plugin\FunctionEvent\base\XmdsBattleFunctionEvent_9003.cs" />
+    <Compile Include="Plugin\FunctionEvent\base_gs\XmdsBattleFunctionEvent_9501.cs" />
     <Compile Include="Plugin\PassiveSkills\other\Other_100105.cs" />
     <Compile Include="Plugin\Skills\CardSkill\00_base\CardSkill_XuanWuBase.cs" />
     <Compile Include="Plugin\Skills\CardSkill\00_base\CardSkill_LiangYiBase.cs" />