1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- using CommonAI.Zone;
- using CommonAI.Zone.Helper;
- using CommonAI.Zone.Instance;
- using System;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonSkill.Plugin.Buffs;
- using XmdsCommonSkill.Plugin.PassiveSkills.Magic;
- using static CommonAI.Zone.Instance.InstanceUnit;
- using static XmdsCommonSkill.Plugin.Buffs.XmdsBuff_SwordShadow;
- namespace XmdsCommonSkill.Plugin.Skills.Magic
- {
- /// <summary>
- /// 普攻-减速n%持续x秒(新法术技能
- /// </summary>
- public class Skill_910120 : XmdsSkillBase
- {
- public static readonly int ID = 910120;
- public override int SkillID { get { return ID; } }
- private static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.PROP_CHANGE_1;
- private static XmdsSkillValue dmg;
- private static XmdsSkillValue valueSet0; // 减速值
- protected override void OnSkillDamagePerEvent(BattleParams param)
- {
- param.SkillDamagePer = dmg.GetValue();
- }
- protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
- {
- XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
- //攻击
- XmdsBuff_PropChange buff = (XmdsBuff_PropChange)pack.GetXmdsBuff(0);
- buff.CurentChangeType = XmdsVirtual.UnitAttributeType.MoveSpeed;
- buff.CurrentValue = -valueSet0.GetValue(1, 1);
- buff.IsPercent = true;
- BuffTemplate bt = pack.mBuffTemplate;
- bt.IsHarmful = true;
- bt.LifeTimeMS = valueSet0.GetValue(1, 2);
- pack.BindTemplateAndDispose();
- unit.RegistSendBuff(bt);
- unit.RegistLaunchSkillOver(OnLaunchSkillOver, info);
- }
- private int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual launcher, CommonAI.Zone.Instance.InstanceUnit.SkillState skill)
- {
- launcher.mUnit.AddBuff(Buff_ID);
- return 0;
- }
- protected override void OnInitSkillParam()
- {
- XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
- InitData(data, out dmg, XmdsSkillData.XmdsSkillDataKey.DmgRate);
- InitData(data, out valueSet0, XmdsSkillData.XmdsSkillDataKey.ValueSet);
- }
- }
- }
|