Warrior_110420.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using CommonAI.Zone;
  2. using CommonAI.Zone.Helper;
  3. using CommonAI.Zone.Instance;
  4. using System;
  5. using XmdsCommon.Plugin;
  6. using XmdsCommonServer.Plugin;
  7. using XmdsCommonServer.XLS.Data;
  8. using XmdsCommonSkill.Plugin.Buffs;
  9. namespace XmdsCommonSkill.Plugin.Skills.Warrior
  10. {
  11. /// <summary>
  12. /// 4技能4-2 (buff持续期间,根据已损失生命值提高自身攻击力)
  13. /// </summary>
  14. public class Warrior_110420 : Warrior_110410
  15. {
  16. private static readonly int ID = 110420;
  17. private static readonly int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.ATTCK_UP_ZS_4_2;
  18. public override int SkillID { get { return ID; } }
  19. // 生命值减少,攻击力伤害加成,触发最低生命,buff时间
  20. protected XmdsSkillValue mValueSet3;
  21. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  22. {
  23. base.OnInit(info, unit, ref template);
  24. // 根据生命值提高攻击力
  25. var pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  26. var buff = (XmdsBuff_AttackUpByHp)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.AttakUp_ByHp);
  27. buff.hpReduceLevel = mValueSet3.GetValue(info.TalentSkillLevel2, 1);
  28. buff.ChangeValue = mValueSet3.GetValue(info.TalentSkillLevel2, 2);
  29. buff.hpTriggerLower = mValueSet3.GetValue(info.TalentSkillLevel2, 3);
  30. var bt = pack.mBuffTemplate;
  31. bt.IsHarmful = true;
  32. bt.LifeTimeMS = mValueSet3.GetValue(info.TalentSkillLevel2, 4);
  33. pack.BindTemplateAndDispose();
  34. unit.RegistSendBuff(bt);
  35. unit.RegistLaunchSkillOver(OnLaunchSkillOver, info);
  36. }
  37. protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
  38. {
  39. base.OnSkillDataChange(gs, unit);
  40. var buff = unit.GetRegisBuffVirtual(Buff_ID) as XmdsBuff_AttackUpByHp;
  41. buff.hpReduceLevel = mValueSet3.GetValue(gs.TalentSkillLevel2, 1);
  42. buff.ChangeValue = mValueSet3.GetValue(gs.TalentSkillLevel2, 2);
  43. buff.hpTriggerLower = mValueSet3.GetValue(gs.TalentSkillLevel2, 3);
  44. var bt = unit.GetRegistBuff(Buff_ID);
  45. bt.LifeTimeMS = mValueSet3.GetValue(gs.TalentSkillLevel2, 2);
  46. }
  47. private int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual launcher, CommonAI.Zone.Instance.InstanceUnit.SkillState skill)
  48. {
  49. launcher.mUnit.AddBuff(Buff_ID, launcher.mUnit);
  50. return 0;
  51. }
  52. protected override void OnInitConfig()
  53. {
  54. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  55. InitData(data, out mDamageReduce, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  56. InitData(data, out mValueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  57. InitData(data, out mValueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  58. InitData(data, out mValueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  59. // 扩展配置
  60. InitData(data, out mValueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  61. InitData(data, out mValueSet6, XmdsSkillData.XmdsSkillDataKey.ValueSet6);
  62. InitData(data, out mValueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
  63. }
  64. }
  65. }