XmdsBattleFunctionEvent_9501.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using CommonAI.Zone;
  2. using CommonAI.Zone.Helper;
  3. using CommonAI.Zone.Instance;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using XmdsCommon.Plugin;
  9. using XmdsCommonServer.Plugin;
  10. using XmdsCommonServer.XLS.Data;
  11. using XmdsCommonSkill.Plugin.Buffs;
  12. using XmdsCommonSkill.Plugin.Interface;
  13. namespace XmdsCommonSkill.Plugin.FunctionEvent
  14. {
  15. /** 释放一个法术 */
  16. public class XmdsBattleFunctionEvent_9501 : XmdsBattleFunctionEventBase
  17. {
  18. public static readonly int EventID = 9501;
  19. public LaunchSpell mBindSpell;
  20. public override int GetEventID() { return EventID; }
  21. protected override bool OnInit()
  22. {
  23. BuffConfig config = XmdsDataMgr.GetInstance().GetBuffConfigData(this.GetConfigID());
  24. int BindSpellID = System.Int32.Parse(config.ValueSet1);
  25. mBindSpell = ComSpellTemplate.Instance().GetSpellBySpellID(BindSpellID);
  26. return mBindSpell != null;
  27. }
  28. //value1-目标怪物id, value2-目标objId
  29. //value3...配置表参数
  30. protected override void OnTriggerEvent(XmdsVirtual launcher, int value1, int value2, int value3, int value4, int value5, int value6)
  31. {
  32. if (this.mBindSpell == null)
  33. {
  34. log.Warn("XmdsBattleFunctionEvent_9501 法术不存在:" + launcher.mUnit.PlayerUUID + ", " + value1 + ", " + value2);
  35. return;
  36. }
  37. InstanceUnit target = (value2 == 0 || value2 == launcher.mUnit.ID) ? launcher.mUnit : launcher.mUnit.Parent.getUnitByID(value2);
  38. if(target == null)
  39. {
  40. log.Warn("XmdsBattleFunctionEvent_9501 目标不存在:" + launcher.mUnit.PlayerUUID + ", " + value1 + ", " + value2);
  41. return;
  42. }
  43. else if(value4 != target.ID)
  44. {
  45. log.Warn("XmdsBattleFunctionEvent_9501 作用目标异常:" + launcher.mUnit.PlayerUUID + ", " + value1 + ", " + value2
  46. + ", 获取目标:" + target.ID + ", " + target.Info.ID);
  47. //return;
  48. }
  49. launcher.mUnit.Parent.unitLaunchSpell(XmdsSkillType.none, launcher.mUnit, this.mBindSpell, launcher.mUnit.X, launcher.mUnit.Y, target.ID);
  50. }
  51. }
  52. }