public override void BeforeBreak(Mobile from, InteractionType interactionType) { UOACZEvents.SourceOfCorruptionDamaged(true); }
public override void AfterReceiveDamage(Mobile from, int damage, InteractionType interactionType) { base.AfterReceiveDamage(from, damage, interactionType); PlayerMobile player = from as PlayerMobile; if (player != null) { UOACZPersistance.CheckAndCreateUOACZAccountEntry(player); player.m_UOACZAccountEntry.TotalObjectDamage++; } if (this is UOACZCorruptionSourcestone) { UOACZEvents.SourceOfCorruptionDamaged(false); if (player != null) { UOACZPersistance.CheckAndCreateUOACZAccountEntry(player); if (player.IsUOACZHuman) { if (Utility.RandomDouble() <= UOACZSystem.HumanDamageSourceStoneScoreChance) { UOACZSystem.ChangeStat(player, UOACZSystem.UOACZStatType.HumanScore, 1, true); } if (player.Backpack != null) { if (Utility.RandomDouble() <= UOACZSystem.HumanDamageSourceStoneSurvivalStoneChance * UOACZPersistance.HumanBalanceScalar) { player.Backpack.DropItem(new UOACZSurvivalStone(player)); player.SendMessage(UOACZSystem.greenTextHue, "You have earned a survival stone for damaging the corruption sourcestone!"); } if (Utility.RandomDouble() <= UOACZSystem.HumanDamageSourceStoneUpgradeTokenChance * UOACZPersistance.HumanBalanceScalar) { player.Backpack.DropItem(new UOACZHumanUpgradeToken(player)); player.SendMessage(UOACZSystem.greenTextHue, "You have earned an upgrade token for damaging the corruption sourcestone!"); } } } } } else if (this is UOACZStockpile) { if (player != null) { UOACZPersistance.CheckAndCreateUOACZAccountEntry(player); if (player.IsUOACZUndead) { if (Utility.RandomDouble() <= UOACZSystem.UndeadDamageStockpileScoreChance) { UOACZSystem.ChangeStat(player, UOACZSystem.UOACZStatType.UndeadScore, 1, true); } if (Utility.RandomDouble() <= UOACZSystem.UndeadDamageStockpileCorruptionTokenChance * UOACZPersistance.UndeadBalanceScalar) { if (player.Backpack != null) { player.Backpack.DropItem(new UOACZCorruptionStone(player)); player.SendMessage(UOACZSystem.greenTextHue, "You have received a corruption stone for damaging a stockpile!"); } } if (Utility.RandomDouble() <= UOACZSystem.UndeadDamageStockpileUpgradeTokenChance * UOACZPersistance.UndeadBalanceScalar) { if (player.Backpack != null) { player.Backpack.DropItem(new UOACZUndeadUpgradeToken(player)); player.SendMessage(UOACZSystem.greenTextHue, "You have received an upgrade token for damaging a stockpile!"); } } if (Utility.RandomDouble() <= UOACZSystem.UndeadDamageStockpileRewardChance * UOACZPersistance.UndeadBalanceScalar) { if (player.Backpack != null) { player.Backpack.DropItem(new UOACZBrains()); player.SendMessage(UOACZSystem.greenTextHue, "You have received a reward for damaging a stockpile!"); } } } } } else { if (player != null) { UOACZPersistance.CheckAndCreateUOACZAccountEntry(player); if (player.IsUOACZUndead) { bool outpostObject = false; if (UOACZPersistance.m_OutpostComponents.Contains(this)) { outpostObject = true; } double scoreChance = UOACZSystem.UndeadDamageObjectScoreChance; double corruptionChance = UOACZSystem.UndeadDamageObjectCorruptionTokenChance * UOACZPersistance.UndeadBalanceScalar; double upgradeChance = UOACZSystem.UndeadDamageObjectUpgradeTokenChance * UOACZPersistance.UndeadBalanceScalar; double rewardChance = UOACZSystem.UndeadDamageObjectRewardChance * UOACZPersistance.UndeadBalanceScalar; if (outpostObject) { scoreChance *= UOACZSystem.UndeadDamageOutpostRewardReduction; corruptionChance *= UOACZSystem.UndeadDamageOutpostRewardReduction; upgradeChance *= UOACZSystem.UndeadDamageOutpostRewardReduction; rewardChance *= UOACZSystem.UndeadDamageOutpostRewardReduction; if (UOACZPersistance.m_HumanObjective1 == UOACZPersistance.m_HumanObjective1Target) { scoreChance *= UOACZSystem.UndeadDamageOutpostAlreadyBuiltRewardReduction; corruptionChance *= UOACZSystem.UndeadDamageOutpostAlreadyBuiltRewardReduction; upgradeChance *= UOACZSystem.UndeadDamageOutpostAlreadyBuiltRewardReduction; rewardChance *= UOACZSystem.UndeadDamageOutpostAlreadyBuiltRewardReduction; } } if (Utility.RandomDouble() <= scoreChance) { UOACZSystem.ChangeStat(player, UOACZSystem.UOACZStatType.UndeadScore, 1, true); } if (player.Backpack != null) { if (Utility.RandomDouble() <= corruptionChance) { player.Backpack.DropItem(new UOACZCorruptionStone(player)); player.SendMessage(UOACZSystem.greenTextHue, "You have earned a corruption stone for destruction!"); } if (Utility.RandomDouble() <= upgradeChance) { player.Backpack.DropItem(new UOACZUndeadUpgradeToken(player)); player.SendMessage(UOACZSystem.greenTextHue, "You have earned an upgrade token for destruction!"); } if (Utility.RandomDouble() <= rewardChance) { player.Backpack.DropItem(new UOACZBrains()); player.SendMessage(UOACZSystem.greenTextHue, "You have received a reward for destruction."); } } } } } }