12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
-
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonServer.Plugin;
- using XmdsCommonSkill.Plugin.Buffs;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
- using CommonAI.Zone;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
- namespace XmdsCommonSkill.Plugin.Skills.Monster
- {
- /// <summary>
- /// 黑暗女王萨缇娜 - 巫术诅咒: 诅咒身边N米内的所有敌人,使得他们在10秒内总计流失x%生命,
- /// 期间他们受到的治疗效果会下降y%.
- /// </summary>
- public class Monster_10540502 : XmdsSkillBase
- {
- public static int ID = 10540502;
- /// 流血 + 治疗效果↓.
- public static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.WU_SHU_ZU_ZHOU;
- public static XmdsSkillValue BuffDamageHP;
- public static XmdsSkillValue Buff_Percent;
- public override int SkillID { get { return ID; } }
- protected override void OnSkillLogicEvent(BattleParams param)
- {
- // 此处如果不设成none,则会因为没有buff外的伤害值,而自动扣1滴血.
- // 扣1滴血是为了程序查错用,怀疑这个属性默认是Damage,由于没有API,大致就是这样.
- param.UseDamageType = CommonAI.Data.DamageType.None;
- // 流血.
- UnitBuff ub = param.Attacker.GetRegisBuffVirtual(Buff_ID);
- XmdsBuff_Bleed buff = ub as XmdsBuff_Bleed;
- int bb = this.GetTargetFormulaValue(param.GameSkill.SkillLevel, BuffDamageHP);
- bb = XmdsDamageCalculator.GetDamage(bb, param.Attacker, param.Hitter, param.Source);
- buff.ChangeValue = bb / (5);
- // 治疗效果下降.
- XmdsBuff_PropChange buff2 = (XmdsBuff_PropChange)param.Attacker.GetRegisBuffVirtual(Buff_ID, 1);
- buff2.IsPercent = true;
- buff2.CurentChangeType = XmdsVirtual.UnitAttributeType.HealedEffect;
- buff2.CurrentValue = this.GetTargetFormulaValue(param.GameSkill.SkillLevel, Buff_Percent);
- buff2.ShowBuffTips = false;
- BuffTemplate bt = param.Attacker.GetRegistBuff(Buff_ID);
- bt.LifeTimeMS = 5000;
- param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
- }
- protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
- {
- XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
- XmdsBuff_Bleed buff = (XmdsBuff_Bleed)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.Bleed);
- BuffTemplate bt = pack.mBuffTemplate;
- pack.BindTemplateAndDispose();
- bt.IsHarmful = true;
- unit.RegistSendBuff(bt);
- }
- protected override void OnInitSkillParam()
- {
- XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
- InitData(data, out BuffDamageHP, XmdsSkillData.XmdsSkillDataKey.ValueSet);
- InitData(data, out Buff_Percent, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
- }
- }
- }
|