Monster_10250201.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. /// 煞鬼 - 撕咬: 攻击一个目标,造成x倍物攻伤害和额外y点物攻伤害,并使目标流血,5秒内总计流失生命z.
  13. /// </summary>
  14. public class Monster_10250201 : XmdsSkillBase
  15. {
  16. public static int ID = 10250201;
  17. /// 伤害倍数.
  18. public static XmdsSkillValue DP_1;
  19. /// 流血BUFFID.
  20. public static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.LIU_XUE;
  21. public static XmdsSkillValue BuffDamageHP;
  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 OnSkillLogicEvent(BattleParams param)
  29. {
  30. // 流血
  31. UnitBuff ub = param.Attacker.GetRegisBuffVirtual(Buff_ID);
  32. if (ub != null)
  33. {
  34. XmdsBuff_Bleed buff = ub as XmdsBuff_Bleed;
  35. int bb = this.GetTargetFormulaValue(param.GameSkill.SkillLevel, BuffDamageHP);
  36. bb = XmdsDamageCalculator.GetDamage(bb, param.Attacker, param.Hitter, param.Source);
  37. buff.ChangeValue = bb / (5000 / 1000);
  38. }
  39. // 设置buff时长
  40. BuffTemplate bt = param.Attacker.GetRegistBuff(Buff_ID);
  41. bt.LifeTimeMS = 5000;
  42. // 上buff
  43. param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
  44. }
  45. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  46. {
  47. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  48. XmdsBuff_Bleed buff = (XmdsBuff_Bleed)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.Bleed);
  49. BuffTemplate bt = pack.mBuffTemplate;
  50. pack.BindTemplateAndDispose();
  51. bt.IsHarmful = true;
  52. unit.RegistSendBuff(bt);
  53. }
  54. protected override void OnInitSkillParam()
  55. {
  56. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  57. InitData(data, out DP_1, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  58. InitData(data, out BuffDamageHP, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  59. }
  60. }
  61. }