fix: Fix direction change speed hack (#1194)
This commit is contained in:
parent
9b2b34f5fb
commit
d5416b6dec
4 changed files with 92 additions and 164 deletions
|
|
@ -53,31 +53,33 @@ namespace Server.Items
|
|||
|
||||
private static void Shoot(PlayerMobile from, Mobile target, INinjaWeapon weapon)
|
||||
{
|
||||
if (from != target && CanUseWeapon(from, weapon) && from.CanBeHarmful(target))
|
||||
if (from == target || !CanUseWeapon(from, weapon) || !from.CanBeHarmful(target))
|
||||
{
|
||||
if (weapon.WeaponMinRange == 0 || !from.InRange(target, weapon.WeaponMinRange))
|
||||
return;
|
||||
}
|
||||
|
||||
if (weapon.WeaponMinRange == 0 || !from.InRange(target, weapon.WeaponMinRange))
|
||||
{
|
||||
from.NinjaWepCooldown = true;
|
||||
|
||||
from.Direction = from.GetDirectionTo(target);
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
weapon.AttackAnimation(from, target);
|
||||
|
||||
ConsumeUse(weapon);
|
||||
|
||||
if (CombatCheck(from, target))
|
||||
{
|
||||
from.NinjaWepCooldown = true;
|
||||
|
||||
from.Direction = from.GetDirectionTo(target);
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
weapon.AttackAnimation(from, target);
|
||||
|
||||
ConsumeUse(weapon);
|
||||
|
||||
if (CombatCheck(from, target))
|
||||
{
|
||||
Timer.StartTimer(TimeSpan.FromSeconds(1.0), () => OnHit(from, target, weapon));
|
||||
}
|
||||
|
||||
Timer.StartTimer(TimeSpan.FromSeconds(2.5), () => from.NinjaWepCooldown = false);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1063303); // Your target is too close!
|
||||
Timer.StartTimer(TimeSpan.FromSeconds(1.0), () => OnHit(from, target, weapon));
|
||||
}
|
||||
|
||||
Timer.StartTimer(TimeSpan.FromSeconds(2.5), () => from.NinjaWepCooldown = false);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1063303); // Your target is too close!
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,11 +71,13 @@ public class Lockpick : Item
|
|||
|
||||
if (targeted is ILockpickable lockpickable)
|
||||
{
|
||||
var item = lockpickable as Item;
|
||||
from.Direction = from.GetDirectionTo(item);
|
||||
|
||||
if (lockpickable.Locked)
|
||||
if (lockpickable is Item item && lockpickable.Locked)
|
||||
{
|
||||
if (item.RootParent != from)
|
||||
{
|
||||
from.Direction = from.GetDirectionTo(item);
|
||||
}
|
||||
|
||||
from.PlaySound(0x241);
|
||||
|
||||
new InternalTimer(from, lockpickable, m_Item).Start();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue