Monster_6050702.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using CommonAI.Zone;
  2. using XmdsCommon.Plugin;
  3. using XmdsCommonServer.Plugin;
  4. using XmdsCommonSkill.Plugin.Buffs;
  5. using XmdsCommonServer.XLS.Data;
  6. using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
  7. namespace XmdsCommonSkill.Plugin.Skills.Monster
  8. {
  9. /// <summary>
  10. /// 恐惧使者(隆塔尔) - 恐惧:使身边所有敌人陷入恐惧状态四散逃走,持续x秒,并在恐惧期间每秒受到x倍魔攻伤害附加y点魔法伤害
  11. /// </summary>
  12. public class Monster_6050702 : XmdsSkillBase
  13. {
  14. public static int ID = 6050702;
  15. public static XmdsSkillValue DP_1;
  16. public static int Buff_1 = (int)XmdsBuffBase.XmdsBuffList.FEAR;
  17. public override int SkillID { get { return ID; } }
  18. protected override void OnSkillDamagePerEvent(BattleParams param)
  19. {
  20. int ret = CalDamagePer(DP_1, param.GameSkill.SkillLevel);
  21. param.SkillDamagePer = ret;
  22. }
  23. protected override void OnSkillLogicEvent(BattleParams param)
  24. {
  25. BuffTemplate bt = param.Attacker.GetRegistBuff(Buff_1);
  26. bt.LifeTimeMS = 5000;
  27. // 持续伤害.
  28. XmdsBuff_Bleed buff2 = param.Attacker.GetRegisBuffVirtual(Buff_1, 1) as XmdsBuff_Bleed;
  29. int attack = param.Attacker.MirrorProp.BaseAttack;
  30. attack = XmdsDamageCalculator.GetSkillDamage(attack, param.SkillDamagePer, param.SkillDamageModify);
  31. attack = XmdsDamageCalculator.GetDamage(attack, param.Attacker, param.Hitter, param.Source);
  32. buff2.ChangeValue = attack;
  33. param.Hitter.mUnit.AddBuff(Buff_1, param.Attacker.mUnit);
  34. }
  35. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  36. {
  37. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_1);
  38. XmdsBuff_Fear buff1 = (XmdsBuff_Fear)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.Fear);
  39. XmdsBuff_Bleed buff2 = (XmdsBuff_Bleed)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.Bleed);
  40. BuffTemplate bt = pack.mBuffTemplate;
  41. bt.IsHarmful = true;
  42. pack.BindTemplateAndDispose();
  43. unit.RegistSendBuff(bt);
  44. }
  45. protected override void OnInitSkillParam()
  46. {
  47. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
  48. InitData(data, out DP_1, XmdsSkillData.XmdsSkillDataKey.DmgRate);
  49. }
  50. }
  51. }