Monster_10330401.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. 
  2. using CommonAI.Zone;
  3. using XmdsCommon.Plugin;
  4. using XmdsCommonServer.Plugin;
  5. using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
  6. using XmdsCommonServer.XLS.Data;
  7. using XmdsCommonSkill.Plugin.Buffs;
  8. namespace XmdsCommonSkill.Plugin.Skills.Monster
  9. {
  10. /// <summary>
  11. /// 被魔化的艾克 - 狂暴之刃: 攻击一个目标,造成x倍物攻伤害和额外y点物理伤害,
  12. /// 每次攻击提升自己x%攻击力,这个效果持续10秒,可叠加10层.
  13. /// </summary>
  14. public class Monster_10330401 : XmdsSkillBase
  15. {
  16. public static int ID = 10330401;
  17. /// 伤害倍数.
  18. public static XmdsSkillValue DP_1;
  19. public static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.ATTACK_UP; // 攻击力↑.
  20. public static XmdsSkillValue Buff_Value;
  21. public static XmdsSkillValue Buff_MaxLay;
  22. public override int SkillID { get { return ID; } }
  23. protected override void OnRegistEvent()
  24. {
  25. this.RegistEvent(EventType.UseFormluaType, OnUseFormluaTypeEvent);
  26. base.OnRegistEvent();
  27. }
  28. protected override void OnSkillDamagePerEvent(BattleParams param)
  29. {
  30. int ret = CalDamagePer(DP_1, param.GameSkill.SkillLevel);
  31. param.SkillDamagePer = ret;
  32. }
  33. private void OnUseFormluaTypeEvent(BattleParams param)
  34. {
  35. param.UseDamageType = CommonAI.Data.DamageType.Damage;
  36. }
  37. protected override void OnSkillLogicEvent(BattleParams param)
  38. {
  39. XmdsBuff_PropChange buff = (XmdsBuff_PropChange)param.Attacker.GetRegisBuffVirtual(Buff_ID);
  40. buff.CurentChangeType = XmdsVirtual.UnitAttributeType.Attack;
  41. buff.IsPercent = true;
  42. buff.CurrentValue = this.GetTargetFormulaValue(param.GameSkill.SkillLevel, Buff_Value);
  43. BuffTemplate bt = param.Attacker.GetRegistBuff(Buff_ID);
  44. bt.LifeTimeMS = 5000;
  45. bt.MaxOverlay = (byte)this.GetTargetFormulaValue(param.GameSkill.SkillLevel, Buff_MaxLay);
  46. param.Attacker.mUnit.AddBuff(Buff_ID);
  47. }
  48. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  49. {
  50. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  51. XmdsBuff_PropChange buff = (XmdsBuff_PropChange)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.PropChange);
  52. BuffTemplate bt = pack.mBuffTemplate;
  53. bt.IsHarmful = true;
  54. pack.BindTemplateAndDispose();
  55. unit.RegistSendBuff(bt);
  56. }
  57. protected override void OnInitSkillParam()
  58. {
  59. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  60. InitData(data, out DP_1, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  61. InitData(data, out Buff_Value, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  62. InitData(data, out Buff_MaxLay, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
  63. }
  64. }
  65. }