Boss_90308.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using CommonAI.Data;
  2. using CommonAI.Zone;
  3. using CommonAI.Zone.Formula;
  4. using CommonAI.Zone.Helper;
  5. using CommonAI.Zone.Instance;
  6. using CommonLang;
  7. using System;
  8. using XmdsCommon.Plugin;
  9. using XmdsCommonServer.Plugin;
  10. using XmdsCommonServer.XLS.Data;
  11. using XmdsCommonSkill.Plugin.Buffs;
  12. using XmdsCommonSkill.Plugin.PassiveSkills.Magic;
  13. using static CommonAI.Zone.Instance.InstanceUnit;
  14. namespace XmdsCommonSkill.Plugin.Skills.Boss
  15. {
  16. /// <summary>
  17. /// boss - 1 - 捕猎(选中一名玩家,3秒后以该玩家所在坐标为终点进行冲锋,对路径上所有目标造成伤害,并附加流血效果)
  18. /// </summary>
  19. public class Boss_90308 : XmdsSkillBase
  20. {
  21. private static int ID = 90308;
  22. private static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.BOSS_ZB_BLESS;
  23. public static XmdsSkillValue dmgValue; // 伤害系数1
  24. public static XmdsSkillValue valueSet1; // 伤害系数2
  25. public static XmdsSkillValue valueSet2; // 流血系数
  26. public static XmdsSkillValue valueSet3; // 流血时间
  27. public override int SkillID { get { return ID; } }
  28. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  29. {
  30. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  31. XmdsBuff_Bleed buff = (XmdsBuff_Bleed)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.Bleed);
  32. buff.deepValue = 1.5f;
  33. BuffTemplate bt = pack.mBuffTemplate;
  34. bt.IsHarmful = true;
  35. bt.LifeTimeMS = valueSet3.GetValue();
  36. pack.BindTemplateAndDispose();
  37. unit.RegistSendBuff(bt);
  38. unit.RegistOnHitOther(OnHandleHitOther, info);
  39. }
  40. //伤害计算
  41. protected override void OnSkillDamagePerEvent(BattleParams param)
  42. {
  43. if(param.AtkProp.DamagePerID == 1)
  44. {
  45. param.SkillDamagePer = dmgValue.GetValue();
  46. }
  47. else
  48. {
  49. param.SkillDamagePer = valueSet1.GetValue();
  50. }
  51. }
  52. private float OnHandleHitOther(float damage, XmdsVirtual hitted, XmdsVirtual attacker, AttackSource source,
  53. ref XmdsVirtual.AtkResult result, DamageType damageType, GameSkill skill, ref bool isEndDispatch)
  54. {
  55. // 流血
  56. var buff = attacker.GetRegisBuffVirtual(Buff_ID) as XmdsBuff_Bleed;
  57. buff.ChangeValue = Math.Max(1, CUtils.CastInt(damage * XmdsUnitProp.PER * valueSet2.GetValue()));
  58. hitted.mUnit.AddBuff(Buff_ID, attacker.mUnit);
  59. return damage;
  60. }
  61. protected override void OnInitSkillParam()
  62. {
  63. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  64. InitData(data, out dmgValue, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  65. InitData(data, out valueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  66. InitData(data, out valueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  67. InitData(data, out valueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  68. }
  69. }
  70. }