Monster_9142102.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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点魔法伤害,减速N秒.
  11. /// </summary>
  12. public class Monster_9142102 : XmdsSkillBase
  13. {
  14. public static int ID = 9142102;
  15. public static XmdsSkillValue DP_1;
  16. public static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.SPEED_DOWN;
  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. XmdsBuff_MoveSpeedDown buff = (XmdsBuff_MoveSpeedDown)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.MoveSpeedDown);
  28. BuffTemplate bt = pack.mBuffTemplate;
  29. bt.IsHarmful = true;
  30. pack.BindTemplateAndDispose();
  31. unit.RegistSendBuff(bt);
  32. }
  33. protected override void OnSkillLogicEvent(BattleParams param)
  34. {
  35. int lv = param.GameSkill.SkillLevel;
  36. XmdsBuff_MoveSpeedDown buff = (XmdsBuff_MoveSpeedDown)param.Attacker.GetRegisBuffVirtual(Buff_ID);
  37. buff.ChangePercent = -GetTargetFormulaValue(lv, Buff_Value);
  38. BuffTemplate bt = param.Attacker.GetRegistBuff(Buff_ID);
  39. bt.LifeTimeMS = 5000;
  40. param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
  41. }
  42. protected override void OnInitSkillParam()
  43. {
  44. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  45. InitData(data, out DP_1, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  46. InitData(data, out Buff_Value, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  47. }
  48. }
  49. }