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); } } }