Monster_9140402.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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点物理伤害,并造成一个流血效果,在A秒内每秒造成z点伤害.
  13. /// </summary>
  14. public class Monster_9140402 : XmdsSkillBase
  15. {
  16. public static int ID = 9140402;
  17. public static XmdsSkillValue DP_1;
  18. public static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.LIU_XUE;
  19. public static XmdsSkillValue BuffDamageHP;
  20. public override int SkillID { get { return ID; } }
  21. protected override void OnSkillDamagePerEvent(BattleParams param)
  22. {
  23. int ret = CalDamagePer(DP_1, param.GameSkill.SkillLevel);
  24. param.SkillDamagePer = ret;
  25. }
  26. protected override void OnSkillLogicEvent(BattleParams param)
  27. {
  28. int lv = param.GameSkill.SkillLevel;
  29. UnitBuff ub = param.Attacker.GetRegisBuffVirtual(Buff_ID);
  30. if (ub != null)
  31. {
  32. XmdsBuff_Bleed buff = ub as XmdsBuff_Bleed;
  33. buff.ChangeValue = GetTargetFormulaValue(lv, BuffDamageHP);
  34. }
  35. BuffTemplate bt = param.Attacker.GetRegistBuff(Buff_ID);
  36. bt.LifeTimeMS = 5000;
  37. param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
  38. }
  39. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  40. {
  41. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  42. XmdsBuff_Bleed buff = (XmdsBuff_Bleed)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.Bleed);
  43. BuffTemplate bt = pack.mBuffTemplate;
  44. bt.IsHarmful = true;
  45. pack.BindTemplateAndDispose();
  46. unit.RegistSendBuff(bt);
  47. }
  48. protected override void OnInitSkillParam()
  49. {
  50. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  51. InitData(data, out DP_1, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  52. InitData(data, out BuffDamageHP, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  53. }
  54. }
  55. }