PetGiveSkill_920120.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. using static CommonAI.Zone.Instance.InstanceUnit;
  9. namespace XmdsCommonSkill.Plugin.Skills.PetSkill
  10. {
  11. /// <summary>
  12. /// 宠物 - 免疫(无敌3秒,期间不能操作,无法移动,cd50秒)
  13. /// </summary>
  14. public class PetGiveSkill_920120 : PetGiveSkillBase
  15. {
  16. private static readonly int ID = 920120;
  17. public static readonly int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.PET_WUDI;
  18. /// 伤害倍数.
  19. public static XmdsSkillValue valueSet1; //无敌时间
  20. //人物的技能,释放是,宠物释放的技能特效
  21. private static int BindPetSkillID = 0;
  22. public override int SkillID {get{return ID;}}
  23. protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
  24. {
  25. XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
  26. //加攻
  27. var buff = pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.Invincible) as XmdsBuff_Invincible;
  28. buff.isCanMove = false;
  29. var bt1 = pack.mBuffTemplate;
  30. bt1.LifeTimeMS = valueSet1.GetValue(info.SkillLevel);
  31. bt1.IsHarmful = false;
  32. pack.BindTemplateAndDispose();
  33. unit.RegistSendBuff(bt1);
  34. unit.RegistTriggerPetSkillEvent(OnTriggerPetSkill, info);
  35. }
  36. protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
  37. {
  38. base.OnSkillDataChange(gs, unit);
  39. var bt = unit.GetRegistBuff(Buff_ID);
  40. bt.LifeTimeMS = valueSet1.GetValue(gs.SkillLevel);
  41. }
  42. private bool OnTriggerPetSkill(GameSkill info, ref InstanceUnit.SkillState skill, XmdsVirtual launcher, ref InstanceUnit.LaunchSkillParam param)
  43. {
  44. launcher.mUnit.AddBuff(Buff_ID, launcher.mUnit);
  45. //玩家释放技能
  46. base.PlayerLauncherSkillOver(launcher);
  47. return true;
  48. }
  49. protected void initSkillInfo(int skillId, ref int BindPetSkillID)
  50. {
  51. XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(skillId);
  52. InitData(data, out valueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
  53. //初始化人物释放技能时,宠物播放的技能特效
  54. initBindSkill(data, ref BindPetSkillID);;
  55. }
  56. protected override void OnInitSkillParam()
  57. {
  58. initSkillInfo(ID, ref BindPetSkillID);
  59. }
  60. protected override int GetBindSkillID()
  61. {
  62. return BindPetSkillID;
  63. }
  64. }
  65. }