Skill_910110.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using CommonAI.Zone;
  2. using CommonAI.Zone.Helper;
  3. using CommonAI.Zone.Instance;
  4. using System;
  5. using XmdsCommon.Plugin;
  6. using XmdsCommonServer.Plugin;
  7. using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
  8. using XmdsCommonServer.XLS.Data;
  9. using XmdsCommonSkill.Plugin.Buffs;
  10. using XmdsCommonSkill.Plugin.PassiveSkills.Magic;
  11. using static CommonAI.Zone.Instance.InstanceUnit;
  12. using static XmdsCommonSkill.Plugin.Buffs.XmdsBuff_SwordShadow;
  13. namespace XmdsCommonSkill.Plugin.Skills.Magic
  14. {
  15. /// <summary>
  16. /// 增强buff(新buffid 效果:增加n%攻击力)
  17. /// </summary>
  18. public class Skill_910110 : XmdsSkillBase
  19. {
  20. public static readonly int ID = 910110;
  21. public override int SkillID { get { return ID; } }
  22. private static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.PROP_CHANGE_1;
  23. private static XmdsSkillValue dmg;
  24. private static XmdsSkillValue valueSet0; // 攻击提升值
  25. protected override void OnSkillDamagePerEvent(BattleParams param)
  26. {
  27. param.SkillDamagePer = dmg.GetValue();
  28. }
  29. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  30. {
  31. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  32. //攻击
  33. XmdsBuff_PropChange buff = (XmdsBuff_PropChange)pack.GetXmdsBuff(0);
  34. buff.CurentChangeType = XmdsVirtual.UnitAttributeType.Attack;
  35. buff.CurrentValue = valueSet0.GetValue(1, 1);
  36. buff.IsPercent = true;
  37. BuffTemplate bt = pack.mBuffTemplate;
  38. bt.IsHarmful = true;
  39. bt.LifeTimeMS = valueSet0.GetValue(1, 2);
  40. pack.BindTemplateAndDispose();
  41. unit.RegistSendBuff(bt);
  42. unit.RegistLaunchSkillOver(OnLaunchSkillOver, info);
  43. }
  44. private int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual launcher, CommonAI.Zone.Instance.InstanceUnit.SkillState skill)
  45. {
  46. launcher.mUnit.AddBuff(Buff_ID);
  47. return 0;
  48. }
  49. protected override void OnInitSkillParam()
  50. {
  51. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  52. InitData(data, out dmg, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  53. InitData(data, out valueSet0, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  54. }
  55. }
  56. }