Monster_9143101.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. 
  2. using CommonAI.Zone;
  3. using XmdsCommon.Plugin;
  4. using XmdsCommonServer.Plugin;
  5. using XmdsCommonServer.XLS.Data;
  6. using XmdsCommonSkill.Plugin.Buffs;
  7. namespace XmdsCommonSkill.Plugin.Skills.Monster
  8. {
  9. /// <summary>
  10. /// 鬼灵观察者 - 灵魂冲击: 用灵魂的力量冲击目标,造成x%魔攻伤害和额外y点魔法伤害,并降低魔抗z%.
  11. /// </summary>
  12. public class Monster_9143101 : XmdsSkillBase
  13. {
  14. public static int ID = 9143101;
  15. public static XmdsSkillValue DP_1;
  16. public static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.MO_KANG_DOWN2;
  17. public static XmdsSkillValue Buff_Value;
  18. public override int SkillID { get { return ID; } }
  19. protected override void OnSkillDamagePerEvent(BattleParams param)
  20. {
  21. int ret = CalDamagePer(DP_1, param.GameSkill.SkillLevel);
  22. param.SkillDamagePer = ret;
  23. }
  24. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  25. {
  26. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  27. BuffTemplate bt = pack.mBuffTemplate;
  28. bt.IsHarmful = true;
  29. pack.BindTemplateAndDispose();
  30. unit.RegistSendBuff(bt);
  31. }
  32. protected override void OnSkillLogicEvent(BattleParams param)
  33. {
  34. int lv = param.GameSkill.SkillLevel;
  35. XmdsBuff_PropChange buff = (XmdsBuff_PropChange)param.Attacker.GetRegisBuffVirtual(Buff_ID);
  36. buff.IsPercent = false;
  37. buff.CurentChangeType = XmdsVirtual.UnitAttributeType.Defence;
  38. buff.CurrentValue = -this.GetTargetFormulaValue(lv, Buff_Value);
  39. BuffTemplate bt = param.Attacker.GetRegistBuff(Buff_ID);
  40. bt.LifeTimeMS = 5000;
  41. param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
  42. }
  43. protected override void OnInitSkillParam()
  44. {
  45. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  46. InitData(data, out DP_1, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  47. InitData(data, out Buff_Value, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  48. }
  49. }
  50. }