Warrior_110160.cs 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using CommonAI.Data;
  2. using CommonAI.Zone;
  3. using CommonAI.Zone.Formula;
  4. using CommonAI.Zone.Helper;
  5. using CommonAI.Zone.Instance;
  6. using CommonLang;
  7. using System;
  8. using XmdsCommon.Plugin;
  9. using XmdsCommonServer.Plugin;
  10. using XmdsCommonServer.XLS.Data;
  11. using XmdsCommonSkill.Plugin.Buffs;
  12. using static CommonAI.Zone.Instance.InstanceUnit;
  13. namespace XmdsCommonSkill.Plugin.Skills.Warrior
  14. {
  15. /// <summary>
  16. /// 战士【1】技能 2 - 3(第三次攻击砸地立即砸出一个火焰飓风,能击飞+眩晕,造成N%攻击力伤害(仅表现及效果变化,编辑器自调))
  17. /// </summary>
  18. public class Warrior_110160 : Warrior_110150
  19. {
  20. private static readonly int ID = 110160;
  21. private static readonly int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.ZS_YUNXIAN_1_6;
  22. //熔岩伤害
  23. protected XmdsSkillValue mValueSet4;
  24. //眩晕时间
  25. protected XmdsSkillValue mValueSet5;
  26. public override int SkillID { get { return ID; } }
  27. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  28. {
  29. base.OnInit(info, unit, ref template);
  30. // Buff3修改
  31. var pack3 = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  32. pack3.mBuffTemplate.LifeTimeMS = mValueSet5.GetValue(info.TalentSkillLevel3);
  33. var bt3 = pack3.mBuffTemplate;
  34. pack3.BindTemplateAndDispose();
  35. unit.RegistSendBuff(bt3);
  36. }
  37. protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
  38. {
  39. base.OnSkillDataChange(gs, unit);
  40. var bt = unit.GetRegistBuff(Buff_ID);
  41. bt.LifeTimeMS = mValueSet5.GetValue(gs.TalentSkillLevel3);
  42. }
  43. protected override void OnSkillDamagePerEvent(BattleParams param)
  44. {
  45. if(param.AtkProp.DamagePerID == 5)
  46. {
  47. param.SkillDamagePer = mValueSet4.GetValue(param.GameSkill.TalentSkillLevel3);
  48. }
  49. else
  50. {
  51. base.OnSkillDamagePerEvent(param);
  52. //MMO-16584 sub MMO-16258不知道以前有啥需求,现改为伤害全部叠加。
  53. //param.SkillDamageAdd = Math.Max(1, CUtils.CastInt(param.Attacker.MirrorProp.Defence * XmdsUnitProp.PER * mValueSet2.GetValue(param.GameSkill.TalentSkillLevel1)));
  54. }
  55. }
  56. protected override void OnSkillLogicEvent(BattleParams param)
  57. {
  58. base.OnSkillLogicEvent(param);
  59. //命中,加减速buff
  60. if(param.AtkProp.DamagePerID == 5)
  61. {
  62. param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
  63. }
  64. }
  65. protected override void OnInitConfig()
  66. {
  67. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  68. InitData(data, out mValueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  69. InitData(data, out mValueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  70. //伤害系数额外加成
  71. InitData(data, out mValueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  72. //喷浆伤害
  73. InitData(data, out mValueSet4, XmdsSkillData.XmdsSkillDataKey.ValueSet4);
  74. //眩晕
  75. InitData(data, out mValueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  76. // 基础扩展
  77. InitData(data, out mValueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
  78. }
  79. }
  80. }