Warrior_110250.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using CommonAI.Zone;
  2. using CommonAI.Zone.Helper;
  3. using CommonAI.Zone.Instance;
  4. using CommonLang;
  5. using XmdsCommon.Plugin;
  6. using XmdsCommonServer.Plugin;
  7. using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
  8. using XmdsCommonServer.XLS.Data;
  9. using XmdsCommonSkill.Plugin.Buffs;
  10. namespace XmdsCommonSkill.Plugin.Skills.Warrior
  11. {
  12. /// <summary>
  13. /// 二技能: 2-5 (砸到终点时获得一个最大生命值n%护盾,持续X秒)
  14. /// </summary>
  15. public class Warrior_110250 : Warrior_110240
  16. {
  17. private static readonly int ID = 110250;
  18. //护盾buff在落地后,编辑器给玩家加buff
  19. protected static readonly int Buff_ID_HUDUN_5 = (int)XmdsBuffBase.XmdsBuffList.HUDUN_ZS_2_5;
  20. //护盾基于生命值
  21. protected XmdsSkillValue mValueSet3;
  22. /// 获取技能ID.
  23. public override int SkillID { get { return ID; } }
  24. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  25. {
  26. base.OnInit(info, unit, ref template);
  27. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID_HUDUN_5);
  28. XmdsBuff_Shield_AbsorbDamage buff = (XmdsBuff_Shield_AbsorbDamage)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.SHIELD_AbsorbDamage);
  29. buff.AbsorbDamageSum = CUtils.CastInt(unit.MirrorProp.MaxHP * XmdsUnitProp.PER * mValueSet3.GetValue(info.TalentSkillLevel2, 1));
  30. BuffTemplate bt = pack.mBuffTemplate;
  31. bt.IsHarmful = false;
  32. bt.LifeTimeMS = mValueSet3.GetValue(info.TalentSkillLevel2, 2);
  33. pack.BindTemplateAndDispose();
  34. unit.RegistSendBuff(bt);
  35. }
  36. protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
  37. {
  38. base.OnSkillDataChange(gs, unit);
  39. var buff = unit.GetRegisBuffVirtual(Buff_ID_HUDUN_5) as XmdsBuff_Shield_AbsorbDamage;
  40. buff.AbsorbDamageSum = CUtils.CastInt(unit.MirrorProp.MaxHP * XmdsUnitProp.PER * mValueSet3.GetValue(gs.TalentSkillLevel2, 1));
  41. var bt = unit.GetRegistBuff(Buff_ID_HUDUN_5);
  42. bt.LifeTimeMS = mValueSet3.GetValue(gs.TalentSkillLevel2, 2);
  43. }
  44. protected override void OnInitConfig()
  45. {
  46. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  47. InitData(data, out mValueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  48. InitData(data, out mValueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  49. InitData(data, out mValueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
  50. InitData(data, out mValueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
  51. //释放过程中免伤
  52. InitData(data, out mValueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
  53. }
  54. }
  55. }