1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
-
- using CommonAI.Zone.Instance;
- using XmdsCommon.Message;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
- namespace XmdsCommonSkill.Plugin.Buffs
- {
- public class XmdsBuff_ActiveSkill : XmdsBuffBase
- {
- //被顶替的技能ID.
- public int FreezeSkillID;
- //激活的技能ID.
- public int ActiveSkillID;
- public override int GetAbilityID()
- {
- return (int)XmdsCommon.Plugin.XmdsBuffProperties.XmdsBuffAbility.ActiveSkill;
- }
- public override void CopyTo(UnitBuff other)
- {
- var ret = other as XmdsBuff_ActiveSkill;
- //被顶替的技能ID.
- ret.FreezeSkillID = this.FreezeSkillID;
- //激活的技能ID.
- ret.ActiveSkillID = this.ActiveSkillID;
- base.CopyTo(other);
- }
- protected override void OnBuffBegin(XmdsCommonServer.Plugin.XmdsVirtual hitter, XmdsCommonServer.Plugin.XmdsVirtual attacker, InstanceUnit.BuffState state)
- {
- //被顶替技能冻结.
- hitter.mUnit.SetSkillActive(FreezeSkillID, false, true);
- hitter.mUnit.SetSkillActive(ActiveSkillID, true);
- BuffActiveSkillEventB2C evt = new BuffActiveSkillEventB2C();
- evt.IsWorking = true;
- evt.FreezeSkillID = FreezeSkillID;
- evt.ActiveSkillID = ActiveSkillID;
- evt.BuffID = state.ID;
- hitter.mUnit.queueEvent(evt);
- //定特殊协议,通知客户端.
- XmdsVirtual.FormatLog("BuffBegin : 单位【{0}】,激活技能{1}", hitter.mProp.ServerData.BaseInfo.name, ActiveSkillID);
- }
- protected override void OnBuffEnd(XmdsCommonServer.Plugin.XmdsVirtual hitter, InstanceUnit.BuffState state, bool replace)
- {
- //解除顶替技能冻结.
- hitter.mUnit.SetSkillActive(ActiveSkillID, false);
- hitter.mUnit.SetSkillActive(FreezeSkillID, true);
- BuffActiveSkillEventB2C evt = new BuffActiveSkillEventB2C();
- evt.IsWorking = false;
- evt.FreezeSkillID = FreezeSkillID;
- evt.ActiveSkillID = ActiveSkillID;
- evt.BuffID = state.ID;
- hitter.mUnit.queueEvent(evt);
- //定特殊协议,通知客户端.
- XmdsVirtual.FormatLog("BuffEnd : 单位【{0}】,冻结技能{1}", hitter.mProp.ServerData.BaseInfo.name, ActiveSkillID);
- }
- }
- }
|