Boss_90011.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using CommonAI.Zone;
  2. using CommonAI.Zone.Helper;
  3. using CommonAI.Zone.Instance;
  4. using XmdsCommon.Plugin;
  5. using XmdsCommonServer.Plugin;
  6. using XmdsCommonServer.XLS.Data;
  7. using XmdsCommonSkill.Plugin.Buffs;
  8. using XmdsCommonSkill.Plugin.PassiveSkills.Magic;
  9. using static CommonAI.Zone.Instance.InstanceUnit;
  10. namespace XmdsCommonSkill.Plugin.Skills.Boss
  11. {
  12. /// <summary>
  13. /// boss通用技能 - 寒霜
  14. /// </summary>
  15. public class Boss_90011 : XmdsSkillBase
  16. {
  17. /// 技能ID.
  18. private static int ID = 90011;
  19. private static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.SPEED_DOWN; // 减速
  20. public static XmdsSkillValue DP_1;
  21. public static XmdsSkillValue valueSet1; // 减速比例
  22. public static XmdsSkillValue valueSet2; // 减速时间
  23. public override int SkillID {get { return ID; } }
  24. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  25. {
  26. // Buff2修改
  27. var pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  28. var buff = pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.MoveSpeedDown) as XmdsBuff_MoveSpeedDown;
  29. buff.ChangePercent = -valueSet1.GetValue();
  30. var bt = pack.mBuffTemplate;
  31. bt.LifeTimeMS = valueSet2.GetValue();
  32. bt.IsHarmful = true;
  33. pack.BindTemplateAndDispose();
  34. unit.RegistSendBuff(bt);
  35. }
  36. protected override void OnSkillDamagePerEvent(BattleParams param)
  37. {
  38. param.SkillDamagePer = CalDamagePer(DP_1, param.GameSkill.SkillLevel);
  39. }
  40. protected override void OnSkillLogicEvent(BattleParams param)
  41. {
  42. base.OnSkillLogicEvent(param);
  43. param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
  44. }
  45. protected override void OnInitSkillParam()
  46. {
  47. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  48. InitData(data, out DP_1, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  49. InitData(data, out valueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  50. InitData(data, out valueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  51. }
  52. }
  53. }