Monster_605062.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using CommonAI.Zone;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using XmdsCommon.Plugin;
  7. using XmdsCommonServer.Plugin;
  8. using XmdsCommonServer.XLS.Data;
  9. using XmdsCommonSkill.Plugin.Buffs;
  10. namespace XmdsCommonSkill.Plugin.Skills.Monster
  11. {
  12. /// <summary>
  13. /// 沙尘暴 对所有目标造成持续的魔法伤害,并且降低治疗效果 " 一个百分比魔法伤害和固定魔法伤害加成 受到伤害造成最近治疗效果降低"
  14. /// </summary>
  15. class Monster_605062 : XmdsSkillBase
  16. {
  17. public static int ID = 605062;
  18. public static XmdsSkillValue DP_1;
  19. public static int Buff_ID = 102060;
  20. /// BUFF伤害 - 治疗效果下降.
  21. public static XmdsSkillValue BuffDamageTreat;
  22. public override int SkillID { get { return ID; } }
  23. protected override void OnSkillDamagePerEvent(BattleParams param)
  24. {
  25. int ret = CalDamagePer(DP_1, param.GameSkill.SkillLevel);
  26. param.SkillDamagePer = ret;
  27. }
  28. protected override void OnInitSkillParam()
  29. {
  30. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  31. InitData(data, out DP_1, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  32. InitData(data, out BuffDamageTreat, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  33. }
  34. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  35. {
  36. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  37. BuffTemplate bt = pack.mBuffTemplate;
  38. bt.IsHarmful = true;
  39. pack.BindTemplateAndDispose();
  40. unit.RegistSendBuff(bt);
  41. }
  42. protected override void OnSkillLogicEvent(BattleParams param)
  43. {
  44. // 治疗效果
  45. XmdsBuff_PropChange bf = param.Attacker.GetRegisBuffVirtual(Buff_ID) as XmdsBuff_PropChange;
  46. bf.CurentChangeType = XmdsVirtual.UnitAttributeType.HealEffect;
  47. bf.IsPercent = true;
  48. bf.CurrentValue = -this.GetTargetFormulaValue(param.GameSkill.TalentSkillLevel1, BuffDamageTreat);
  49. // 设置buff时长
  50. BuffTemplate bt = param.Attacker.GetRegistBuff(Buff_ID);
  51. bt.LifeTimeMS = 5000;
  52. // 上buff
  53. param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
  54. }
  55. }
  56. }