SpecialFun_2000.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using CommonAI.Zone;
  2. using CommonLang;
  3. using XmdsCommon.Plugin;
  4. using XmdsCommonServer.Plugin;
  5. using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
  6. using XmdsCommonServer.XLS.Data;
  7. using XmdsCommonSkill.Plugin.Buffs;
  8. using static CommonAI.Zone.Instance.InstanceUnit;
  9. namespace XmdsCommonSkill.Plugin.FunctionEvent
  10. {
  11. /// <summary>
  12. /// 特殊效果 - 穿云箭。提供N层可叠加的buff
  13. /// </summary>
  14. public class SpecialFun_2000 : XmdsBattleFunctionEventBase
  15. {
  16. public static readonly int EventID = 2000;
  17. public static int Buff_ID = 2000;
  18. public override int GetEventID() { return EventID; }
  19. protected override bool OnInit()
  20. {
  21. return XmdsBuffFactory.GetInstance().XmdsBuffPackTest(Buff_ID, XmdsBuffProperties.XmdsBuffAbility.PropChange);
  22. }
  23. protected override void OnTriggerEvent(XmdsVirtual target, int value1, int value2, int value3, int value4, int value5, int value6)
  24. {
  25. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  26. var buff1 = pack.GetXmdsBuff(0) as XmdsBuff_PropChange;
  27. buff1.IsPercent = false;
  28. buff1.CurrentValue = value1;
  29. buff1.CurentChangeType = XmdsVirtual.UnitAttributeType.AllDmgAdd;
  30. BuffTemplate bt = pack.mBuffTemplate;
  31. bt.IsHarmful = false;
  32. bt.LifeTimeMS = value2;
  33. pack.BindTemplateAndDispose();
  34. ////多层效果叠加
  35. //BuffState oldBuff = target.mUnit.GetBuffByID(Buff_ID);
  36. //if(oldBuff != null)
  37. //{
  38. // buff1.CurrentValue = value1 * (1 + oldBuff.OverlayLevel);
  39. //}
  40. target.mUnit.AddBuff(bt, target.mUnit);
  41. }
  42. }
  43. }