public void DoGaze()
{
Mobile target = FindRandomMedusaTarget();
Map map = Map;
if (map == null || target == null)
{
return;
}
if ((target is BaseCreature && ((BaseCreature)target).SummonMaster != this) || CanBeHarmful(target))
{
if (CheckBlockGaze(target))
{
if (GorgonLense.TotalCharges(target) == 0)
{
target.SendLocalizedMessage(1112600); // Your lenses crumble. You are no longer protected from Medusa's gaze!
}
else
{
target.SendLocalizedMessage(1112599); //Your Gorgon Lens deflect Medusa's petrifying gaze!
}
}
else
{
BaseCreature clone = new MedusaClone(target);
bool validLocation = false;
Point3D loc = Location;
for (int j = 0; !validLocation && j < 10; ++j)
{
int x = X + Utility.Random(10) - 1;
int y = Y + Utility.Random(10) - 1;
int z = map.GetAverageZ(x, y);
if (validLocation = map.CanFit(x, y, Z, 16, false, false))
{
loc = new Point3D(x, y, Z);
}
else if (validLocation = map.CanFit(x, y, z, 16, false, false))
{
loc = new Point3D(x, y, z);
}
}
Effects.SendLocationEffect(loc, target.Map, 0x37B9, 10, 5);
clone.Frozen = clone.Blessed = true;
clone.SolidHueOverride = 761;
target.Frozen = target.Blessed = true;
target.SolidHueOverride = 761;
//clone.MoveToWorld(loc, target.Map);
BaseCreature.Summon(clone, false, this, loc, 0, TimeSpan.FromMinutes(90));
if (target is BaseCreature && !((BaseCreature)target).Summoned && ((BaseCreature)target).GetMaster() != null)
{
((BaseCreature)target).GetMaster().SendLocalizedMessage(1113281, null, 43); // Your pet has been petrified!
}
else
{
target.SendLocalizedMessage(1112768); // You have been turned to stone!!!
}
new GazeTimer(target, clone, this, Utility.RandomMinMax(5, 10)).Start();
m_GazeDelay = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(45, 75));
m_Helpers.Add(clone);
m_TurnedToStone.Add(target);
BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.MedusaStone, 1153790, 1153825));
return;
}
}
m_GazeDelay = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(25, 65));
}