private static void OnRegionChange(Player player, uint newRX, uint newRY) { Region r = Regions[newRX + (player.RegionX - newRX) * 1][newRY + (player.RegionY - newRY) * 1]; if (r != null) { for (int i = 0; i < r.Npcs.Count; i++) { ClientPacketHandler.send_EntityAck(GObjectManager.Npcs[r.Npcs[i]]); ClientPacketHandler.send_EntityState(player, GObjectManager.Npcs[r.Npcs[i]].Handle, 0x0); ClientPacketHandler.send_Packet516(player, GObjectManager.Npcs[r.Npcs[i]].Handle); } } player.RegionX = newRX; player.RegionY = newRY; ClientPacketHandler.send_RegionAck(player, newRX, newRY); }
internal static void AddMobToRegion(Monster mob) { GetRegion(mob.Position.X, mob.Position.Y).Monsters.Add(mob.Handle); ClientPacketHandler.send_EntityAck(mob); }