XmdsBuff_Fear.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using CommonAI.Zone.Instance;
  2. using XmdsCommonServer.Plugin;
  3. using XmdsCommonServer.Plugin.Units;
  4. using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
  5. namespace XmdsCommonSkill.Plugin.Buffs
  6. {
  7. /// <summary>
  8. /// 恐惧BUFF.
  9. /// </summary>
  10. public class XmdsBuff_Fear : XmdsBuffBase
  11. {
  12. public override int GetAbilityID()
  13. {
  14. return (int)XmdsCommon.Plugin.XmdsBuffProperties.XmdsBuffAbility.Fear;
  15. }
  16. protected override void OnBindTemplate(ref CommonAI.Zone.BuffTemplate buffTemplate)
  17. {
  18. //设置为晕眩.
  19. buffTemplate.IsSilent = true;
  20. }
  21. protected override void OnBuffBegin(XmdsCommonServer.Plugin.XmdsVirtual hitter, XmdsCommonServer.Plugin.XmdsVirtual attacker, InstanceUnit.BuffState state)
  22. {
  23. InstanceUnit unit = hitter.mUnit;
  24. //Lock + 移动限制.
  25. //if(hitter is XmdsVirtual_Player)
  26. //{
  27. // //限制主角接收移动指令.
  28. // XmdsInstancePlayer iu = unit as XmdsInstancePlayer;
  29. // iu.BuffMoveLock(state.LifeTimeMS);
  30. //}
  31. unit.changeState(new InstanceUnit.StateChaos(unit, state.LifeTimeMS));
  32. XmdsVirtual.FormatLog("BuffBegin : 单位【{0}】进入恐惧状态", hitter.mProp.ServerData.BaseInfo.name);
  33. }
  34. protected override void OnBuffEnd(XmdsCommonServer.Plugin.XmdsVirtual hitter, InstanceUnit.BuffState state, bool replace)
  35. {
  36. if(hitter.mUnit.CurrentState is InstanceUnit.StateChaos)
  37. {
  38. hitter.mUnit.startIdle();
  39. }
  40. XmdsVirtual.FormatLog("BuffEnd : 单位【{0}】退出恐惧状态", hitter.mProp.ServerData.BaseInfo.name);
  41. }
  42. public override void CopyTo(UnitBuff other)
  43. {
  44. base.CopyTo(other);
  45. }
  46. }
  47. }