Monster_6061102.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. 
  2. using XmdsCommonServer.Plugin;
  3. using XmdsCommonServer.XLS.Data;
  4. using XmdsCommonSkill.Plugin.Buffs;
  5. using CommonAI.Zone;
  6. using XmdsCommon.Plugin;
  7. namespace XmdsCommonSkill.Plugin.Skills.Monster
  8. {
  9. /// <summary>
  10. /// 行刑官(比列) - 巨刃乱舞: 挥舞武器,对身边所有敌人造成x倍物攻伤害和额外y点物理伤害.
  11. /// 并降低敌人z%的物抗,这个效果持续5秒(一个短暂的旋风斩,类似Dota里的斧王,原地快速的转一下即可).
  12. /// </summary>
  13. public class Monster_6061102 : XmdsSkillBase
  14. {
  15. public static int ID = 6061102;
  16. public static XmdsSkillValue DP_1;
  17. /// 物防.
  18. public static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.WU_FANG_DOWN;
  19. public static XmdsSkillValue Buff_Value;
  20. public override int SkillID { get { return ID; } }
  21. protected override void OnSkillDamagePerEvent(BattleParams param)
  22. {
  23. int ret = CalDamagePer(DP_1, param.GameSkill.SkillLevel);
  24. param.SkillDamagePer = ret;
  25. }
  26. protected override void OnSkillLogicEvent(BattleParams param)
  27. {
  28. XmdsBuff_PropChange buff = param.Attacker.GetRegisBuffVirtual(Buff_ID) as XmdsBuff_PropChange;
  29. buff.CurentChangeType = XmdsVirtual.UnitAttributeType.Defence;
  30. buff.IsPercent = true;
  31. buff.CurrentValue = -this.GetTargetFormulaValue(param.GameSkill.SkillLevel, Buff_Value);
  32. BuffTemplate bt = param.Attacker.GetRegistBuff(Buff_ID);
  33. bt.LifeTimeMS = 5000;
  34. param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
  35. }
  36. /// <summary>
  37. /// 初始化.
  38. /// </summary>
  39. /// <param name="info"></param>
  40. /// <param name="unit"></param>
  41. /// <param name="template"></param>
  42. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  43. {
  44. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  45. XmdsBuff_PropChange buff3 = (XmdsBuff_PropChange)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.PropChange);
  46. BuffTemplate bt = pack.mBuffTemplate;
  47. bt.IsHarmful = true;
  48. pack.BindTemplateAndDispose();
  49. unit.RegistSendBuff(bt);
  50. }
  51. protected override void OnInitSkillParam()
  52. {
  53. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  54. InitData(data, out DP_1, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  55. InitData(data, out Buff_Value, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  56. }
  57. }
  58. }