using CommonAI.Zone; using XmdsCommon.Plugin; using XmdsCommonServer.Plugin; using XmdsCommonSkill.Plugin.Buffs; using XmdsCommonServer.XLS.Data; using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator; using CommonLang; namespace XmdsCommonSkill.Plugin.Skills.Monster { /// /// 黑暗女王萨缇娜 - 群体恢复:立即恢复自己和身边N米内的己方x%生命,并在接下来5秒内总计恢复y%生命(可打断). /// public class Monster_10540503 : XmdsSkillBase { public static int ID = 10540503; /// 回血(可打断) public static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.HUI_XUE_DA_DUAN; public static XmdsSkillValue Buff_Value; /// 立即恢复 public static XmdsSkillValue Buff_Value2; public override int SkillID { get { return ID; } } protected override void OnSkillDamagePerEvent(BattleParams param) { param.SkillDamagePer = 0; } protected override void OnskillDamageModifyEvent(BattleParams param) { float v = GetTargetFormulaValue(param.GameSkill.SkillLevel, Buff_Value2) * 1.0f / XmdsDamageCalculator.PERER; int ret = CUtils.CastInt(v * param.Hitter.mUnit.MaxHP); param.SkillDamageModify = ret; } protected override void OnRegistEvent() { this.RegistEvent(EventType.UseFormluaType, OnUseFormluaTypeEvent); base.OnRegistEvent(); } private void OnUseFormluaTypeEvent(BattleParams param) { param.UseDamageType = CommonAI.Data.DamageType.Heal; } protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template) { XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID); XmdsBuff_AddHP buff = (XmdsBuff_AddHP)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.AddHP); buff.RemoveOnHit = true; BuffTemplate bt = pack.mBuffTemplate; bt.IsHarmful = false; pack.BindTemplateAndDispose(); unit.RegistSendBuff(bt); } protected override void OnSkillLogicEvent(BattleParams param) { BuffTemplate bt = param.Attacker.GetRegistBuff(Buff_ID); bt.LifeTimeMS = 5000; XmdsBuff_AddHP buff = (XmdsBuff_AddHP)param.Attacker.GetRegisBuffVirtual(Buff_ID); float v = this.GetTargetFormulaValue(param.GameSkill.SkillLevel, Buff_Value) * 1.0f / XmdsDamageCalculator.PERER; int t = CUtils.CastInt(v * param.Hitter.mUnit.MaxHP / (bt.LifeTimeMS / 1000)); buff.ChangeValue = t; param.Hitter.mUnit.AddBuff(Buff_ID); } protected override void OnInitSkillParam() { XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID); InitData(data, out Buff_Value, XmdsSkillData.XmdsSkillDataKey.ValueSet); InitData(data, out Buff_Value2, XmdsSkillData.XmdsSkillDataKey.ValueSet2); } } }