Remedy_510260.cs 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. using XmdsCommonSkill.Plugin.Buffs;
  8. namespace XmdsCommonSkill.Plugin.Skills.Remedy
  9. {
  10. /// <summary>
  11. /// 治疗, 二技能: 2-6 (复数绿色的精灵环绕在奶妈四周,类似死亡先知大招,3s,对X码以内的敌人造成伤害,降低其50%治疗量(多个不叠加))
  12. /// </summary>
  13. public class Remedy_510260 : Remedy_510250
  14. {
  15. private static readonly int ID = 510260;
  16. private static readonly int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.REMEDY_2_6_HEALEDDOWN;
  17. public override int SkillID { get { return ID; } }
  18. // 伤害系数
  19. protected XmdsSkillValue valueSet4;
  20. // 扩展配置
  21. protected XmdsSkillValue valueSet6;
  22. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  23. {
  24. base.OnInit(info, unit, ref template);
  25. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  26. XmdsBuff_PropChange buff = (XmdsBuff_PropChange)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.PropChange);
  27. buff.IsPercent = false;
  28. buff.CurentChangeType = XmdsVirtual.UnitAttributeType.HealedEffect;
  29. buff.CurrentValue = -valueSet6.GetValue(info.TalentSkillLevel3, 1);
  30. BuffTemplate bt = pack.mBuffTemplate;
  31. bt.IsHarmful = false;
  32. bt.LifeTimeMS = valueSet6.GetValue(info.TalentSkillLevel3, 2);
  33. pack.BindTemplateAndDispose();
  34. unit.RegistSendBuff(bt);
  35. }
  36. protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
  37. {
  38. base.OnSkillDataChange(gs, unit);
  39. var buff = unit.GetRegisBuffVirtual(Buff_ID) as XmdsBuff_PropChange;
  40. buff.CurrentValue = valueSet6.GetValue(gs.TalentSkillLevel3, 1);
  41. var bt = unit.GetRegistBuff(Buff_ID);
  42. bt.LifeTimeMS = valueSet6.GetValue(gs.TalentSkillLevel3, 2);
  43. }
  44. protected override void OnSkillDamagePerEvent(BattleParams param)
  45. {
  46. if (param.AtkProp.DamagePerID == 3)
  47. {
  48. param.SkillDamagePer = valueSet4.GetValue(param.GameSkill.TalentSkillLevel3);
  49. }
  50. else
  51. {
  52. base.OnSkillDamagePerEvent(param);
  53. }
  54. }
  55. protected override void OnSkillLogicEvent(BattleParams param)
  56. {
  57. base.OnSkillLogicEvent(param);
  58. //命中,加buff
  59. if (!param.Attacker.IsAllies(param.Hitter, true, true))
  60. {
  61. param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
  62. }
  63. }
  64. protected override void OnInitConfig()
  65. {
  66. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  67. base.InitBaseConfig(data);
  68. InitData(data, out buffTime, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  69. InitData(data, out valueSet, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  70. InitData(data, out valueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  71. InitData(data, out valueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  72. InitData(data, out valueSet4, XmdsSkillData.XmdsSkillDataKey.ValueSet4);
  73. //扩展配置
  74. InitData(data, out valueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  75. InitData(data, out valueSet6, XmdsSkillData.XmdsSkillDataKey.ValueSet6);
  76. }
  77. }
  78. }