12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
-
- using CommonAI.Zone;
- using CommonLang;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
- using XmdsCommonServer.XLS.Data;
- namespace XmdsCommonSkill.Plugin.Skills.Monster
- {
- /// <summary>
- /// 疫病之王(亚巴顿) - 吸血: 在4秒内持续吸取当前目标的生命,对目标每0.4秒造成目标最大生命x%伤害.
- /// 并将这些伤害治疗自己,治疗量等于目标受到伤害的y倍.
- /// </summary>
- public class Monster_6061203 : XmdsSkillBase
- {
- public static int ID = 6061203;
- /// 伤害百分比.
- public static XmdsSkillValue DamageValue;
- /// 治疗百分比.
- public static XmdsSkillValue HealValue;
- /// 作用时间,在编辑器里配死,做成每秒进来1次,持续可打断型.
- public static int longTime = 5;
- public override int SkillID { get { return ID; } }
- private void OnUseFormluaTypeEvent(BattleParams param)
- {
- //自定义伤害计算.
- param.UseDamageType = CommonAI.Data.DamageType.Modify;
- }
- protected override void OnSkillLogicEvent(BattleParams param)
- {
- //强制为普攻.
- param.Source.OutClientState = (int)XmdsVirtual.UnitHitEventState.Normal;
- // 作用量.
- float t = (GetTargetFormulaValue(param.GameSkill.SkillLevel, DamageValue) * 1.0f) / XmdsDamageCalculator.PERER / longTime;
- int v = CUtils.CastInt(param.Hitter.mUnit.MaxHP * t);
- if (v > 0)
- {
- // 伤害.
- param.FinalSkillDamage = v;
- // 回复.
- v = CUtils.CastInt(v * (GetTargetFormulaValue(param.GameSkill.SkillLevel, HealValue) * 1.0f) / XmdsDamageCalculator.PERER);
- param.Attacker.AddHP(v, param.Attacker.mUnit, true);
- }
- }
- protected override void OnRegistEvent()
- {
- this.RegistEvent(EventType.UseFormluaType, OnUseFormluaTypeEvent);
- base.OnRegistEvent();
- }
- protected override void OnInitSkillParam()
- {
- XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
- InitData(data, out DamageValue, XmdsSkillData.XmdsSkillDataKey.ValueSet);
- InitData(data, out HealValue, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
- }
- }
- }
|