Monster_10690302.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. 
  2. using CommonAI.Zone;
  3. using XmdsCommon.Plugin;
  4. using XmdsCommonServer.Plugin;
  5. using XmdsCommonSkill.Plugin.Buffs;
  6. using XmdsCommonServer.XLS.Data;
  7. using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
  8. using CommonLang;
  9. namespace XmdsCommonSkill.Plugin.Skills.Monster
  10. {
  11. /// <summary>
  12. /// 岩浆狂徒 - 熔岩重生:立即恢复自己x%生命,并在接下来5秒内总计恢复y点生命.
  13. /// </summary>
  14. public class Monster_10690302 : XmdsSkillBase
  15. {
  16. /// <summary>
  17. /// 技能ID.
  18. /// </summary>
  19. public static int ID = 10690302;
  20. /// 回血(不可打断)
  21. public static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.HUI_XUE_DA_DUAN;
  22. public static XmdsSkillValue Buff_Value;
  23. /// 立即恢复
  24. public static XmdsSkillValue Buff_Value2;
  25. public override int SkillID { get { return ID; } }
  26. protected override void OnSkillDamagePerEvent(BattleParams param)
  27. {
  28. param.SkillDamagePer = 0;
  29. }
  30. protected override void OnskillDamageModifyEvent(BattleParams param)
  31. {
  32. float v = GetTargetFormulaValue(param.GameSkill.SkillLevel, Buff_Value) * 1.0f / XmdsDamageCalculator.PERER;
  33. int ret = CUtils.CastInt(v * param.Attacker.mUnit.MaxHP);
  34. param.SkillDamageModify = ret;
  35. }
  36. protected override void OnRegistEvent()
  37. {
  38. this.RegistEvent(EventType.UseFormluaType, OnUseFormluaTypeEvent);
  39. base.OnRegistEvent();
  40. }
  41. private void OnUseFormluaTypeEvent(BattleParams param)
  42. {
  43. param.UseDamageType = CommonAI.Data.DamageType.Heal;
  44. }
  45. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  46. {
  47. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  48. XmdsBuff_AddHP buff = (XmdsBuff_AddHP)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.AddHP);
  49. buff.RemoveOnHit = false; // 不可打断
  50. BuffTemplate bt = pack.mBuffTemplate;
  51. bt.IsHarmful = false;
  52. pack.BindTemplateAndDispose();
  53. unit.RegistSendBuff(bt);
  54. }
  55. protected override void OnSkillLogicEvent(BattleParams param)
  56. {
  57. XmdsBuff_AddHP buff = (XmdsBuff_AddHP)param.Attacker.GetRegisBuffVirtual(Buff_ID);
  58. int v = GetTargetFormulaValue(param.GameSkill.SkillLevel, Buff_Value2);
  59. v = CUtils.CastInt(v / (5));
  60. buff.ChangeValue = v;
  61. BuffTemplate bt = param.Attacker.GetRegistBuff(Buff_ID);
  62. bt.LifeTimeMS = 5000;
  63. param.Attacker.mUnit.AddBuff(Buff_ID);
  64. }
  65. protected override void OnInitSkillParam()
  66. {
  67. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  68. InitData(data, out Buff_Value, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  69. InitData(data, out Buff_Value2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  70. }
  71. }
  72. }