using CommonAI.Zone;
using System.Collections.Generic;
using XmdsCommon.Plugin;
using XmdsCommonServer.Plugin;
using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
using XmdsCommonServer.XLS.Data;
using XmdsCommonSkill.Plugin.Buffs;
namespace XmdsCommonSkill.Plugin.FunctionEvent
{
///
/// 无双
///
public class XmdsBattleFunctionEvent_10026 : XmdsBattleFunctionEventBase
{
public static readonly int EventID = 10026;
private int mBuff_LifeTime = 0; // buff持续时间.
private int mHPPer = 0; // 生命加成
private int mAtkPer = 0; // 攻击加成
private int mDamage = 0; // 伤害加成
private int mHPRecoverPer = 0; // 生命恢复百分百
public override int GetEventID() { return EventID; }
protected override bool OnInit()
{
BuffConfig config = base.GetBuffConfig();
mHPPer = System.Int32.Parse(config.ValueSet1);
mAtkPer = System.Int32.Parse(config.ValueSet2);
mDamage = System.Int32.Parse(config.ValueSet3);
mHPRecoverPer = System.Int32.Parse(config.ValueSet4);
mBuff_LifeTime = System.Int32.Parse(config.ValueSet5);
List abilityList = new List();
abilityList.Add(XmdsBuffProperties.XmdsBuffAbility.PropChange);
abilityList.Add(XmdsBuffProperties.XmdsBuffAbility.PropChange);
abilityList.Add(XmdsBuffProperties.XmdsBuffAbility.PropChange);
abilityList.Add(XmdsBuffProperties.XmdsBuffAbility.PropChange);
abilityList.Add(XmdsBuffProperties.XmdsBuffAbility.Invincible);
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 buff1 = (XmdsBuff_PropChange)pack.GetXmdsBuff(0);
buff1.CurentChangeType = XmdsVirtual.UnitAttributeType.MaxHP;
buff1.CurrentValue = mHPPer;
buff1.IsPercent = true;
var buff2 = (XmdsBuff_PropChange)pack.GetXmdsBuff(1);
buff2.CurentChangeType = XmdsVirtual.UnitAttributeType.Attack;
buff2.CurrentValue = mAtkPer;
buff2.IsPercent = true;
var buff3 = (XmdsBuff_PropChange)pack.GetXmdsBuff(2);
buff3.CurentChangeType = XmdsVirtual.UnitAttributeType.AllDmgAdd;
buff3.CurrentValue = mDamage;
buff3.IsPercent = true;
var buff4 = (XmdsBuff_PropChange)pack.GetXmdsBuff(3);
buff4.CurentChangeType = XmdsVirtual.UnitAttributeType.HPRecover;
buff4.CurrentValue = mHPRecoverPer;
buff4.IsPercent = true;
BuffTemplate bt = pack.mBuffTemplate;
bt.IsHarmful = false;
bt.LifeTimeMS = mBuff_LifeTime;
pack.BindTemplateAndDispose();
target.mUnit.AddBuff(bt, sender.mUnit);
}
}
}