fix: Removes duplicative spell checks (#849)

This commit is contained in:
Kamron Batman 2021-11-14 18:45:16 -08:00 • committed by GitHub
parent e5f55a424a
commit 5df7bf6a75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 78 additions and 425 deletions

View file

@ -164,36 +164,33 @@ namespace Server.Targeting
{ {
OnTargetOutOfRange(from, targeted); OnTargetOutOfRange(from, targeted);
} }
else else if (!from.CanSee(targeted))
{ {
if (!from.CanSee(targeted)) OnCantSeeTarget(from, targeted);
{ }
OnCantSeeTarget(from, targeted); else if (CheckLOS && !from.InLOS(targeted))
} {
else if (CheckLOS && !from.InLOS(targeted)) OnTargetOutOfLOS(from, targeted);
{ }
OnTargetOutOfLOS(from, targeted); else if (item?.InSecureTrade == true)
} {
else if (item?.InSecureTrade == true) OnTargetInSecureTrade(from, targeted);
{ }
OnTargetInSecureTrade(from, targeted); else if (item?.IsAccessibleTo(from) == false)
} {
else if (item?.IsAccessibleTo(from) == false) OnTargetNotAccessible(from, targeted);
{ }
OnTargetNotAccessible(from, targeted); else if (item?.CheckTarget(from, this, targeted) == false)
} {
else if (item?.CheckTarget(from, this, targeted) == false) OnTargetUntargetable(from, targeted);
{ }
OnTargetUntargetable(from, targeted); else if (mobile?.CheckTarget(from, this, mobile) == false)
} {
else if (mobile?.CheckTarget(from, this, mobile) == false) OnTargetUntargetable(from, mobile);
{ }
OnTargetUntargetable(from, mobile); else if (from.Region.OnTarget(from, this, targeted))
} {
else if (from.Region.OnTarget(from, this, targeted)) OnTarget(from, targeted);
{
OnTarget(from, targeted);
}
} }
OnTargetFinish(from); OnTargetFinish(from);

View file

@ -7,11 +7,9 @@ using Server.Gumps;
using Server.Items; using Server.Items;
using Server.Menus.ItemLists; using Server.Menus.ItemLists;
using Server.Menus.Questions; using Server.Menus.Questions;
using Server.Misc;
using Server.Mobiles; using Server.Mobiles;
using Server.Multis; using Server.Multis;
using Server.Network; using Server.Network;
using Server.Saves;
using Server.Spells; using Server.Spells;
using Server.Targeting; using Server.Targeting;
using Server.Targets; using Server.Targets;

View file

@ -1,14 +1,9 @@
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.IO.Compression; using System.IO.Compression;
using System.Net;
using System.Net.Http; using System.Net.Http;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Server.Buffers; using Server.Buffers;
namespace Server.Compression namespace Server.Compression

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;

View file

@ -24,16 +24,7 @@ namespace Server.Spells.Eighth
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (m == Caster)
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (m == Caster)
{ {
Caster.SendLocalizedMessage(501039); // Thou can not resurrect thyself. Caster.SendLocalizedMessage(501039); // Thou can not resurrect thyself.
} }

View file

@ -25,15 +25,7 @@ namespace Server.Spells.Fifth
public void Target(Item item) public void Target(Item item)
{ {
if (item == null) if (!item.GetType().IsDefined(typeof(DispellableFieldAttribute), false))
{
Caster.SendLocalizedMessage(1005049); // That cannot be dispelled.
}
else if (!Caster.CanSee(item))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (!item.GetType().IsDefined(typeof(DispellableFieldAttribute), false))
{ {
Caster.SendLocalizedMessage(1005049); // That cannot be dispelled. Caster.SendLocalizedMessage(1005049); // That cannot be dispelled.
} }

View file

@ -30,16 +30,7 @@ namespace Server.Spells.Fifth
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (Core.AOS)
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (Core.AOS)
{ {
if (Caster.CanBeHarmful(m) && CheckSequence()) if (Caster.CanBeHarmful(m) && CheckSequence())
{ {

View file

@ -25,17 +25,7 @@ namespace Server.Spells.Fifth
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (Core.AOS && (m.Frozen || m.Paralyzed || m.Spell?.IsCasting == true && m.Spell is not PaladinSpell))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (Core.AOS && (m.Frozen || m.Paralyzed ||
m.Spell?.IsCasting == true && !(m.Spell is PaladinSpell)))
{ {
Caster.SendLocalizedMessage(1061923); // The target is already frozen. Caster.SendLocalizedMessage(1061923); // The target is already frozen.
} }

View file

@ -28,11 +28,7 @@ namespace Server.Spells.Fifth
public void Target(IPoint3D p) public void Target(IPoint3D p)
{ {
if (!Caster.CanSee(p)) if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{ {
SpellHelper.Turn(Caster, p); SpellHelper.Turn(Caster, p);

View file

@ -21,16 +21,7 @@ namespace Server.Spells.First
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckHSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckHSequence(m))
{ {
SpellHelper.Turn(Caster, m); SpellHelper.Turn(Caster, m);

View file

@ -21,16 +21,7 @@ namespace Server.Spells.First
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckHSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckHSequence(m))
{ {
SpellHelper.Turn(Caster, m); SpellHelper.Turn(Caster, m);

View file

@ -26,16 +26,7 @@ namespace Server.Spells.First
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (m.IsDeadBondedPet)
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (m.IsDeadBondedPet)
{ {
Caster.SendLocalizedMessage(1060177); // You cannot heal a creature that is already dead! Caster.SendLocalizedMessage(1060177); // You cannot heal a creature that is already dead!
} }

View file

@ -24,16 +24,7 @@ namespace Server.Spells.First
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckHSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckHSequence(m))
{ {
var source = Caster; var source = Caster;

View file

@ -21,16 +21,7 @@ namespace Server.Spells.First
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckHSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckHSequence(m))
{ {
SpellHelper.Turn(Caster, m); SpellHelper.Turn(Caster, m);

View file

@ -29,11 +29,7 @@ namespace Server.Spells.Fourth
public void Target(IPoint3D p) public void Target(IPoint3D p)
{ {
if (!Caster.CanSee(p)) if (CheckSequence())
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckSequence())
{ {
SpellHelper.Turn(Caster, p); SpellHelper.Turn(Caster, p);

View file

@ -30,11 +30,7 @@ namespace Server.Spells.Fourth
public void Target(IPoint3D p) public void Target(IPoint3D p)
{ {
if (!Caster.CanSee(p)) if (CheckSequence())
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckSequence())
{ {
SpellHelper.Turn(Caster, p); SpellHelper.Turn(Caster, p);

View file

@ -25,16 +25,7 @@ namespace Server.Spells.Fourth
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckHSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckHSequence(m))
{ {
SpellHelper.Turn(Caster, m); SpellHelper.Turn(Caster, m);
@ -46,8 +37,8 @@ namespace Server.Spells.Fourth
SpellHelper.AddStatCurse(Caster, m, StatType.Int); SpellHelper.AddStatCurse(Caster, m, StatType.Int);
SpellHelper.DisableSkillCheck = false; SpellHelper.DisableSkillCheck = false;
if (Caster.Player && m.Player /*&& Caster != m */ && !UnderEffect(m) // On OSI you CAN curse yourself and get this effect.
) // On OSI you CAN curse yourself and get this effect. if (Caster.Player && m.Player /*&& Caster != m */ && !UnderEffect(m))
{ {
var duration = SpellHelper.GetDuration(Caster, m); var duration = SpellHelper.GetDuration(Caster, m);
m_UnderEffect.Add(m); m_UnderEffect.Add(m);

View file

@ -28,11 +28,7 @@ namespace Server.Spells.Fourth
public void Target(IPoint3D p) public void Target(IPoint3D p)
{ {
if (!Caster.CanSee(p)) if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{ {
SpellHelper.Turn(Caster, p); SpellHelper.Turn(Caster, p);

View file

@ -27,16 +27,7 @@ namespace Server.Spells.Fourth
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (m is BaseCreature creature && creature.IsAnimatedDead)
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (m is BaseCreature creature && creature.IsAnimatedDead)
{ {
Caster.SendLocalizedMessage(1061654); // You cannot heal that which is not alive. Caster.SendLocalizedMessage(1061654); // You cannot heal that which is not alive.
} }

View file

@ -23,16 +23,7 @@ namespace Server.Spells.Fourth
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckHSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckHSequence(m))
{ {
SpellHelper.Turn(Caster, m); SpellHelper.Turn(Caster, m);

View file

@ -26,16 +26,7 @@ namespace Server.Spells.Fourth
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckHSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckHSequence(m))
{ {
SpellHelper.Turn(Caster, m); SpellHelper.Turn(Caster, m);

View file

@ -41,11 +41,7 @@ namespace Server.Spells.Mysticism
public void Target(Mobile targeted) public void Target(Mobile targeted)
{ {
if (!Caster.CanSee(targeted)) if (CheckHSequence(targeted))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckHSequence(targeted))
{ {
SpellHelper.Turn(Caster, targeted); SpellHelper.Turn(Caster, targeted);

View file

@ -22,16 +22,7 @@ namespace Server.Spells.Second
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckBSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckBSequence(m))
{ {
SpellHelper.Turn(Caster, m); SpellHelper.Turn(Caster, m);

View file

@ -22,16 +22,7 @@ namespace Server.Spells.Second
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckBSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckBSequence(m))
{ {
SpellHelper.Turn(Caster, m); SpellHelper.Turn(Caster, m);

View file

@ -22,16 +22,7 @@ namespace Server.Spells.Second
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckBSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckBSequence(m))
{ {
SpellHelper.Turn(Caster, m); SpellHelper.Turn(Caster, m);

View file

@ -23,16 +23,7 @@ namespace Server.Spells.Second
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckHSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckHSequence(m))
{ {
SpellHelper.Turn(Caster, m); SpellHelper.Turn(Caster, m);

View file

@ -27,10 +27,6 @@ namespace Server.Spells.Second
{ {
Caster.SendLocalizedMessage(502942); // You can't trap this! Caster.SendLocalizedMessage(502942); // You can't trap this!
} }
else if (!Caster.CanSee(item))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (cont.TrapType != TrapType.None && cont.TrapType != TrapType.MagicTrap) else if (cont.TrapType != TrapType.None && cont.TrapType != TrapType.MagicTrap)
{ {
DoFizzle(); DoFizzle();

View file

@ -22,13 +22,9 @@ namespace Server.Spells.Second
public void Target(Item item) public void Target(Item item)
{ {
if (!(item is TrappableContainer cont)) if (item is not TrappableContainer cont)
{ {
Caster.SendMessage("You can't disarm that"); // TODO: Localization? Caster.SendLocalizedMessage(502373); // That doesn't appear to be trapped
}
else if (!Caster.CanSee(item))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
} }
else if (cont.TrapType != TrapType.None && cont.TrapType != TrapType.MagicTrap) else if (cont.TrapType != TrapType.None && cont.TrapType != TrapType.MagicTrap)
{ {

View file

@ -22,16 +22,7 @@ namespace Server.Spells.Second
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckBSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckBSequence(m))
{ {
SpellHelper.Turn(Caster, m); SpellHelper.Turn(Caster, m);

View file

@ -28,11 +28,7 @@ namespace Server.Spells.Seventh
public void Target(IPoint3D p) public void Target(IPoint3D p)
{ {
if (!Caster.CanSee(p)) if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{ {
SpellHelper.Turn(Caster, p); SpellHelper.Turn(Caster, p);

View file

@ -28,11 +28,7 @@ namespace Server.Spells.Seventh
public void Target(IPoint3D p) public void Target(IPoint3D p)
{ {
if (!Caster.CanSee(p)) if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{ {
SpellHelper.Turn(Caster, p); SpellHelper.Turn(Caster, p);

View file

@ -23,16 +23,7 @@ namespace Server.Spells.Seventh
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckHSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckHSequence(m))
{ {
SpellHelper.Turn(Caster, m); SpellHelper.Turn(Caster, m);

View file

@ -24,16 +24,7 @@ namespace Server.Spells.Seventh
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckHSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckHSequence(m))
{ {
SpellHelper.Turn(Caster, m); SpellHelper.Turn(Caster, m);

View file

@ -25,11 +25,7 @@ namespace Server.Spells.Seventh
public void Target(IPoint3D p) public void Target(IPoint3D p)
{ {
if (!Caster.CanSee(p)) if (CheckSequence())
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckSequence())
{ {
SpellHelper.Turn(Caster, p); SpellHelper.Turn(Caster, p);

View file

@ -28,11 +28,7 @@ namespace Server.Spells.Seventh
public void Target(IPoint3D p) public void Target(IPoint3D p)
{ {
if (!Caster.CanSee(p)) if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{ {
SpellHelper.Turn(Caster, p); SpellHelper.Turn(Caster, p);

View file

@ -24,16 +24,7 @@ namespace Server.Spells.Sixth
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (m is not BaseCreature { IsDispellable: true } bc)
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (!(m is BaseCreature bc && bc.IsDispellable))
{ {
Caster.SendLocalizedMessage(1005049); // That cannot be dispelled. Caster.SendLocalizedMessage(1005049); // That cannot be dispelled.
} }

View file

@ -23,16 +23,7 @@ namespace Server.Spells.Sixth
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckHSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckHSequence(m))
{ {
var source = Caster; var source = Caster;

View file

@ -26,16 +26,7 @@ namespace Server.Spells.Sixth
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (Caster.CanBeHarmful(m) && CheckSequence())
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (Caster.CanBeHarmful(m) && CheckSequence())
{ {
Mobile attacker = Caster, defender = m; Mobile attacker = Caster, defender = m;

View file

@ -28,16 +28,7 @@ namespace Server.Spells.Sixth
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (m is BaseVendor or PlayerVendor || m.AccessLevel > Caster.AccessLevel)
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (m is BaseVendor || m is PlayerVendor || m.AccessLevel > Caster.AccessLevel)
{ {
Caster.SendLocalizedMessage(501857); // This spell won't work on that! Caster.SendLocalizedMessage(501857); // This spell won't work on that!
} }

View file

@ -24,7 +24,7 @@ namespace Server.Spells.Sixth
public void Target(Item item) public void Target(Item item)
{ {
if (!(item is RecallRune rune)) if (item is not RecallRune rune)
{ {
Caster.NetState.SendMessageLocalized( Caster.NetState.SendMessageLocalized(
Caster.Serial, Caster.Serial,
@ -32,13 +32,9 @@ namespace Server.Spells.Sixth
MessageType.Regular, MessageType.Regular,
0x3B2, 0x3B2,
3, 3,
501797, 501797, // I cannot mark that object.
Caster.Name Caster.Name
); // I cannot mark that object. );
}
else if (!Caster.CanSee(rune))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
} }
else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.Mark)) else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.Mark))
{ {
@ -49,11 +45,8 @@ namespace Server.Spells.Sixth
} }
else if (!rune.IsChildOf(Caster.Backpack)) else if (!rune.IsChildOf(Caster.Backpack))
{ {
Caster.LocalOverheadMessage( // You must have this rune in your backpack in order to mark it.
MessageType.Regular, Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1062422);
0x3B2,
1062422
); // You must have this rune in your backpack in order to mark it.
} }
else if (CheckSequence()) else if (CheckSequence())
{ {

View file

@ -24,11 +24,7 @@ namespace Server.Spells.Sixth
public void Target(IPoint3D p) public void Target(IPoint3D p)
{ {
if (!Caster.CanSee(p)) if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{ {
SpellHelper.Turn(Caster, p); SpellHelper.Turn(Caster, p);

View file

@ -27,11 +27,7 @@ namespace Server.Spells.Sixth
public void Target(IPoint3D p) public void Target(IPoint3D p)
{ {
if (!Caster.CanSee(p)) if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{ {
SpellHelper.Turn(Caster, p); SpellHelper.Turn(Caster, p);

View file

@ -22,11 +22,7 @@ namespace Server.Spells.Sixth
public void Target(IPoint3D p) public void Target(IPoint3D p)
{ {
if (!Caster.CanSee(p)) if (CheckSequence())
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckSequence())
{ {
SpellHelper.Turn(Caster, p); SpellHelper.Turn(Caster, p);
SpellHelper.GetSurfaceTop(ref p); SpellHelper.GetSurfaceTop(ref p);

View file

@ -30,15 +30,7 @@ namespace Server.Spells.Spellweaving
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (m.IsDeadBondedPet || !m.Alive)
{
Caster.SendLocalizedMessage(1072077); // You may only cast this spell on yourself or a bonded pet.
}
else if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (m.IsDeadBondedPet || !m.Alive)
{ {
// As per Osi: Nothing happens. // As per Osi: Nothing happens.
} }

View file

@ -26,16 +26,7 @@ namespace Server.Spells.Spellweaving
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (m_Table.ContainsKey(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (m_Table.ContainsKey(m))
{ {
Caster.SendLocalizedMessage(501775); // This spell is already in effect. Caster.SendLocalizedMessage(501775); // This spell is already in effect.
} }

View file

@ -18,16 +18,7 @@ namespace Server.Spells.Spellweaving
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckHSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckHSequence(m))
{ {
var loc = m.Location; var loc = m.Location;
loc.Z += 50; loc.Z += 50;

View file

@ -22,16 +22,7 @@ namespace Server.Spells.Third
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckBSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckBSequence(m))
{ {
SpellHelper.Turn(Caster, m); SpellHelper.Turn(Caster, m);

View file

@ -22,16 +22,7 @@ namespace Server.Spells.Third
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckHSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckHSequence(m))
{ {
var source = Caster; var source = Caster;

View file

@ -21,16 +21,7 @@ namespace Server.Spells.Third
public void Target(Mobile m) public void Target(Mobile m)
{ {
if (m == null) if (CheckHSequence(m))
{
return;
}
if (!Caster.CanSee(m))
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (CheckHSequence(m))
{ {
SpellHelper.Turn(Caster, m); SpellHelper.Turn(Caster, m);

View file

@ -25,11 +25,7 @@ namespace Server.Spells.Third
public void Target(IPoint3D p) public void Target(IPoint3D p)
{ {
if (!Caster.CanSee(p)) if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{
Caster.SendLocalizedMessage(500237); // Target can not be seen.
}
else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
{ {
SpellHelper.Turn(Caster, p); SpellHelper.Turn(Caster, p);