Monster_10540502.cs 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. 
  2. using XmdsCommonServer.XLS.Data;
  3. using XmdsCommonServer.Plugin;
  4. using XmdsCommonSkill.Plugin.Buffs;
  5. using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
  6. using CommonAI.Zone;
  7. using XmdsCommon.Plugin;
  8. using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
  9. namespace XmdsCommonSkill.Plugin.Skills.Monster
  10. {
  11. /// <summary>
  12. /// 黑暗女王萨缇娜 - 巫术诅咒: 诅咒身边N米内的所有敌人,使得他们在10秒内总计流失x%生命,
  13. /// 期间他们受到的治疗效果会下降y%.
  14. /// </summary>
  15. public class Monster_10540502 : XmdsSkillBase
  16. {
  17. public static int ID = 10540502;
  18. /// 流血 + 治疗效果↓.
  19. public static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.WU_SHU_ZU_ZHOU;
  20. public static XmdsSkillValue BuffDamageHP;
  21. public static XmdsSkillValue Buff_Percent;
  22. public override int SkillID { get { return ID; } }
  23. protected override void OnSkillLogicEvent(BattleParams param)
  24. {
  25. // 此处如果不设成none,则会因为没有buff外的伤害值,而自动扣1滴血.
  26. // 扣1滴血是为了程序查错用,怀疑这个属性默认是Damage,由于没有API,大致就是这样.
  27. param.UseDamageType = CommonAI.Data.DamageType.None;
  28. // 流血.
  29. UnitBuff ub = param.Attacker.GetRegisBuffVirtual(Buff_ID);
  30. XmdsBuff_Bleed buff = ub as XmdsBuff_Bleed;
  31. int bb = this.GetTargetFormulaValue(param.GameSkill.SkillLevel, BuffDamageHP);
  32. bb = XmdsDamageCalculator.GetDamage(bb, param.Attacker, param.Hitter, param.Source);
  33. buff.ChangeValue = bb / (5);
  34. // 治疗效果下降.
  35. XmdsBuff_PropChange buff2 = (XmdsBuff_PropChange)param.Attacker.GetRegisBuffVirtual(Buff_ID, 1);
  36. buff2.IsPercent = true;
  37. buff2.CurentChangeType = XmdsVirtual.UnitAttributeType.HealedEffect;
  38. buff2.CurrentValue = this.GetTargetFormulaValue(param.GameSkill.SkillLevel, Buff_Percent);
  39. buff2.ShowBuffTips = false;
  40. BuffTemplate bt = param.Attacker.GetRegistBuff(Buff_ID);
  41. bt.LifeTimeMS = 5000;
  42. param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
  43. }
  44. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  45. {
  46. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  47. XmdsBuff_Bleed buff = (XmdsBuff_Bleed)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.Bleed);
  48. BuffTemplate bt = pack.mBuffTemplate;
  49. pack.BindTemplateAndDispose();
  50. bt.IsHarmful = true;
  51. unit.RegistSendBuff(bt);
  52. }
  53. protected override void OnInitSkillParam()
  54. {
  55. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  56. InitData(data, out BuffDamageHP, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  57. InitData(data, out Buff_Percent, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  58. }
  59. }
  60. }