Warrior_110530.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using CommonAI.Zone;
  2. using CommonAI.Zone.Helper;
  3. using CommonAI.Zone.Instance;
  4. using XmdsCommon.Plugin;
  5. using XmdsCommonServer.Plugin;
  6. using XmdsCommonServer.XLS.Data;
  7. namespace XmdsCommonSkill.Plugin.Skills.Warrior
  8. {
  9. /// <summary>
  10. /// 五技能 5-3(降低25%CD时间)
  11. /// </summary>
  12. public class Warrior_110530 : Warrior_110520
  13. {
  14. private static readonly int ID = 110530;
  15. //技能CD
  16. protected XmdsSkillValue mValueSet4;
  17. //上一次技能cd变更
  18. private int mPreSkillCDChange = 0;
  19. public override int SkillID { get { return ID; } }
  20. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  21. {
  22. base.OnInit(info, unit, ref template);
  23. unit.RegistTryLaunchSkillEvent(OnTryLaunchSkill, info);
  24. }
  25. private bool OnTryLaunchSkill(GameSkill info, ref InstanceUnit.SkillState skill, XmdsVirtual launcher, ref InstanceUnit.LaunchSkillParam param)
  26. {
  27. if(skill.ActionIndex == -1)
  28. {
  29. int reduceTIme = skill.Data.CoolDownMS * mValueSet4.GetValue(info.TalentSkillLevel3) / 10000;
  30. if (reduceTIme != this.mPreSkillCDChange)
  31. {
  32. int changeValue = this.mPreSkillCDChange == 0 ? reduceTIme : (this.mPreSkillCDChange - reduceTIme);
  33. skill.AddDecreaseTotalTimeMS(changeValue);
  34. this.mPreSkillCDChange = reduceTIme;
  35. }
  36. }
  37. return true;
  38. }
  39. protected override void OnInitConfig()
  40. {
  41. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  42. InitData(data, out mJuQiValue, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  43. InitData(data, out mValueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  44. InitData(data, out mValueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  45. InitData(data, out mValueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  46. InitData(data, out mValueSet4, XmdsSkillData.XmdsSkillDataKey.ValueSet4);
  47. //扩展配置
  48. InitData(data, out mValueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  49. InitData(data, out mValueSet6, XmdsSkillData.XmdsSkillDataKey.ValueSet6);
  50. InitData(data, out mValueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
  51. }
  52. }
  53. }