Monster_6061204.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. using CommonLang;
  10. namespace XmdsCommonSkill.Plugin.Skills.Monster
  11. {
  12. /// <summary>
  13. /// 疫病之王亚巴顿 - 瘟疫传染: 对随机目标释放瘟疫魔法,使其在10秒内总计流失生命x%.
  14. /// 5秒后该魔法会传染到目标身边y米内的随机1个队友身上(随机目标,范围内必定传染).
  15. /// </summary>
  16. public class Monster_6061204 : XmdsSkillBase
  17. {
  18. public static int ID = 6061204;
  19. /// 流血BUFFID.
  20. public static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.WEN_YI;
  21. public static XmdsSkillValue BuffDamageHPPec;
  22. public override int SkillID { get { return ID; } }
  23. protected override void OnSkillLogicEvent(BattleParams param)
  24. {
  25. param.UseDamageType = CommonAI.Data.DamageType.None;
  26. // 流血
  27. UnitBuff ub = param.Attacker.GetRegisBuffVirtual(Buff_ID);
  28. XmdsBuff_Bleed buff = ub as XmdsBuff_Bleed;
  29. int t = this.GetTargetFormulaValue(param.GameSkill.SkillLevel, BuffDamageHPPec);
  30. t = CUtils.CastInt(t / XmdsDamageCalculator.PERER * param.Hitter.MirrorProp.MaxHP);
  31. buff.ChangeValue = t / 5;
  32. BuffTemplate bt = param.Attacker.GetRegistBuff(Buff_ID);
  33. bt.LifeTimeMS = 5000;
  34. // 上buff
  35. param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
  36. }
  37. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  38. {
  39. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  40. XmdsBuff_Bleed buff = (XmdsBuff_Bleed)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.Bleed);
  41. BuffTemplate bt = pack.mBuffTemplate;
  42. bt.IsHarmful = true;
  43. pack.BindTemplateAndDispose();
  44. unit.RegistSendBuff(bt);
  45. }
  46. protected override void OnInitSkillParam()
  47. {
  48. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  49. InitData(data, out BuffDamageHPPec, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  50. }
  51. }
  52. }