12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
-
- using CommonAI.Zone;
- using CommonAI.Zone.Formula;
- using CommonAI.Zone.Instance;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
- namespace XmdsCommonSkill.Plugin.Buffs
- {
- /// <summary>
- /// Description: 诅咒,真实伤害
- /// </summary>
- public class XmdsBuff_RealDamage : XmdsBuffBase
- {
- //真实伤害比例
- public int realDamagePer = 0;
- private uint buffHitID = 0;
- private int UUID_1 = 0;
- public override int GetAbilityID()
- {
- return (int)XmdsCommon.Plugin.XmdsBuffProperties.XmdsBuffAbility.Curse_RealDamage;
- }
- public override void CopyTo(UnitBuff other)
- {
- var ret = other as XmdsBuff_RealDamage;
- ret.realDamagePer = this.realDamagePer;
- base.CopyTo(other);
- }
- protected override void OnBindTemplate(ref BuffTemplate buffTemplate)
- {
- //DOT类技能首帧无效.
- buffTemplate.FirstTimeEnable = false;
- base.OnBindTemplate(ref buffTemplate);
- }
- public override void BuffBegin(XmdsVirtual hitter, XmdsVirtual attacker, InstanceUnit.BuffState state)
- {
- buffHitID = hitter.mUnit.ID;
- UUID_1 = attacker.RegistGetSkillDamageInfo(OnGetSkillDamageInfo, null, true);
- }
- public override void BuffEnd(XmdsVirtual hitter, InstanceUnit.BuffState state, bool replace)
- {
- hitter.UnRegistGetSkillDamageInfo(UUID_1);
- }
- //被打监听.
- protected virtual void OnGetSkillDamageInfo(XmdsVirtual attacker, XmdsVirtual hitter, ref AttackSource source, GameSkill gs)
- {
- if(hitter.mUnit.ID == this.buffHitID)
- {
- attacker.MirrorProp.IgnoreDefensePer = this.realDamagePer;
- }
- }
- protected override void OnDispose()
- {
- base.OnDispose();
- }
- }
- }
|