Warrior_110210.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. namespace XmdsCommonSkill.Plugin.Skills.Warrior
  9. {
  10. /// 二技能: 2-1 ( 落地攻击力提升n%,持续T秒)
  11. public class Warrior_110210 : Warrior_110200
  12. {
  13. private static readonly int ID = 110210;
  14. //免伤比例
  15. protected XmdsSkillValue mValueSet2;
  16. private static readonly int Buff_ID_2_1 = (int)XmdsBuffBase.XmdsBuffList.ZS_ADD_ATTACK;
  17. public override int SkillID { get { return ID; } }
  18. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  19. {
  20. base.OnInit(info, unit, ref template);
  21. // Buff修改
  22. var pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID_2_1);
  23. var buff = pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.PropChange) as XmdsBuff_PropChange;
  24. buff.CurentChangeType = XmdsVirtual.UnitAttributeType.Attack;
  25. buff.IsPercent = true;
  26. buff.CurrentValue = mValueSet2.GetValue(info.TalentSkillLevel1, 1);
  27. var bt = pack.mBuffTemplate;
  28. bt.LifeTimeMS = mValueSet2.GetValue(info.TalentSkillLevel1, 2);
  29. pack.BindTemplateAndDispose();
  30. unit.RegistSendBuff(bt);
  31. unit.RegistLaunchSkillOver(OnLaunchSkillOver, info);
  32. }
  33. protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
  34. {
  35. base.OnSkillDataChange(gs, unit);
  36. var buff = unit.GetRegisBuffVirtual(Buff_ID_2_1) as XmdsBuff_PropChange;
  37. buff.CurrentValue = mValueSet2.GetValue(gs.TalentSkillLevel1, 1);
  38. var bt = unit.GetRegistBuff(Buff_ID_2_1);
  39. bt.LifeTimeMS = mValueSet2.GetValue(gs.TalentSkillLevel1, 2);
  40. }
  41. private int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual launcher, CommonAI.Zone.Instance.InstanceUnit.SkillState skill)
  42. {
  43. launcher.mUnit.AddBuff(Buff_ID_2_1, launcher.mUnit);
  44. return 0;
  45. }
  46. protected override void OnInitConfig()
  47. {
  48. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  49. InitData(data, out mValueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  50. InitData(data, out mValueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  51. // 扩展配置
  52. InitData(data, out mValueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  53. //释放过程中免伤
  54. InitData(data, out mValueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
  55. }
  56. }
  57. }