using CommonAI.Zone.Instance; using XmdsCommonServer.Plugin; using XmdsCommonServer.Plugin.Units; using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills; namespace XmdsCommonSkill.Plugin.Buffs { /// /// 恐惧BUFF. /// public class XmdsBuff_Fear : XmdsBuffBase { public override int GetAbilityID() { return (int)XmdsCommon.Plugin.XmdsBuffProperties.XmdsBuffAbility.Fear; } protected override void OnBindTemplate(ref CommonAI.Zone.BuffTemplate buffTemplate) { //设置为晕眩. buffTemplate.IsSilent = true; } protected override void OnBuffBegin(XmdsCommonServer.Plugin.XmdsVirtual hitter, XmdsCommonServer.Plugin.XmdsVirtual attacker, InstanceUnit.BuffState state) { InstanceUnit unit = hitter.mUnit; //Lock + 移动限制. //if(hitter is XmdsVirtual_Player) //{ // //限制主角接收移动指令. // XmdsInstancePlayer iu = unit as XmdsInstancePlayer; // iu.BuffMoveLock(state.LifeTimeMS); //} unit.changeState(new InstanceUnit.StateChaos(unit, state.LifeTimeMS)); XmdsVirtual.FormatLog("BuffBegin : 单位【{0}】进入恐惧状态", hitter.mProp.ServerData.BaseInfo.name); } protected override void OnBuffEnd(XmdsCommonServer.Plugin.XmdsVirtual hitter, InstanceUnit.BuffState state, bool replace) { if(hitter.mUnit.CurrentState is InstanceUnit.StateChaos) { hitter.mUnit.startIdle(); } XmdsVirtual.FormatLog("BuffEnd : 单位【{0}】退出恐惧状态", hitter.mProp.ServerData.BaseInfo.name); } public override void CopyTo(UnitBuff other) { base.CopyTo(other); } } }