I'm sure a lot of you have noticed, but on most servers where the mobs actually do move, you can stand directly south (thats.. down.. for you slow people) of the monster, they stop. here is how to fix:
go to your Move() function, and find byte ToDir = (blah blah blah) and replace it with a much more correct calculation:
Code:
byte ToDir = (byte)((7 - MyMath.PointDirecton(PosX, PosY, Target.LocX, Target.LocY) / 45 % 8));
next change:
Code:
if (!Other.PlaceFree(PosX, PosY, ToDir))
return;
to
Code:
if (!Other.PlaceFree(PosX, PosY, ToDir, (uint)Map))
return;
rightclick on PlaceFree and click "Go To Definition"
and replace the code for PlaceFree with:
Code:
public static bool PlaceFree(short X, short Y, byte MoveDir, uint map)
{
bool Ret = true;
switch (MoveDir)
{
case 0: Y += 1; break;
case 1: X -= 1; Y += 1; break;
case 2: X -= 1; break;
case 3: X -= 1;Y -= 1; break;
case 4: Y -= 1; break;
case 5: X += 1; Y -= 1; break;
case 6: X += 1; break;
case 7: Y += 1; X += 1;break;
}
foreach (DictionaryEntry DE in Mobs.AllMobs)
{
SingleMob Mob = (SingleMob)DE.Value;
if(Mob.Map == map)
if (Mob.Alive)
if (Mob.PosX == X)
if (Mob.PosY == Y)
Ret = false;
}
return Ret;
}
}
Finally, back in Entities.cs, under what you just changed you have:
Code:
short AddX = 0;
short AddY = 0;
change it to:
Code:
short AddX = 0;
short AddY = 1;
and now mobs wont just STOP, they will go a bit southwest (thats down and left) then continue chasing you.