123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using CommonAI.Zone;
- using CommonAI.Zone.Helper;
- using CommonAI.Zone.Instance;
- using System;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonSkill.Plugin.Buffs;
- namespace XmdsCommonSkill.Plugin.Skills.Warrior
- {
- /// <summary>
- /// 4技能4-2 (buff持续期间,根据已损失生命值提高自身攻击力)
- /// </summary>
- public class Warrior_110420 : Warrior_110410
- {
- private static readonly int ID = 110420;
- private static readonly int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.ATTCK_UP_ZS_4_2;
- public override int SkillID { get { return ID; } }
- // 生命值减少,攻击力伤害加成,触发最低生命,buff时间
- protected XmdsSkillValue mValueSet3;
- protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
- {
- base.OnInit(info, unit, ref template);
- // 根据生命值提高攻击力
- var pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
- var buff = (XmdsBuff_AttackUpByHp)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.AttakUp_ByHp);
- buff.hpReduceLevel = mValueSet3.GetValue(info.TalentSkillLevel2, 1);
- buff.ChangeValue = mValueSet3.GetValue(info.TalentSkillLevel2, 2);
- buff.hpTriggerLower = mValueSet3.GetValue(info.TalentSkillLevel2, 3);
- var bt = pack.mBuffTemplate;
- bt.IsHarmful = true;
- bt.LifeTimeMS = mValueSet3.GetValue(info.TalentSkillLevel2, 4);
- pack.BindTemplateAndDispose();
- unit.RegistSendBuff(bt);
- unit.RegistLaunchSkillOver(OnLaunchSkillOver, info);
- }
- protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
- {
- base.OnSkillDataChange(gs, unit);
- var buff = unit.GetRegisBuffVirtual(Buff_ID) as XmdsBuff_AttackUpByHp;
- buff.hpReduceLevel = mValueSet3.GetValue(gs.TalentSkillLevel2, 1);
- buff.ChangeValue = mValueSet3.GetValue(gs.TalentSkillLevel2, 2);
- buff.hpTriggerLower = mValueSet3.GetValue(gs.TalentSkillLevel2, 3);
- var bt = unit.GetRegistBuff(Buff_ID);
- bt.LifeTimeMS = mValueSet3.GetValue(gs.TalentSkillLevel2, 2);
- }
- private int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual launcher, CommonAI.Zone.Instance.InstanceUnit.SkillState skill)
- {
- launcher.mUnit.AddBuff(Buff_ID, launcher.mUnit);
- return 0;
- }
- protected override void OnInitConfig()
- {
- XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
- InitData(data, out mDamageReduce, 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 mValueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
- InitData(data, out mValueSet6, XmdsSkillData.XmdsSkillDataKey.ValueSet6);
- InitData(data, out mValueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
- }
- }
- }
|