Skill_910190.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. using CommonAI.Data;
  2. using CommonAI.Zone;
  3. using CommonAI.Zone.Helper;
  4. using CommonAI.Zone.Instance;
  5. using CommonLang;
  6. using System;
  7. using System.Collections.Generic;
  8. using XmdsCommon.Plugin;
  9. using XmdsCommonServer.Plugin;
  10. using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
  11. using XmdsCommonServer.XLS.Data;
  12. using XmdsCommonSkill.Plugin.Buffs;
  13. using XmdsCommonSkill.Plugin.Interface;
  14. using XmdsCommonSkill.Plugin.PassiveSkills.Magic;
  15. using static CommonAI.Zone.Instance.InstanceUnit;
  16. using static XmdsCommonSkill.Plugin.Buffs.XmdsBuff_SwordShadow;
  17. using static XmdsCommonSkill.Plugin.Interface.ComSpellTemplate;
  18. using static XmdsCommonSkill.Plugin.Skills.XmdsSummonBase;
  19. namespace XmdsCommonSkill.Plugin.Skills.Magic
  20. {
  21. /// <summary>
  22. /// 一个AOE技能,释放机制为:每过一段时间指定的小怪从地图的几个位置刷出,向boss位置进发。当有一个抵达boss周围小范围内,杀死这些小怪。
  23. /// boss就会释放此aoe技能(伤害+控制)。指定小怪出现的时候boss会冒气泡提示。此小怪有血量,死亡时会释放自爆法术
  24. /// </summary>
  25. public class Skill_910190 : XmdsSummonBase_ActiveSkill
  26. {
  27. public static readonly int ID = 910190;
  28. public override int SkillID { get { return ID; } }
  29. private static readonly int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.COM_SLIENT;
  30. public static XmdsSkillValue dmg; // 伤害
  31. public static XmdsSkillValue lockTime; // 沉默时间
  32. private XmdsVirtual mOwner;
  33. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  34. {
  35. // Buff修改
  36. var pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  37. var bt = pack.mBuffTemplate;
  38. bt.LifeTimeMS = lockTime.GetValue();
  39. bt.IsHarmful = true;
  40. pack.BindTemplateAndDispose();
  41. unit.RegistSendBuff(bt);
  42. //单位攻击监听
  43. this.mOwner = unit;
  44. unit.RegistLaunchSkillOver(OnLaunchSkillOver, info);
  45. }
  46. private int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual attacker, CommonAI.Zone.Instance.InstanceUnit.SkillState state)
  47. {
  48. base.summonModule.SummonUnit(attacker);
  49. return 0;
  50. }
  51. //刷新
  52. protected override void OnUpdate(int intervalMS, bool slowRefresh)
  53. {
  54. this.refreshSummonUnit(slowRefresh);
  55. }
  56. protected override void OnSkillDamagePerEvent(BattleParams param)
  57. {
  58. param.SkillDamagePer = dmg.GetValue();
  59. }
  60. protected override void OnSkillLogicEvent(BattleParams param)
  61. {
  62. param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
  63. }
  64. // 处理特殊机制
  65. private void refreshSummonUnit(bool slowRefresh)
  66. {
  67. XmdsVirtual_Monster masterMonster = this.mOwner as XmdsVirtual_Monster;
  68. List<XmdsVirtual> summonList = masterMonster.GetSummonUnits();
  69. if(summonList == null || summonList.Count <= 0)
  70. {
  71. return;
  72. }
  73. for(int i = 0; i < summonList.Count; i++)
  74. {
  75. InstanceUnit unit = summonList[i].mUnit;
  76. if(unit.Info.ID != base.mSummonID)
  77. {
  78. continue;
  79. }
  80. if (slowRefresh && CMath.getDistance(unit.X, unit.Y, this.mOwner.mUnit.X, this.mOwner.mUnit.Y) <= 0.3f)
  81. {
  82. //杀死所有召唤物
  83. masterMonster.CleanSummonList();
  84. //释放特殊法术
  85. InstanceUnit bossUnit = masterMonster.mUnit;
  86. LaunchSpell spell = ComSpellTemplate.Instance().GetSpellByID(XmdsSpellID.DUNGEON_DEADSPELL);
  87. bossUnit.Parent.unitLaunchSpell(XmdsSkillType.none, bossUnit, spell, bossUnit.X, bossUnit.Y);
  88. break;
  89. }
  90. unit.startMoveTo(this.mOwner.mUnit.X, this.mOwner.mUnit.Y);
  91. }
  92. }
  93. protected override void OnInitConfig()
  94. {
  95. XmdsSkillData data = base.InitSummonConfig(SummonType.MoveToMaster);
  96. InitData(data, out dmg, XmdsSkillData.XmdsSkillDataKey.ValueSet4);
  97. InitData(data, out lockTime, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  98. }
  99. }
  100. }