Why the player is not hidding after he gets teleported to the taget location?
all my desperate attemps are marked as //my fail edit
all my desperate attemps are marked as //my fail edit
Code:
public void Target( object op )
{
IPoint3D p = op as IPoint3D;
Mobile mobileTarget = op as Mobile;
IPoint3D orig = p;
Map map = Caster.Map;
SpellHelper.GetSurfaceTop( ref p );
if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.TeleportFrom ) )
{
}
else if ( !SpellHelper.CheckTravel( Caster, map, new Point3D( p ), TravelCheckType.TeleportTo ) )
{
}
else if (mobileTarget == null && ( map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z)))
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if (Region.Find(new Point3D(p),map) is HouseRegion)
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( SpellHelper.CheckMulti( new Point3D( p ), map ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if (SphereSpellTarget is BaseWand)
{
BaseWand bw = SphereSpellTarget as BaseWand;
bw.RechargeWand(Caster, this);
}
else if ( CheckSequence())
{
if (op != null && Caster.InRange(new Point2D(p.X,p.Y),4))
{
Mobile m = Caster;
Point3D from = m.Location;
Point3D to = new Point3D(p);
m.Location = to;
Caster.Hidden = true; //my fail edit
m.Hidden = true; //my fail edit
PlayerMobile pm = m as PlayerMobile; //my fail edit
m.ProcessDelta();
m.Hidden = true; ////my fail edit
if (pm != null) ////my fail edit
((PlayerMobile)pm).Hidden = true; //my fail edit
pm.IsStealthing = true; //my fail edit
((PlayerMobile)pm).IsStealthing = true; //my fail edit
((PlayerMobile)Caster).IsStealthing = true; //my fail edit
Effects.SendLocationParticles(EffectItem.Create(from, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023,84);
}
else
Caster.SendAsciiMessage("You cannot see that!");
}
FinishSequence();
}