using CommonAI.Zone; using System.Collections.Generic; using XmdsCommon.Plugin; using XmdsCommonServer.Plugin; using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator; using XmdsCommonServer.XLS.Data; using XmdsCommonSkill.Plugin.Buffs; namespace XmdsCommonSkill.Plugin.FunctionEvent { /// /// 精英 /// public class XmdsBattleFunctionEvent_10015 : XmdsBattleFunctionEventBase { public static readonly int EventID = 10015; private int BuffValue_1 = 0; // private int BuffValue_2 = 0; // private int Buff_LifeTime = 0; // buff持续时间. public override int GetEventID() { return EventID; } protected override bool OnInit() { BuffConfig config = base.GetBuffConfig(); BuffValue_1 = System.Int32.Parse(config.ValueSet1); BuffValue_2 = System.Int32.Parse(config.ValueSet2); Buff_LifeTime = System.Int32.Parse(config.ValueSet3); List abilityList = new List(); abilityList.Add(XmdsBuffProperties.XmdsBuffAbility.PropChange); abilityList.Add(XmdsBuffProperties.XmdsBuffAbility.PropChange); return XmdsBuffFactory.GetInstance().XmdsBuffPackTest(base.mBuff_ID, abilityList); } protected override void OnTriggerEvent(XmdsVirtual target, XmdsVirtual sender) { XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(base.mBuff_ID); var buff = (XmdsBuff_PropChange)pack.GetXmdsBuff(0); buff.CurentChangeType = XmdsVirtual.UnitAttributeType.MaxHP; buff.CurrentValue = BuffValue_1; buff.IsPercent = true; var buff1 = (XmdsBuff_PropChange)pack.GetXmdsBuff(1); buff1.CurentChangeType = XmdsVirtual.UnitAttributeType.Attack; buff1.CurrentValue = BuffValue_2; buff1.IsPercent = true; BuffTemplate bt = pack.mBuffTemplate; bt.IsHarmful = false; bt.LifeTimeMS = Buff_LifeTime; pack.BindTemplateAndDispose(); target.mUnit.AddBuff(bt, sender.mUnit); } } }