public GenericWeapon(bool isRanged, float minDmg, float maxDmg, int attackTime, DamageSchoolMask dmgType) { IsRanged = isRanged; IsMelee = !isRanged; AttackTime = attackTime; Damages = new[] { new DamageInfo(dmgType, minDmg, maxDmg) }; }
public GenericWeapon(InventorySlotTypeMask slot, float minDmg, float maxDmg, int attackTime, DamageSchoolMask dmgType) { InventorySlotMask = slot; AttackTime = attackTime; MaxRange = Unit.DefaultMeleeAttackRange; Damages = new[] { new DamageInfo(dmgType, minDmg, maxDmg) }; }
public static void SendMagicDamage(WorldObject victim, IEntity attacker, SpellId spell, uint damage, uint overkill, DamageSchoolMask schools, uint absorbed, uint resisted, uint blocked, bool unkBool, SpellLogFlags flags) { using (RealmPacketOut packet = new RealmPacketOut((PacketId)RealmServerOpCode.SMSG_SPELLNONMELEEDAMAGELOG, 40)) { victim.EntityId.WritePacked((BinaryWriter)packet); if (attacker != null) { attacker.EntityId.WritePacked((BinaryWriter)packet); } else { packet.Write((byte)0); } packet.Write((uint)spell); packet.Write(damage); packet.Write(overkill); packet.Write((byte)schools); packet.Write(absorbed); packet.Write(resisted); packet.Write(0); packet.Write(unkBool); packet.Write(blocked); packet.Write((uint)flags); packet.Write((byte)0); victim.SendPacketToArea(packet, true, false, Locale.Any, new float?()); } }
public GenericWeapon(InventorySlotTypeMask slot, float minDmg, float maxDmg, int attackTime, DamageSchoolMask dmgType) { this.InventorySlotMask = slot; this.AttackTime = attackTime; this.MaxRange = Unit.DefaultMeleeAttackRange; this.Damages = new DamageInfo[1] { new DamageInfo(dmgType, minDmg, maxDmg) }; this.IsWeapon = true; }
public int Absorb(int absorbAmount, DamageSchoolMask schools) { if (absorbAmount <= 0 || this.SpellEffect != null && this.Spell.AttributesExD.HasFlag((Enum)SpellAttributesExD.CannotBeAbsorbed)) { return(0); } if (schools.HasAnyFlag(this.UsedSchool)) { int num = Math.Min(this.Damage, absorbAmount); absorbAmount -= num; this.Absorbed += num; } return(absorbAmount); }
public int Absorb(int absorbAmount, DamageSchoolMask schools) { if (absorbAmount <= 0) { return(0); } if (SpellEffect != null && Spell.AttributesExD.HasFlag(SpellAttributesExD.CannotBeAbsorbed)) { return(0); } if (schools.HasAnyFlag(UsedSchool)) { var value = Math.Min(Damage, absorbAmount); absorbAmount -= value; Absorbed += value; } return(absorbAmount); }
public GenericWeapon(InventorySlotTypeMask slot, float minDmg, float maxDmg, DamageSchoolMask dmgType) : this(slot, minDmg, maxDmg, GenericWeapon.Fists.AttackTime, dmgType) { this.IsWeapon = true; }
public GenericWeapon(InventorySlotTypeMask slot, float minDmg, float maxDmg, DamageSchoolMask dmgType) : this(slot, minDmg, maxDmg, Fists.AttackTime, dmgType) { }
public DamageInfo(DamageSchoolMask school, float min, float max) { School = school; Minimum = min; Maximum = max; }
public static void SendMagicDamage(WorldObject victim, IEntity attacker, SpellId spell, uint damage, uint overkill, DamageSchoolMask schools, uint absorbed, uint resisted, uint blocked, bool unkBool, SpellLogFlags flags) { using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELLNONMELEEDAMAGELOG, 40)) { victim.EntityId.WritePacked(packet); if (attacker != null) { attacker.EntityId.WritePacked(packet); } else { packet.Write((byte)0); } packet.Write((uint)spell); packet.Write(damage); packet.Write(overkill); packet.Write((byte)schools); packet.Write(absorbed); packet.Write(resisted); packet.Write(0); // apparently always 0 packet.Write(unkBool); // 0 or 1 packet.Write(blocked); // also flags 0x8, 0x10, packet.Write((uint)flags); packet.Write((byte)0);// unused by client victim.SendPacketToArea(packet, true); } }
public static bool HasAnyFlag(this DamageSchoolMask flags, DamageSchool school) { return((flags & (DamageSchoolMask)(1 << (int)(school & (DamageSchool)31))) != DamageSchoolMask.None); }
public static bool HasAnyFlag(this DamageSchoolMask flags, DamageSchoolMask otherFlags) { return((flags & otherFlags) != DamageSchoolMask.None); }
public static bool HasAnyFlag(this DamageSchoolMask flags, DamageSchool school) { return((flags & (DamageSchoolMask)(1 << (int)school)) != 0); }
public GenericWeapon(bool isRanged, float minDmg, float maxDmg, DamageSchoolMask dmgType) : this(isRanged, minDmg, maxDmg, Fists.AttackTime, dmgType) { }
public DamageInfo(DamageSchoolMask school, float min, float max) { this.School = school; this.Minimum = min; this.Maximum = max; }
public int Absorb(int absorbAmount, DamageSchoolMask schools) { if (absorbAmount <= 0) { return 0; } if (SpellEffect != null && Spell.AttributesExD.HasFlag(SpellAttributesExD.CannotBeAbsorbed)) { return 0; } if (schools.HasAnyFlag(UsedSchool)) { var value = Math.Min(Damage, absorbAmount); absorbAmount -= value; Absorbed += value; } return absorbAmount; }
public static bool HasAnyFlag(this DamageSchoolMask flags, DamageSchoolMask otherFlags) { return (flags & otherFlags) != 0; }
public static void SendMagicDamage(WorldObject victim, IEntity attacker, SpellId spell, uint damage, uint overkill, DamageSchoolMask schools, uint absorbed, uint resisted, uint blocked, bool unkBool, SpellLogFlags flags) { using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELLNONMELEEDAMAGELOG, 40)) { victim.EntityId.WritePacked(packet); if (attacker != null) { attacker.EntityId.WritePacked(packet); } else { packet.Write((byte)0); } packet.Write((uint)spell); packet.Write(damage); packet.Write(overkill); packet.Write((byte)schools); packet.Write(absorbed); packet.Write(resisted); packet.Write(0); // apparently always 0 packet.Write(unkBool); // 0 or 1 packet.Write(blocked); // also flags 0x8, 0x10, packet.Write((uint)flags); packet.Write((byte)0); // unused by client victim.SendPacketToArea(packet, true, false); } }