public void CheckChargeResolved() { double spawnPercent = (double)intervalCount / (double)totalIntervals; if (m_IsCharging) { bool chargeComplete = false; bool chargeFail = false; if (Combatant == null || m_ChargeTarget == null) { chargeFail = true; } else if (Combatant != m_ChargeTarget || !Combatant.Alive || Combatant.Hidden || GetDistanceToSqrt(Combatant.Location) > 24 || !InLOS(Combatant) || DateTime.UtcNow > m_ChargeTimeout) { chargeFail = true; } if (chargeFail) { m_IsCharging = false; m_ChargeTarget = null; ActiveSpeed = 0.4; PassiveSpeed = 0.4; CurrentSpeed = 0.4; } else { if (GetDistanceToSqrt(Combatant) <= 1.5) { m_IsCharging = false; m_ChargeTarget = null; ActiveSpeed = 0.4; PassiveSpeed = 0.4; CurrentSpeed = 0.4; m_NextChargeAllowed = DateTime.UtcNow + TimeSpan.FromSeconds(30 - (20 * spawnPercent)); m_NextAbilityAllowed = DateTime.UtcNow + TimeSpan.FromSeconds(10 - (8 * spawnPercent)); PublicOverheadMessage(MessageType.Regular, 0, false, "*tramples opponent*"); DictCombatTargetingWeight[CombatTargetingWeight.CurrentCombatant] = 4; Effects.PlaySound(Location, Map, 0x59C); Effects.PlaySound(Combatant.Location, Combatant.Map, Combatant.GetHurtSound()); double damage = DamageMax; if (Combatant is BaseCreature) { damage *= 1.5; } new Blood().MoveToWorld(Combatant.Location, Combatant.Map); int bloodCount = 2 + (int)(Math.Ceiling(6 * spawnPercent)); for (int a = 0; a < bloodCount; a++) { new Blood().MoveToWorld(new Point3D(Combatant.Location.X + Utility.RandomList(-2, 2), Combatant.Location.Y + Utility.RandomList(-2, 2), Combatant.Location.Z), Map); } new Blood().MoveToWorld(Combatant.Location, Combatant.Map); SpecialAbilities.BleedSpecialAbility(1.0, this, Combatant, damage, 10.0, -1, true, "", "The reaver's lance impales you, causing you to bleed!", "-1"); AOS.Damage(Combatant, (int)damage, 100, 0, 0, 0, 0); if (Combatant is PlayerMobile) { Combatant.Animate(21, 6, 1, true, false, 0); } else if (Combatant is BaseCreature) { BaseCreature bc_Combatant = Combatant as BaseCreature; if (bc_Combatant.IsHighSeasBodyType) { bc_Combatant.Animate(2, 14, 1, true, false, 0); } else if (bc_Combatant.Body != null) { if (bc_Combatant.Body.IsHuman) { bc_Combatant.Animate(21, 6, 1, true, false, 0); } else { bc_Combatant.Animate(2, 4, 1, true, false, 0); } } } SpecialAbilities.HinderSpecialAbility(1.0, this, Combatant, 1.0, 3, false, -1, false, "", "You have been trampled and can't move!", "-1"); } } } else { DictCombatTargetingWeight[CombatTargetingWeight.CurrentCombatant] = 4; m_ChargeTarget = null; ActiveSpeed = 0.4; PassiveSpeed = 0.4; CurrentSpeed = 0.4; } }
public void CheckChargeResolved() { if (!m_ChargeInProgress) { return; } bool chargeExpired = false; bool clearCharge = false; if (Combatant == null) { chargeExpired = true; } else if (!Combatant.Alive || Combatant.Hidden || Utility.GetDistance(Location, Combatant.Location) > 24 || DateTime.UtcNow > m_ChargeTimeout) { chargeExpired = true; } if (chargeExpired) { clearCharge = true; } else if (SpecialAbilities.Exists(Combatant)) { if (Utility.GetDistance(Location, Combatant.Location) <= 1) { PublicOverheadMessage(MessageType.Regular, 0, false, "*tramples opponent*"); Effects.PlaySound(Location, Map, 0x59C); Effects.PlaySound(Combatant.Location, Combatant.Map, Combatant.GetHurtSound()); double damage = DamageMax; if (Combatant is BaseCreature) { damage *= 1.5; } new Blood().MoveToWorld(Combatant.Location, Combatant.Map); AOS.Damage(Combatant, (int)damage, 100, 0, 0, 0, 0); if (Combatant is PlayerMobile) { Combatant.Animate(21, 6, 1, true, false, 0); } else if (Combatant is BaseCreature) { BaseCreature bc_Combatant = Combatant as BaseCreature; if (bc_Combatant.IsHighSeasBodyType) { bc_Combatant.Animate(2, 14, 1, true, false, 0); } else if (bc_Combatant.Body != null) { if (bc_Combatant.Body.IsHuman) { bc_Combatant.Animate(21, 6, 1, true, false, 0); } else { bc_Combatant.Animate(2, 4, 1, true, false, 0); } } } SpecialAbilities.HinderSpecialAbility(1.0, this, Combatant, 1.0, 1, false, -1, false, "", "You have been trampled and can't move!", "-1"); clearCharge = true; } } if (clearCharge) { ClearCharge(); } }