1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using CommonAI.Zone;
- using CommonAI.Zone.Helper;
- using CommonAI.Zone.Instance;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.XLS.Data;
- namespace XmdsCommonSkill.Plugin.Skills.Warrior
- {
- /// <summary>
- /// 五技能 5-3(降低25%CD时间)
- /// </summary>
- public class Warrior_110530 : Warrior_110520
- {
- private static readonly int ID = 110530;
- //技能CD
- protected XmdsSkillValue mValueSet4;
- //上一次技能cd变更
- private int mPreSkillCDChange = 0;
- public override int SkillID { get { return ID; } }
- protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
- {
- base.OnInit(info, unit, ref template);
- unit.RegistTryLaunchSkillEvent(OnTryLaunchSkill, info);
- }
- private bool OnTryLaunchSkill(GameSkill info, ref InstanceUnit.SkillState skill, XmdsVirtual launcher, ref InstanceUnit.LaunchSkillParam param)
- {
- if(skill.ActionIndex == -1)
- {
- int reduceTIme = skill.Data.CoolDownMS * mValueSet4.GetValue(info.TalentSkillLevel3) / 10000;
- if (reduceTIme != this.mPreSkillCDChange)
- {
- int changeValue = this.mPreSkillCDChange == 0 ? reduceTIme : (this.mPreSkillCDChange - reduceTIme);
- skill.AddDecreaseTotalTimeMS(changeValue);
- this.mPreSkillCDChange = reduceTIme;
- }
- }
- return true;
- }
- protected override void OnInitConfig()
- {
- XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
- InitData(data, out mJuQiValue, XmdsSkillData.XmdsSkillDataKey.DmgRate);
- InitData(data, out mValueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
- InitData(data, out mValueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
- InitData(data, out mValueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
- InitData(data, out mValueSet4, XmdsSkillData.XmdsSkillDataKey.ValueSet4);
- //扩展配置
- InitData(data, out mValueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
- InitData(data, out mValueSet6, XmdsSkillData.XmdsSkillDataKey.ValueSet6);
- InitData(data, out mValueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
- }
- }
- }
|