/// <summary> /// Returns the base damage for a player attacker /// </summary> public void GetBaseDamage(Player attacker, CombatManeuver maneuver) { if (DamageSource.ItemType == ItemType.MissileWeapon) { DamageType = DamageSource.W_DamageType; // handle prismatic arrows if (DamageType == DamageType.Base) { if (Weapon != null && Weapon.W_DamageType != DamageType.Undef) { DamageType = Weapon.W_DamageType; } else { DamageType = DamageType.Pierce; } } } else { DamageType = attacker.GetDamageType(); } // TODO: combat maneuvers for player? BaseDamageMod = attacker.GetBaseDamageMod(DamageSource); if (DamageSource.ItemType == ItemType.MissileWeapon) { BaseDamageMod.ElementalBonus = WorldObject.GetMissileElementalDamageBonus(attacker, DamageType); } BaseDamage = ThreadSafeRandom.Next(BaseDamageMod.MinDamage, BaseDamageMod.MaxDamage); }
/// <summary> /// Returns the base damage for a player attacker /// </summary> public void GetBaseDamage(Player attacker, CombatManeuver maneuver) { if (DamageSource.ItemType == ItemType.MissileWeapon) { DamageType = (DamageType)DamageSource.GetProperty(PropertyInt.DamageType); // handle prismatic arrows if (DamageType == DamageType.Base) { var weapon = attacker.GetEquippedWeapon(); if (weapon != null && (weapon.W_DamageType ?? 0) != 0) { DamageType = (DamageType)weapon.W_DamageType; } else { DamageType = DamageType.Pierce; } } } else { DamageType = attacker.GetDamageType(); } // TODO: combat maneuvers for player? BaseDamageMod = attacker.GetBaseDamageMod(); if (DamageSource.ItemType == ItemType.MissileWeapon) { BaseDamageMod.ElementalBonus = WorldObject.GetMissileElementalDamageModifier(attacker, DamageType); } BaseDamage = ThreadSafeRandom.Next(BaseDamageMod.MinDamage, BaseDamageMod.MaxDamage); }
public static void ScaleDamageRanged(ACE.Server.WorldObjects.Creature c, ACE.Server.Entity.BaseDamageMod d) { if (!c.IsMonster) { return; } d.BaseDamage.MaxDamage = (int)((float)d.BaseDamage.MaxDamage * S_MONSTERMISSILEDMGINCREASE); }
/// <summary> /// Returns the base damage for a non-player attacker /// </summary> public void GetBaseDamage(Creature attacker, MotionCommand motionCommand) { AttackPart = attacker.GetAttackPart(motionCommand); if (AttackPart.Value == null) { GeneralFailure = true; return; } BaseDamageMod = attacker.GetBaseDamage(AttackPart.Value); BaseDamage = ThreadSafeRandom.Next(BaseDamageMod.MinDamage, BaseDamageMod.MaxDamage); DamageType = attacker.GetDamageType(AttackPart.Value, CombatType); }
/// <summary> /// Returns the base damage for a non-player attacker /// </summary> public void GetBaseDamage(Creature attacker, CombatManeuver maneuver) { AttackPart = attacker.GetAttackPart(maneuver); if (AttackPart == null) { GeneralFailure = true; return; } BaseDamageMod = attacker.GetBaseDamage(AttackPart); BaseDamage = ThreadSafeRandom.Next(BaseDamageMod.MinDamage, BaseDamageMod.MaxDamage); DamageType = attacker.GetDamageType(AttackPart, CombatType); if (attacker is CombatPet combatPet) { DamageType = combatPet.DamageType; } }
/// <summary> /// Returns the base damage for a player attacker /// </summary> public void GetBaseDamage(Player attacker, int damageBonus = 0) { if (DamageSource.ItemType == ItemType.MissileWeapon) { DamageType = DamageSource.W_DamageType; // handle prismatic arrows if (DamageType == DamageType.Base) { if (Weapon != null && Weapon.W_DamageType != DamageType.Undef) { DamageType = Weapon.W_DamageType; } else { DamageType = DamageType.Pierce; } } } else { DamageType = attacker.GetDamageType(false, CombatType.Melee); } // TODO: combat maneuvers for player? BaseDamageMod = attacker.GetBaseDamageMod(DamageSource); BaseDamageMod.DamageBonus += damageBonus; // some quest bows can have built-in damage bonus if (Weapon?.WeenieType == WeenieType.MissileLauncher) { BaseDamageMod.DamageBonus += Weapon.Damage ?? 0; } if (DamageSource.ItemType == ItemType.MissileWeapon) { BaseDamageMod.ElementalBonus = WorldObject.GetMissileElementalDamageBonus(attacker, DamageType); } BaseDamage = (float)ThreadSafeRandom.Next(BaseDamageMod.MinDamage, BaseDamageMod.MaxDamage); }