123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
-
- using CommonAI.Zone;
- using CommonAI.Zone.Formula;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonSkill.Plugin.Buffs;
- using XmdsCommonServer.XLS.Data;
- using CommonAI.Zone.Instance;
- using CommonAI.Data;
- namespace XmdsCommonSkill.Plugin.Skills.Assassin
- {
- /// <summary>
- /// 隐身: 清除所有来自怪物的仇恨,隐身持续x秒,刺客移动速度下降x%,期间任何攻击或者受到伤害都会现形.
- /// </summary>
- public class Assassin_200050 : XmdsSkillBase
- {
- public static int ID = 200050;
- public static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.YIN_SHEN;
- /// 下降速度
- public static XmdsSkillValue Buff_Value;
- public override int SkillID { get { return ID; } }
- protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
- {
- //施放技能监听.
- unit.RegistTryLaunchSkillEvent(OnTryLaunchSkillEventHandle, info, true);
- //被攻击监听.
- unit.RegistOnHitDamage(OnUnitHitEvent, info);
- //技能技能初始化,常用作为修改BUFF能力等等.
- XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
- XmdsBuff_Stealth buff = (XmdsBuff_Stealth)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.Stealth);
- buff.ChangePercent = -GetTargetFormulaValue(info.SkillLevel, Buff_Value);
- BuffTemplate bt = pack.mBuffTemplate;
- bt.IsHarmful = false;
- pack.BindTemplateAndDispose();
- unit.RegistSendBuff(bt);
- }
- //被打监听.
- protected virtual float OnUnitHitEvent(float damage, XmdsVirtual hitted, XmdsVirtual attacker, AttackSource source,
- ref XmdsVirtual.AtkResult result, DamageType damageType, GameSkill skill, ref bool isEndDispatch)
- {
- //大于0位伤害.
- if (damage > 0)
- {
- hitted.mUnit.removeBuff(Buff_ID);
- }
- return damage;
- }
- protected virtual bool OnTryLaunchSkillEventHandle(GameSkill skillInfo, ref InstanceUnit.SkillState skill, XmdsVirtual launcher, ref InstanceUnit.LaunchSkillParam param)
- {
- //只要施放的不是隐身和疾跑技能,其余全部消除.
- if (skill.Data.ID != SkillID
- && (skill.Data.ID != Assassin_200060.ID && skill.Data.ID != Assassin_201060.ID && skill.Data.ID != Assassin_202060.ID))
- {
- launcher.mUnit.removeBuff(Buff_ID);
- }
- return true;
- }
- //攻击监听.
- //protected virtual int OnLaunchSkillOver(int costEnergy, XmdsCommonServer.Plugin.XmdsVirtual attacker, CommonAI.Zone.Instance.InstanceUnit.SkillState state)
- //{
- // //只要施放的不是隐身和疾跑技能,其余全部消除.
- // if (state.Data.ID != SkillID
- // && (state.Data.ID != Assassin_200060.ID && state.Data.ID != Assassin_201060.ID && state.Data.ID != Assassin_202060.ID))
- // {
- // attacker.mUnit.removeBuff(Buff_ID);
- // }
- // else
- // {
- // if (state.Data.ID == SkillID)
- // {
- // tmpAddBuff(costEnergy, attacker, state);
- // }
- // }
- // return costEnergy;
- //}
- //protected virtual void tmpAddBuff(int costEnergy, XmdsCommonServer.Plugin.XmdsVirtual attacker, CommonAI.Zone.Instance.InstanceUnit.SkillState state)
- //{
- // BuffTemplate bt = attacker.GetRegistBuff(Buff_ID);
- // bt.LifeTimeMS = this.GetTargetFormulaValue(attacker.SkillHelper.GetGameSkill(SkillID).SkillLevel, BuffLifeTime);
- // attacker.mUnit.AddBuff(Buff_ID, attacker.mUnit);
- //}
- protected override void OnSkillLogicEvent(BattleParams param)
- {
- BuffTemplate bt = param.Attacker.GetRegistBuff(Buff_ID);
- bt.LifeTimeMS = 5000;
- param.Attacker.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
- }
- protected override void OnInitSkillParam()
- {
- XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
- InitData(data, out Buff_Value, XmdsSkillData.XmdsSkillDataKey.ValueSet);
- }
- }
- }
|