Remedy_510330.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. /// 治疗, 三技能 3- 3(对被命中敌人造成伤害时,并标记一个伤害加深buff)
  12. /// </summary>
  13. public class Remedy_510330 : Remedy_510320
  14. {
  15. private static readonly int ID = 510330;
  16. public static readonly int Buff_1 = (int)XmdsBuffBase.XmdsBuffList.REMEDY_3_3_TAG;
  17. public override int SkillID { get { return ID; } }
  18. //减防系数
  19. protected XmdsSkillValue valueSet4;
  20. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  21. {
  22. base.OnInit(info, unit, ref template);
  23. //命中降防
  24. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_1);
  25. var buff = (XmdsBuff_Brand_4)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.Brand_4);
  26. buff.isPrecent = XmdsVirtual.PropChangeOperation.OperateType.Percent;
  27. buff.ChangePropType = XmdsVirtual.UnitAttributeType.Defence;
  28. buff.ChangePropValue = -valueSet4.GetValue(info.TalentSkillLevel3, 1);
  29. BuffTemplate bt = pack.mBuffTemplate;
  30. bt.IsHarmful = false;
  31. bt.LifeTimeMS = valueSet4.GetValue(info.TalentSkillLevel3, 2);
  32. pack.BindTemplateAndDispose();
  33. unit.RegistSendBuff(bt);
  34. }
  35. protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
  36. {
  37. base.OnSkillDataChange(gs, unit);
  38. var buff = unit.GetRegisBuffVirtual(Buff_1) as XmdsBuff_Brand_4;
  39. buff.ChangePropValue = -valueSet4.GetValue(gs.TalentSkillLevel3, 1);
  40. var bt = unit.GetRegistBuff(Buff_1);
  41. bt.LifeTimeMS = valueSet4.GetValue(gs.TalentSkillLevel3, 2);
  42. }
  43. protected override void OnSkillLogicEvent(BattleParams param)
  44. {
  45. base.OnSkillLogicEvent(param);
  46. //命中,加buff
  47. param.Hitter.mUnit.AddBuff(Buff_1, param.Attacker.mUnit);
  48. }
  49. protected override void OnInitConfig()
  50. {
  51. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  52. base.InitBaseConfig(data);
  53. InitData(data, out valueSet, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  54. InitData(data, out valueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  55. InitData(data, out valueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  56. InitData(data, out valueSet4, XmdsSkillData.XmdsSkillDataKey.ValueSet4);
  57. }
  58. }
  59. }