/// <summary> /// Deal Heal, check abilities buff (heal bonus , etc ) /// </summary> public virtual void DealHeal(Unit Target, Ability Ab, uint Heal) { AbtInterface.OnDealHeals(Target, Ab, ref Heal); Target.AbtInterface.OnReceiveHeal(this, Ab, ref Heal); if (Ab != null) { Ab.SendSpellDamage(Target, Heal, true); Ab.SendSpellEffect(this, Target, (ushort)Heal, (ushort)Heal, Ab.Info); } DealHeal(Target, (uint)Heal); }
/// <summary> /// Deal Damages but check abilities buff reductions (absorb, invinsibility, etc) /// </summary> public virtual void DealDamages(Unit Target, Ability Ab, uint Damages) { AbtInterface.OnDealDamages(Target, Ab, ref Damages); Target.AbtInterface.OnReceiveDamages(this, Ab, ref Damages); if (Ab != null) // Ability Damage { Ab.SendSpellDamage(Target, Damages, false); Ab.SendSpellEffect(this, Target, (ushort)Damages, (ushort)Damages, Ab.Info); } else // Weapon { SendCastEffect(Target, 0, GameData.CombatEvent.COMBATEVENT_HIT, Damages); } DealDamages(Target, (uint)Damages); }
public override void Cast() { if (Target == null) { return; } Log.Info("DealDamage", "Cast"); uint Damage = GetAbilityDamage(); Ab.SendStartCasting(Target.Oid); Ab.SendSpellDamage(Target.Oid, Damage); Ab.Caster.GetUnit().SendAttackState(Target, (ushort)Damage, (ushort)Damage, Ab.Info); Ab.Caster.GetUnit().DealDamage(Target, (int)Damage, 0, 0); Ab.SendAbilityDone(Target.Oid); }