XmdsBattleFunctionEvent_9001.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using CommonAI.Zone;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using XmdsCommon.Plugin;
  7. using XmdsCommonServer.Plugin;
  8. using XmdsCommonServer.XLS.Data;
  9. using XmdsCommonSkill.Plugin.Buffs;
  10. namespace XmdsCommonSkill.Plugin.FunctionEvent
  11. {
  12. public class XmdsBattleFunctionEvent_9001 : XmdsBattleFunctionEventBase
  13. {
  14. public static readonly int EventID = 9001;
  15. private int Buff_Value = 0;
  16. private int Buff_LifeTime = 0;
  17. public override int GetEventID() { return EventID; }
  18. protected override bool OnInit()
  19. {
  20. BuffConfig config = base.GetBuffConfig();
  21. Buff_Value = System.Int32.Parse(config.ValueSet1);
  22. Buff_LifeTime = System.Int32.Parse(config.ValueSet2);
  23. return XmdsBuffFactory.GetInstance().XmdsBuffPackTest(base.mBuff_ID, XmdsBuffProperties.XmdsBuffAbility.MoveSpeedDown);
  24. }
  25. protected override void OnTriggerEvent(XmdsVirtual target, XmdsVirtual sender)
  26. {
  27. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(base.mBuff_ID);
  28. XmdsBuff_MoveSpeedDown buff = (XmdsBuff_MoveSpeedDown)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.MoveSpeedDown);
  29. buff.ChangePercent = -Buff_Value; // 减速
  30. BuffTemplate bt = pack.mBuffTemplate;
  31. bt.LifeTimeMS = Buff_LifeTime;
  32. pack.BindTemplateAndDispose();
  33. target.mUnit.AddBuff(bt, sender.mUnit);
  34. }
  35. }
  36. }